Merge TM -> JM
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 01 Jul 2011 16:24:32 -0700
changeset 75939 0c5ed245a04fca6cbf57507eb42414df49d2e671
parent 75938 ffddf68888deb5a8775e9df35bfacd90b5f36a76 (current diff)
parent 72885 f25365ded0a9de9be4eb2c9b98eb5e3c25c7dc17 (diff)
child 75940 670548b1f7ce841766f524cadbaf51aa408bcec9
push idunknown
push userunknown
push dateunknown
milestone7.0a1
Merge TM -> JM
browser/base/content/browser.js
browser/base/content/stylePanel.jsm
browser/base/content/test/browser_inspector_domPanel.js
browser/base/content/test/browser_inspector_highlighter.js
browser/base/content/test/browser_inspector_iframeTest.js
browser/base/content/test/browser_inspector_initialization.js
browser/base/content/test/browser_inspector_scrolling.js
browser/base/content/test/browser_inspector_store.js
browser/base/content/test/browser_inspector_stylePanel.js
browser/base/content/test/browser_inspector_tab_switch.js
browser/base/content/test/browser_inspector_treePanel_input.html
browser/base/content/test/browser_inspector_treePanel_output.js
browser/base/content/test/browser_inspector_treePanel_result.html
browser/base/content/test/browser_inspector_treeSelection.js
browser/branding/aurora/document.png
browser/branding/nightly/document.png
browser/branding/official/document.png
browser/branding/unofficial/document.png
browser/components/places/tests/perf/Makefile.in
browser/components/places/tests/perf/browser_ui_000_data.js
browser/components/places/tests/perf/browser_ui_bookmarks_sidebar.js
browser/components/places/tests/perf/browser_ui_history_menu.js
browser/components/places/tests/perf/browser_ui_history_sidebar.js
browser/components/places/tests/perf/browser_ui_history_sidebar_2.js
browser/components/places/tests/perf/browser_ui_history_sidebar_3.js
browser/components/places/tests/perf/browser_ui_locationbar.js
browser/components/places/tests/perf/perf_large_delete.xul
browser/components/sessionstore/test/browser/browser_394759.js
browser/locales/en-US/chrome/browser/inspector.properties
config/installcfunc.pl
config/installchrome.pl
content/base/public/nsISyncLoadDOMService.idl
content/base/src/nsLoadListenerProxy.cpp
content/base/src/nsLoadListenerProxy.h
content/base/test/test_bug339494.xul
content/base/test/test_bug357450.xul
content/base/test/test_bug571390.xul
content/base/test/test_bug574596.html
content/events/public/nsIEventListenerManager.h
content/events/public/nsPIDOMEventTarget.h
content/events/src/nsDOMEventGroup.cpp
content/events/src/nsDOMEventGroup.h
content/events/src/nsDOMOrientationEvent.cpp
content/events/src/nsDOMOrientationEvent.h
content/events/test/Makefile.in
content/html/content/public/nsIFrameSetElement.h
content/html/content/test/test_bug344615.html
content/html/content/test/test_bug345512.html
content/html/content/test/test_bug345822.html
content/html/content/test/test_bug346485.html
content/html/content/test/test_bug555559.html
content/html/content/test/test_bug556013.html
content/html/content/test/test_bug562932.html
content/html/content/test/test_bug565538.html
content/html/content/test/test_bug566160.html
content/html/content/test/test_bug589696.html
content/xul/templates/tests/bug441785-1.rdf
content/xul/templates/tests/bug441785-2.rdf
content/xul/templates/tests/test_bug441785.xul
content/xul/templates/tests/test_sortservice.xul
dom/base/nsDOMClassInfo.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsJSEnvironment.cpp
dom/interfaces/base/nsIDOMNSFeatureFactory.idl
dom/interfaces/base/nsIDOMWindow2.idl
dom/interfaces/core/nsIDOM3Attr.idl
dom/interfaces/core/nsIDOM3Node.idl
dom/interfaces/events/nsIDOM3EventTarget.idl
dom/interfaces/events/nsIDOMEventGroup.idl
dom/interfaces/events/nsIDOMNSEventTarget.idl
dom/interfaces/html/nsIDOMNSHTMLTextAreaElement.idl
dom/locales/en-US/chrome/storage.properties
dom/src/json/test/unit/test_decode_long_input.js
dom/system/android/nsAccelerometerSystem.cpp
dom/system/android/nsAccelerometerSystem.h
dom/system/cocoa/nsAccelerometerSystem.h
dom/system/cocoa/nsAccelerometerSystem.mm
dom/system/nsAccelerometer.cpp
dom/system/nsAccelerometer.h
dom/system/unix/nsAccelerometerSystem.cpp
dom/system/unix/nsAccelerometerSystem.h
dom/system/windows/nsAccelerometerSystem.cpp
dom/system/windows/nsAccelerometerSystem.h
embedding/browser/activex/src/Makefile.in
embedding/browser/activex/src/common/CPMozillaControl.h
embedding/browser/activex/src/common/ControlEventSink.cpp
embedding/browser/activex/src/common/ControlEventSink.h
embedding/browser/activex/src/common/ControlSite.cpp
embedding/browser/activex/src/common/ControlSite.h
embedding/browser/activex/src/common/ControlSiteIPFrame.cpp
embedding/browser/activex/src/common/ControlSiteIPFrame.h
embedding/browser/activex/src/common/IEHtmlButtonElement.cpp
embedding/browser/activex/src/common/IEHtmlButtonElement.h
embedding/browser/activex/src/common/IEHtmlElement.cpp
embedding/browser/activex/src/common/IEHtmlElement.h
embedding/browser/activex/src/common/IEHtmlElementCollection.cpp
embedding/browser/activex/src/common/IEHtmlElementCollection.h
embedding/browser/activex/src/common/IEHtmlNode.cpp
embedding/browser/activex/src/common/IEHtmlNode.h
embedding/browser/activex/src/common/IEHtmlSelectionObject.cpp
embedding/browser/activex/src/common/IEHtmlSelectionObject.h
embedding/browser/activex/src/common/IEHtmlTxtRange.cpp
embedding/browser/activex/src/common/IEHtmlTxtRange.h
embedding/browser/activex/src/common/IHTMLLocationImpl.h
embedding/browser/activex/src/common/IOleCommandTargetImpl.h
embedding/browser/activex/src/common/IWebBrowserImpl.h
embedding/browser/activex/src/common/ItemContainer.cpp
embedding/browser/activex/src/common/ItemContainer.h
embedding/browser/activex/src/common/Makefile.in
embedding/browser/activex/src/common/PropertyBag.cpp
embedding/browser/activex/src/common/PropertyBag.h
embedding/browser/activex/src/common/PropertyList.h
embedding/browser/activex/src/common/StdAfx.h
embedding/browser/activex/src/control/ActiveScriptSite.cpp
embedding/browser/activex/src/control/ActiveScriptSite.h
embedding/browser/activex/src/control/ActiveXTypes.h
embedding/browser/activex/src/control/BrowserDiagnostics.h
embedding/browser/activex/src/control/DHTMLCmdIds.h
embedding/browser/activex/src/control/DropTarget.cpp
embedding/browser/activex/src/control/DropTarget.h
embedding/browser/activex/src/control/HelperAppDlg.cpp
embedding/browser/activex/src/control/HelperAppDlg.h
embedding/browser/activex/src/control/IEHtmlDocument.cpp
embedding/browser/activex/src/control/IEHtmlDocument.h
embedding/browser/activex/src/control/Makefile.in
embedding/browser/activex/src/control/Master.dsp
embedding/browser/activex/src/control/Master.dsw
embedding/browser/activex/src/control/MozillaBrowser.cpp
embedding/browser/activex/src/control/MozillaBrowser.h
embedding/browser/activex/src/control/MozillaBrowser.ico
embedding/browser/activex/src/control/MozillaBrowser.rgs
embedding/browser/activex/src/control/MozillaControl.cpp
embedding/browser/activex/src/control/MozillaControl.dsp
embedding/browser/activex/src/control/MozillaControl.idl
embedding/browser/activex/src/control/MozillaControl.rc
embedding/browser/activex/src/control/PageSetupDlg.h
embedding/browser/activex/src/control/PromptService.cpp
embedding/browser/activex/src/control/PromptService.h
embedding/browser/activex/src/control/PropertyDlg.cpp
embedding/browser/activex/src/control/PropertyDlg.h
embedding/browser/activex/src/control/StdAfx.cpp
embedding/browser/activex/src/control/StdAfx.h
embedding/browser/activex/src/control/WebBrowserContainer.cpp
embedding/browser/activex/src/control/WebBrowserContainer.h
embedding/browser/activex/src/control/WindowCreator.cpp
embedding/browser/activex/src/control/WindowCreator.h
embedding/browser/activex/src/control/mkctldef.bat
embedding/browser/activex/src/control/mkctldef.sh
embedding/browser/activex/src/control/resource.h
embedding/browser/activex/src/control_kicker/Makefile.in
embedding/browser/activex/src/control_kicker/ReadMe.txt
embedding/browser/activex/src/control_kicker/StdAfx.cpp
embedding/browser/activex/src/control_kicker/StdAfx.h
embedding/browser/activex/src/control_kicker/control_kicker.cpp
embedding/browser/activex/src/control_kicker/control_kicker.dsp
embedding/browser/activex/src/control_kicker/control_kicker.h
embedding/browser/activex/src/control_kicker/mozctlx.def
embedding/browser/activex/src/plugin/LegacyPlugin.cpp
embedding/browser/activex/src/plugin/LegacyPlugin.h
embedding/browser/activex/src/plugin/Makefile.in
embedding/browser/activex/src/plugin/MozActiveX.cpp
embedding/browser/activex/src/plugin/MozActiveX.rc
embedding/browser/activex/src/plugin/MozAxPlugin.java
embedding/browser/activex/src/plugin/PrefObserver.cpp
embedding/browser/activex/src/plugin/StdAfx.cpp
embedding/browser/activex/src/plugin/StdAfx.h
embedding/browser/activex/src/plugin/XPCBrowser.cpp
embedding/browser/activex/src/plugin/XPCBrowser.h
embedding/browser/activex/src/plugin/XPCDocument.cpp
embedding/browser/activex/src/plugin/XPConnect.cpp
embedding/browser/activex/src/plugin/XPConnect.h
embedding/browser/activex/src/plugin/activex.js
embedding/browser/activex/src/plugin/install.js
embedding/browser/activex/src/plugin/npwin.cpp
embedding/browser/activex/src/plugin/nsAxSecurityPolicy.js
embedding/browser/activex/src/plugin/nsIMozAxPlugin.idl
embedding/browser/activex/src/plugin/plugin.sln
embedding/browser/activex/src/plugin/plugin.vcproj
embedding/browser/activex/src/plugin/resource.h
embedding/browser/activex/src/plugin/test.htm
embedding/browser/activex/src/pluginhostctrl/PluginHostCtrl.rgs
embedding/browser/activex/src/pluginhostctrl/README.txt
embedding/browser/activex/src/pluginhostctrl/StdAfx.cpp
embedding/browser/activex/src/pluginhostctrl/StdAfx.h
embedding/browser/activex/src/pluginhostctrl/cab/README.txt
embedding/browser/activex/src/pluginhostctrl/cab/makecab.bat
embedding/browser/activex/src/pluginhostctrl/cab/pluginhostctrl.inf
embedding/browser/activex/src/pluginhostctrl/cab/redist/ATL.DLL
embedding/browser/activex/src/pluginhostctrl/cab/verify.htm
embedding/browser/activex/src/pluginhostctrl/npn.cpp
embedding/browser/activex/src/pluginhostctrl/npn.h
embedding/browser/activex/src/pluginhostctrl/nsPluginHostCtrl.cpp
embedding/browser/activex/src/pluginhostctrl/nsPluginHostCtrl.h
embedding/browser/activex/src/pluginhostctrl/nsPluginHostWnd.cpp
embedding/browser/activex/src/pluginhostctrl/nsPluginHostWnd.h
embedding/browser/activex/src/pluginhostctrl/nsPluginWnd.cpp
embedding/browser/activex/src/pluginhostctrl/nsPluginWnd.h
embedding/browser/activex/src/pluginhostctrl/nsURLDataCallback.cpp
embedding/browser/activex/src/pluginhostctrl/nsURLDataCallback.h
embedding/browser/activex/src/pluginhostctrl/pluginho.bmp
embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.cpp
embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.def
embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.dsp
embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.idl
embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.rc
embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.sln
embedding/browser/activex/src/pluginhostctrl/pluginhostctrl.vcproj
embedding/browser/activex/src/pluginhostctrl/pluginhostctrlps.def
embedding/browser/activex/src/pluginhostctrl/pluginhostctrlps.mk
embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jni.h
embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jni_md.h
embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jri.h
embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jri_md.h
embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/jritypes.h
embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/npapi.h
embedding/browser/activex/src/pluginhostctrl/pluginsdk_include/npupp.h
embedding/browser/activex/src/pluginhostctrl/resource.h
embedding/browser/activex/src/pluginhostctrl/tests/ns4x_reference_test3.htm
embedding/browser/activex/src/pluginhostctrl/tests/test1.htm
embedding/browser/activex/src/pluginhostctrl/tests/test10.htm
embedding/browser/activex/src/pluginhostctrl/tests/test11.htm
embedding/browser/activex/src/pluginhostctrl/tests/test2.htm
embedding/browser/activex/src/pluginhostctrl/tests/test3.htm
embedding/browser/activex/src/pluginhostctrl/tests/test4.htm
embedding/browser/activex/src/pluginhostctrl/tests/test5.htm
embedding/browser/activex/src/pluginhostctrl/tests/test6.htm
embedding/browser/activex/src/pluginhostctrl/tests/test7.htm
embedding/browser/activex/src/pluginhostctrl/tests/test8.htm
embedding/browser/activex/src/pluginhostctrl/tests/test9.htm
embedding/browser/activex/src/xml/ParseExpat.cpp
embedding/browser/activex/src/xml/StdAfx.cpp
embedding/browser/activex/src/xml/StdAfx.h
embedding/browser/activex/src/xml/XMLDocument.cpp
embedding/browser/activex/src/xml/XMLDocument.h
embedding/browser/activex/src/xml/XMLDocument.rgs
embedding/browser/activex/src/xml/XMLElement.cpp
embedding/browser/activex/src/xml/XMLElement.h
embedding/browser/activex/src/xml/XMLElement.rgs
embedding/browser/activex/src/xml/XMLElementCollection.cpp
embedding/browser/activex/src/xml/XMLElementCollection.h
embedding/browser/activex/src/xml/XMLElementCollection.rgs
embedding/browser/activex/src/xml/activexml.cpp
embedding/browser/activex/src/xml/activexml.def
embedding/browser/activex/src/xml/activexml.dsp
embedding/browser/activex/src/xml/activexml.idl
embedding/browser/activex/src/xml/activexml.rc
embedding/browser/activex/src/xml/activexmlps.def
embedding/browser/activex/src/xml/resource.h
embedding/browser/activex/tests/IEPatcher/DlgProxy.cpp
embedding/browser/activex/tests/IEPatcher/DlgProxy.h
embedding/browser/activex/tests/IEPatcher/IEPatcher.cpp
embedding/browser/activex/tests/IEPatcher/IEPatcher.dsp
embedding/browser/activex/tests/IEPatcher/IEPatcher.h
embedding/browser/activex/tests/IEPatcher/IEPatcher.odl
embedding/browser/activex/tests/IEPatcher/IEPatcher.rc
embedding/browser/activex/tests/IEPatcher/IEPatcher.reg
embedding/browser/activex/tests/IEPatcher/IEPatcherDlg.cpp
embedding/browser/activex/tests/IEPatcher/IEPatcherDlg.h
embedding/browser/activex/tests/IEPatcher/ScanForFilesDlg.cpp
embedding/browser/activex/tests/IEPatcher/ScanForFilesDlg.h
embedding/browser/activex/tests/IEPatcher/ScannerThread.cpp
embedding/browser/activex/tests/IEPatcher/ScannerThread.h
embedding/browser/activex/tests/IEPatcher/ScannerWnd.cpp
embedding/browser/activex/tests/IEPatcher/ScannerWnd.h
embedding/browser/activex/tests/IEPatcher/StdAfx.cpp
embedding/browser/activex/tests/IEPatcher/StdAfx.h
embedding/browser/activex/tests/IEPatcher/res/IEPatcher.ico
embedding/browser/activex/tests/IEPatcher/res/IEPatcher.rc2
embedding/browser/activex/tests/IEPatcher/res/containsie.ico
embedding/browser/activex/tests/IEPatcher/res/containsmozilla.ico
embedding/browser/activex/tests/IEPatcher/res/doesntcontainie.ico
embedding/browser/activex/tests/IEPatcher/res/unknownstatus.ico
embedding/browser/activex/tests/IEPatcher/resource.h
embedding/browser/activex/tests/RegMozCtl/MozillaBrowser.ico
embedding/browser/activex/tests/RegMozCtl/ReadMe.txt
embedding/browser/activex/tests/RegMozCtl/RegMozCtl.cpp
embedding/browser/activex/tests/RegMozCtl/RegMozCtl.dsp
embedding/browser/activex/tests/RegMozCtl/RegMozCtl.h
embedding/browser/activex/tests/RegMozCtl/RegMozCtl.rc
embedding/browser/activex/tests/RegMozCtl/RegMozCtlDlg.cpp
embedding/browser/activex/tests/RegMozCtl/RegMozCtlDlg.h
embedding/browser/activex/tests/RegMozCtl/RegTask.cpp
embedding/browser/activex/tests/RegMozCtl/RegTask.h
embedding/browser/activex/tests/RegMozCtl/RegTaskManager.cpp
embedding/browser/activex/tests/RegMozCtl/RegTaskManager.h
embedding/browser/activex/tests/RegMozCtl/StdAfx.cpp
embedding/browser/activex/tests/RegMozCtl/StdAfx.h
embedding/browser/activex/tests/RegMozCtl/res/RegMozCtl.ico
embedding/browser/activex/tests/RegMozCtl/res/RegMozCtl.rc2
embedding/browser/activex/tests/RegMozCtl/resource.h
embedding/browser/activex/tests/cbrowse/CBrowseDlg.cpp
embedding/browser/activex/tests/cbrowse/CBrowseDlg.h
embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.cpp
embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.h
embedding/browser/activex/tests/cbrowse/CBrowserCtlSite.rgs
embedding/browser/activex/tests/cbrowse/Cbrowse.idl
embedding/browser/activex/tests/cbrowse/Cbrowse.rgs
embedding/browser/activex/tests/cbrowse/ControlEventSink.cpp
embedding/browser/activex/tests/cbrowse/ControlEventSink.h
embedding/browser/activex/tests/cbrowse/ControlEventSink.rgs
embedding/browser/activex/tests/cbrowse/EditToolBar.cpp
embedding/browser/activex/tests/cbrowse/EditToolBar.h
embedding/browser/activex/tests/cbrowse/Html/main.htm
embedding/browser/activex/tests/cbrowse/PickerDlg.cpp
embedding/browser/activex/tests/cbrowse/PickerDlg.h
embedding/browser/activex/tests/cbrowse/Scripts/Basic.vbs
embedding/browser/activex/tests/cbrowse/Scripts/NewWindow.vbs
embedding/browser/activex/tests/cbrowse/Scripts/Post.vbs
embedding/browser/activex/tests/cbrowse/StdAfx.cpp
embedding/browser/activex/tests/cbrowse/StdAfx.h
embedding/browser/activex/tests/cbrowse/TabDOM.cpp
embedding/browser/activex/tests/cbrowse/TabDOM.h
embedding/browser/activex/tests/cbrowse/TabMessages.cpp
embedding/browser/activex/tests/cbrowse/TabMessages.h
embedding/browser/activex/tests/cbrowse/TabTests.cpp
embedding/browser/activex/tests/cbrowse/TabTests.h
embedding/browser/activex/tests/cbrowse/TestScriptHelper.cpp
embedding/browser/activex/tests/cbrowse/TestScriptHelper.h
embedding/browser/activex/tests/cbrowse/TestScriptHelper.rgs
embedding/browser/activex/tests/cbrowse/Tests.cpp
embedding/browser/activex/tests/cbrowse/Tests.h
embedding/browser/activex/tests/cbrowse/cbrowse.cpp
embedding/browser/activex/tests/cbrowse/cbrowse.dsp
embedding/browser/activex/tests/cbrowse/cbrowse.h
embedding/browser/activex/tests/cbrowse/cbrowse.rc
embedding/browser/activex/tests/cbrowse/cbrowse.sln
embedding/browser/activex/tests/cbrowse/res/cbrowse.ico
embedding/browser/activex/tests/cbrowse/res/cbrowse.rc2
embedding/browser/activex/tests/cbrowse/res/closedfolder.ico
embedding/browser/activex/tests/cbrowse/res/openfolder.ico
embedding/browser/activex/tests/cbrowse/res/test.ico
embedding/browser/activex/tests/cbrowse/res/testfailed.ico
embedding/browser/activex/tests/cbrowse/res/testpartial.ico
embedding/browser/activex/tests/cbrowse/res/testpassed.ico
embedding/browser/activex/tests/cbrowse/res/toolbar1.bmp
embedding/browser/activex/tests/cbrowse/resource.h
embedding/browser/activex/tests/csbrowse/App.ico
embedding/browser/activex/tests/csbrowse/AssemblyInfo.cs
embedding/browser/activex/tests/csbrowse/CSBrowse.csproj
embedding/browser/activex/tests/csbrowse/CSBrowse.sln
embedding/browser/activex/tests/csbrowse/Form1.cs
embedding/browser/activex/tests/csbrowse/Form1.resx
embedding/browser/activex/tests/csbrowse/back.bmp
embedding/browser/activex/tests/csbrowse/forward.bmp
embedding/browser/activex/tests/csbrowse/home.bmp
embedding/browser/activex/tests/csbrowse/reload.bmp
embedding/browser/activex/tests/csbrowse/stop.bmp
embedding/browser/activex/tests/dbrowse/form.dcu
embedding/browser/activex/tests/dbrowse/form.dfm
embedding/browser/activex/tests/dbrowse/form.pas
embedding/browser/activex/tests/dbrowse/webbrowser.dof
embedding/browser/activex/tests/dbrowse/webbrowser.dpr
embedding/browser/activex/tests/plugin/calendar.html
embedding/browser/activex/tests/plugin/calendar_scripted.htm
embedding/browser/activex/tests/vbrowse/VBrowse.vbp
embedding/browser/activex/tests/vbrowse/browser.frm
embedding/browser/activex/tests/vbrowse/browser.frx
embedding/browser/activex/tests/vbrowse/frmExplorer.frm
embedding/browser/activex/tests/vbrowse/frmToolBar.frm
embedding/browser/activex/tests/vbrowse/frmToolBar.frx
embedding/browser/activex/tests/vbxml/test.xml
embedding/browser/activex/tests/vbxml/xml.frm
embedding/browser/activex/tests/vbxml/xml.vbp
embedding/browser/activex/tests/vbxml/xml.vbw
extensions/spellcheck/osxspell/Makefile.in
extensions/spellcheck/osxspell/src/Makefile.in
extensions/spellcheck/osxspell/src/mozOSXSpell.h
extensions/spellcheck/osxspell/src/mozOSXSpell.mm
gfx/angle/angle-makefiles.patch
gfx/angle/src/libGLESv2/geometry/IndexDataManager.cpp
gfx/angle/src/libGLESv2/geometry/IndexDataManager.h
gfx/angle/src/libGLESv2/geometry/VertexDataManager.cpp
gfx/angle/src/libGLESv2/geometry/VertexDataManager.h
gfx/angle/src/libGLESv2/geometry/backend.cpp
gfx/angle/src/libGLESv2/geometry/backend.h
gfx/angle/src/libGLESv2/geometry/dx9.cpp
gfx/angle/src/libGLESv2/geometry/dx9.h
gfx/angle/src/libGLESv2/geometry/vertexconversion.h
gfx/cairo/cairo/src/cairo-ddraw.h
gfx/cairo/wince-fixes.patch
gfx/src/BaseMargin.h
gfx/src/BasePoint.h
gfx/src/BaseRect.h
gfx/src/BaseSize.h
intl/locale/public/nsIPosixLocale.h
intl/locale/src/unix/nsPosixLocale.h
js/src/Makefile.in
js/src/SpiderMonkey.rsp
js/src/bench.sh
js/src/config/autoconf.mk.in
js/src/configure.in
js/src/imacros.jsasm
js/src/jit-test/jit_test.py
js/src/jit-test/tests/basic/bug660538.js
js/src/jit-test/tests/basic/testCompileScript.js
js/src/jit-test/tests/jaeger/bug563000/eif-call-newvar.js
js/src/jit-test/tests/jaeger/bug563000/eif-getter-newvar.js
js/src/jit-test/tests/jaeger/bug563000/eif-trap-newvar.js
js/src/js.mdp
js/src/jsanalyze.cpp
js/src/jsapi-tests/Makefile.in
js/src/jsapi-tests/testConservativeGC.cpp
js/src/jsapi-tests/testFuncCallback.cpp
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsarena.h
js/src/jsarray.cpp
js/src/jsarray.h
js/src/jsatom.cpp
js/src/jsbuiltins.cpp
js/src/jsbuiltins.h
js/src/jsclone.cpp
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jscntxtinlines.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsdate.cpp
js/src/jsdbgapi.cpp
js/src/jsemit.cpp
js/src/jsemit.h
js/src/jsexn.cpp
js/src/jsfun.cpp
js/src/jsfun.h
js/src/jsgc.cpp
js/src/jsgc.h
js/src/jsgcinlines.h
js/src/jsgcmark.cpp
js/src/jshashtable.h
js/src/jsify.pl
js/src/jsinfer.cpp
js/src/jsinfer.h
js/src/jsinterp.cpp
js/src/jsinterp.h
js/src/jsinterpinlines.h
js/src/jsiter.cpp
js/src/jslong.h
js/src/jsmath.cpp
js/src/jsnum.cpp
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/json.cpp
js/src/jsopcode.cpp
js/src/jsopcode.h
js/src/jsopcode.tbl
js/src/jsparse.cpp
js/src/jsparse.h
js/src/jsprf.cpp
js/src/jsproxy.cpp
js/src/jsreflect.cpp
js/src/jsregexp.cpp
js/src/jsregexpinlines.h
js/src/jsscope.cpp
js/src/jsscope.h
js/src/jsscopeinlines.h
js/src/jsscript.cpp
js/src/jsscript.h
js/src/jsstr.cpp
js/src/jsstrinlines.h
js/src/jstracer.cpp
js/src/jstracer.h
js/src/jstypedarray.cpp
js/src/jstypedarray.h
js/src/jstypedarrayinlines.h
js/src/jsval.h
js/src/jsweakmap.cpp
js/src/jswrapper.cpp
js/src/jswrapper.h
js/src/jsxdrapi.h
js/src/jsxml.cpp
js/src/methodjit/Compiler.cpp
js/src/methodjit/Compiler.h
js/src/methodjit/FastBuiltins.cpp
js/src/methodjit/InvokeHelpers.cpp
js/src/methodjit/MethodJIT-inl.h
js/src/methodjit/MethodJIT.cpp
js/src/methodjit/MethodJIT.h
js/src/methodjit/MonoIC.cpp
js/src/methodjit/PolyIC.cpp
js/src/methodjit/PolyIC.h
js/src/methodjit/Retcon.cpp
js/src/methodjit/StubCalls.cpp
js/src/methodjit/StubCalls.h
js/src/methodjit/TypedArrayIC.h
js/src/perfect.js
js/src/plify_jsdhash.sed
js/src/shell/js.cpp
js/src/tests/ecma_5/strict/function-name-arity.js
js/src/tests/js1_5/Regress/regress-281487.js
js/src/tests/js1_5/Regress/regress-286216.js
js/src/tests/js1_5/extensions/regress-376052.js
js/src/tests/js1_8_5/regress/jstests.list
js/src/time.sh
js/src/tracejit/Writer-inl.h
js/src/tracejit/Writer.cpp
js/src/tracejit/Writer.h
js/src/vm/GlobalObject.cpp
js/src/vm/Stack-inl.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/xpconnect/idl/XPCIDispatch.idl
js/src/xpconnect/idl/nsIActiveXSecurityPolicy.idl
js/src/xpconnect/idl/nsIDispatchSupport.idl
js/src/xpconnect/shell/xpcshell.cpp
js/src/xpconnect/src/XPCDispConvert.cpp
js/src/xpconnect/src/XPCDispInlines.h
js/src/xpconnect/src/XPCDispInterface.cpp
js/src/xpconnect/src/XPCDispObject.cpp
js/src/xpconnect/src/XPCDispParams.cpp
js/src/xpconnect/src/XPCDispPrivate.h
js/src/xpconnect/src/XPCDispTearOff.cpp
js/src/xpconnect/src/XPCDispTypeInfo.cpp
js/src/xpconnect/src/XPCIDispatchClassInfo.cpp
js/src/xpconnect/src/XPCIDispatchExtension.cpp
js/src/xpconnect/src/nsDispatchSupport.cpp
js/src/xpconnect/src/nsXPConnect.cpp
js/src/xpconnect/src/xpcinlines.h
js/src/xpconnect/src/xpcjsruntime.cpp
js/src/xpconnect/src/xpcprivate.h
js/src/xpconnect/src/xpcwrappednative.cpp
js/src/xpconnect/tests/idispatch/COM/StdAfx.cpp
js/src/xpconnect/tests/idispatch/COM/StdAfx.h
js/src/xpconnect/tests/idispatch/COM/XPCDispUtilities.h
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.cpp
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.def
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.dsp
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.dsw
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.idl
js/src/xpconnect/tests/idispatch/COM/XPCIDispatchTest.rc
js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispSimple.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestArrays.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestMethods.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestNoIDispatch.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestProperties.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOff.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestScriptOn.rgs
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.cpp
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.h
js/src/xpconnect/tests/idispatch/COM/nsXPCDispTestWrappedJS.rgs
js/src/xpconnect/tests/idispatch/COM/resource.h
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Arrays/XPCIDispatchArrayTests.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Attributes/XPCIDispatchAttributeTests.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/General/XPCIDispatchInstantiations.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/General/XPCStress.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/Methods/XPCIDispatchMethodTests.js
js/src/xpconnect/tests/idispatch/Tests/WrappedCOM/shell.js
js/src/xpconnect/tests/idispatch/Tests/WrappedJS/General/XPCIDispatchTestWrappedJS.js
js/src/xpconnect/tests/idispatch/Tests/WrappedJS/shell.js
js/src/xpconnect/tests/idispatch/Tests/exectests.cmd
js/src/xpconnect/tests/idispatch/Tests/jsDriver.pl
layout/base/crashtests/331883-2-inner.html
layout/base/crashtests/331883-2.html
layout/base/tests/bug106855-1-ref.html
layout/base/tests/bug106855-1.html
layout/base/tests/bug106855-2.html
layout/base/tests/bug240933-1-ref.html
layout/base/tests/bug240933-1.html
layout/base/tests/bug240933-2.html
layout/base/tests/bug389321-1-ref.html
layout/base/tests/bug389321-1.html
layout/base/tests/bug389321-2-ref.html
layout/base/tests/bug389321-2.html
layout/base/tests/bug389321-3-ref.html
layout/base/tests/bug389321-3.html
layout/base/tests/bug482484-ref.html
layout/base/tests/bug482484.html
layout/base/tests/bug495648.rdf
layout/base/tests/bug512295-1-ref.html
layout/base/tests/bug512295-1.html
layout/base/tests/bug512295-2-ref.html
layout/base/tests/bug512295-2.html
layout/base/tests/bug585922-ref.html
layout/base/tests/bug585922.html
layout/base/tests/bug597519-1-ref.html
layout/base/tests/bug597519-1.html
layout/base/tests/bug602141-1-ref.html
layout/base/tests/bug602141-1.html
layout/base/tests/bug602141-2-ref.html
layout/base/tests/bug602141-2.html
layout/base/tests/bug602141-3-ref.html
layout/base/tests/bug602141-3.html
layout/base/tests/bug602141-4-ref.html
layout/base/tests/bug602141-4.html
layout/base/tests/bug612271-1.html
layout/base/tests/bug612271-2.html
layout/base/tests/bug612271-3.html
layout/base/tests/bug612271-ref.html
layout/base/tests/bug613433-1.html
layout/base/tests/bug613433-2.html
layout/base/tests/bug613433-3.html
layout/base/tests/bug613433-ref.html
layout/base/tests/bug613807-1-ref.html
layout/base/tests/bug613807-1.html
layout/base/tests/bug632215-1.html
layout/base/tests/bug632215-2.html
layout/base/tests/bug632215-ref.html
layout/base/tests/bug633044-1-ref.html
layout/base/tests/bug633044-1.html
layout/base/tests/bug634406-1-ref.html
layout/base/tests/bug634406-1.html
layout/base/tests/bug644428-1-ref.html
layout/base/tests/bug644428-1.html
layout/base/tests/bug646382-1-ref.html
layout/base/tests/bug646382-1.html
layout/base/tests/bug646382-2-ref.html
layout/base/tests/bug646382-2.html
layout/base/tests/test_bug495648.xul
layout/base/tests/test_reftests_with_caret.html
layout/generic/nsBidiFrames.cpp
layout/generic/nsBidiFrames.h
layout/reftests/bugs/624359-1-notref.html
layout/reftests/bugs/624359-1.html
mobile/chrome/content/firstrun/facebook.png
mobile/chrome/content/firstrun/features.png
mobile/chrome/content/firstrun/firstrun.xhtml
mobile/chrome/content/firstrun/mozilla.png
mobile/chrome/content/firstrun/nav-arrow.png
mobile/chrome/content/firstrun/twitter.png
mobile/locales/en-US/chrome/firstrun.dtd
mobile/themes/core/firstRun.css
modules/libpref/src/init/all.js
modules/libreg/standalone/Makefile.in
modules/staticmod/Makefile.in
modules/staticmod/nsMetaModule.cpp
startupcache/nsStartupCacheUtils.cpp
testing/mochitest/pywebsocket/mod_pywebsocket/standalone.py
toolkit/content/tests/widgets/frame_popupremoving_frame.xul
toolkit/content/tests/widgets/popup_childframe_node.xul
toolkit/content/tests/widgets/popup_trigger.js
toolkit/content/tests/widgets/test_bug359754.xul
toolkit/content/tests/widgets/test_bug360220.xul
toolkit/content/tests/widgets/test_bug365773.xul
toolkit/content/tests/widgets/test_bug382990.xul
toolkit/content/tests/widgets/test_bug457632.xul
toolkit/content/tests/widgets/test_bug460942.xul
toolkit/content/tests/widgets/test_bug509732.xul
toolkit/content/tests/widgets/test_bug554279.xul
toolkit/content/tests/widgets/test_bug557987.xul
toolkit/content/tests/widgets/test_bug562554.xul
toolkit/content/tests/widgets/test_button.xul
toolkit/content/tests/widgets/test_closemenu_attribute.xul
toolkit/content/tests/widgets/test_colorpicker_popup.xul
toolkit/content/tests/widgets/test_contextmenu_list.xul
toolkit/content/tests/widgets/test_focus_anons.xul
toolkit/content/tests/widgets/test_hiddenitems.xul
toolkit/content/tests/widgets/test_hiddenpaging.xul
toolkit/content/tests/widgets/test_menu.xul
toolkit/content/tests/widgets/test_menu_hide.xul
toolkit/content/tests/widgets/test_menuitem_blink.xul
toolkit/content/tests/widgets/test_menulist.xul
toolkit/content/tests/widgets/test_menulist_keynav.xul
toolkit/content/tests/widgets/test_notificationbox.xul
toolkit/content/tests/widgets/test_panelfrommenu.xul
toolkit/content/tests/widgets/test_popup_attribute.xul
toolkit/content/tests/widgets/test_popup_button.xul
toolkit/content/tests/widgets/test_popup_coords.xul
toolkit/content/tests/widgets/test_popup_keys.xul
toolkit/content/tests/widgets/test_popup_preventdefault.xul
toolkit/content/tests/widgets/test_popup_recreate.xul
toolkit/content/tests/widgets/test_popup_scaled.xul
toolkit/content/tests/widgets/test_popup_tree.xul
toolkit/content/tests/widgets/test_popuphidden.xul
toolkit/content/tests/widgets/test_popupincontent.xul
toolkit/content/tests/widgets/test_popupremoving.xul
toolkit/content/tests/widgets/test_popupremoving_frame.xul
toolkit/content/tests/widgets/test_position.xul
toolkit/content/tests/widgets/test_progressmeter.xul
toolkit/content/tests/widgets/test_props.xul
toolkit/content/tests/widgets/test_radio.xul
toolkit/content/tests/widgets/test_richlist_direction.xul
toolkit/content/tests/widgets/test_scale.xul
toolkit/content/tests/widgets/test_scrollbar.xul
toolkit/content/tests/widgets/test_sorttemplate.xul
toolkit/content/tests/widgets/test_statusbar.xul
toolkit/content/tests/widgets/test_tabbox.xul
toolkit/content/tests/widgets/test_tabindex.xul
toolkit/content/tests/widgets/test_textbox_emptytext.xul
toolkit/content/tests/widgets/test_textbox_number.xul
toolkit/content/tests/widgets/test_textbox_search.xul
toolkit/content/tests/widgets/test_timepicker.xul
toolkit/content/tests/widgets/test_toolbar.xul
toolkit/content/tests/widgets/test_tooltip.xul
toolkit/content/tests/widgets/test_tooltip_noautohide.xul
toolkit/content/tests/widgets/test_tree.xul
toolkit/content/tests/widgets/test_tree_single.xul
toolkit/content/tests/widgets/test_tree_view.xul
toolkit/content/tests/widgets/window_popup_attribute.xul
toolkit/content/tests/widgets/window_popup_button.xul
toolkit/content/tests/widgets/xul_selectcontrol.js
toolkit/crashreporter/test/browser/aboutcrashes_utils.js
toolkit/themes/pinstripe/mozapps/extensions/background-texture.png
toolkit/themes/winstripe/mozapps/extensions/background-texture.png
tools/cross-commit
xpcom/base/Telemetry.cpp
xpcom/base/nsITelemetry.idl
xpcom/base/nsSetDllDirectory.cpp
xpcom/io/nsFastLoadFile.cpp
xpcom/io/nsFastLoadFile.h
xpcom/io/nsFastLoadService.cpp
xpcom/io/nsFastLoadService.h
xpcom/io/nsIFastLoadFileControl.idl
xpcom/io/nsIFastLoadService.idl
xpcom/system/nsIAccelerometer.idl
xpcom/tests/unit/test_nsITelemetry.js
xulrunner/app/document.png
--- a/accessible/build/Makefile.in
+++ b/accessible/build/Makefile.in
@@ -66,34 +66,10 @@ SHARED_LIBRARY_LIBS = \
 ifdef MOZ_XUL
 SHARED_LIBRARY_LIBS += ../src/xul/$(LIB_PREFIX)accessibility_xul_s.$(LIB_SUFFIX)
 endif
 
 ifndef DISABLE_XFORMS_HOOKS
 SHARED_LIBRARY_LIBS += ../src/xforms/$(LIB_PREFIX)accessibility_xforms_s.$(LIB_SUFFIX)
 endif
 
-EXTRA_DSO_LIBS = \
-	gkgfx \
-	thebes \
-	$(NULL)
-
-EXTRA_DSO_LDOPTS =           \
-	$(LIBS_DIR)              \
-	$(EXTRA_DSO_LIBS)        \
-	$(MOZ_UNICHARUTIL_LIBS)  \
-	$(MOZ_COMPONENT_LIBS)    \
-	$(NULL)
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
-EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS)
-endif
-
-ifeq ($(OS_ARCH),WINNT)
-OS_LIBS += \
-	oleaut32.lib \
-	version.lib \
-	ole32.lib \
-	$(NULL)
-endif
-
 include $(topsrcdir)/config/rules.mk
 
--- a/accessible/src/atk/AtkSocketAccessible.cpp
+++ b/accessible/src/atk/AtkSocketAccessible.cpp
@@ -1,11 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/AtkSocketAccessible.h
+++ b/accessible/src/atk/AtkSocketAccessible.h
@@ -1,11 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/Makefile.in
+++ b/accessible/src/atk/Makefile.in
@@ -83,18 +83,16 @@ EXPORTS = \
   nsHTMLImageAccessibleWrap.h \
   nsHTMLTableAccessibleWrap.h \
   nsAccessibleRelationWrap.h \
   $(NULL)
 
 # we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
-EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS)
-
 include $(topsrcdir)/config/rules.mk
 
 CFLAGS		+= $(MOZ_GTK2_CFLAGS)
 CXXFLAGS	+= $(MOZ_GTK2_CFLAGS)
 
 LOCAL_INCLUDES += \
   -I$(srcdir) \
   -I$(srcdir)/../base \
--- a/accessible/src/atk/nsARIAGridAccessibleWrap.h
+++ b/accessible/src/atk/nsARIAGridAccessibleWrap.h
@@ -1,11 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsAccessNodeWrap.cpp
+++ b/accessible/src/atk/nsAccessNodeWrap.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsAccessNodeWrap.h
+++ b/accessible/src/atk/nsAccessNodeWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsAccessibleRelationWrap.h
+++ b/accessible/src/atk/nsAccessibleRelationWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsAccessibleWrap.cpp
+++ b/accessible/src/atk/nsAccessibleWrap.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -445,20 +445,19 @@ nsAccessibleWrap::CreateMaiInterfaces(vo
     //nsIAccessibleImage
     nsCOMPtr<nsIAccessibleImage> accessInterfaceImage;
     QueryInterface(NS_GET_IID(nsIAccessibleImage),
                               getter_AddRefs(accessInterfaceImage));
     if (accessInterfaceImage) {
         interfacesBits |= 1 << MAI_INTERFACE_IMAGE;
     }
 
-    // HyperLinkAccessible
-    if (IsHyperLink()) {
-       interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
-    }
+  // HyperLinkAccessible
+  if (IsLink())
+    interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
 
     if (!nsAccUtils::MustPrune(this)) {  // These interfaces require children
       //nsIAccessibleHypertext
       if (IsHyperText()) {
           interfacesBits |= 1 << MAI_INTERFACE_HYPERTEXT;
       }
 
       //nsIAccessibleTable
@@ -1072,16 +1071,26 @@ nsAccessibleWrap::FirePlatformEvent(AccE
             atk_focus_tracker_notify(atkObj);
             // Fire state change event for focus
             nsRefPtr<AccEvent> stateChangeEvent =
               new AccStateChangeEvent(accessible, states::FOCUSED, PR_TRUE);
             return FireAtkStateChangeEvent(stateChangeEvent, atkObj);
         }
       } break;
 
+    case nsIAccessibleEvent::EVENT_NAME_CHANGE:
+      {
+        nsString newName;
+        accessible->GetName(newName);
+        NS_ConvertUTF16toUTF8 utf8Name(newName);
+        if (!utf8Name.Equals(atkObj->name))
+          atk_object_set_name(atkObj, utf8Name.get());
+
+        break;
+      }
     case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
       {
         MAI_LOG_DEBUG(("\n\nReceived: EVENT_VALUE_CHANGE\n"));
         nsCOMPtr<nsIAccessibleValue> value(do_QueryObject(accessible));
         if (value) {    // Make sure this is a numeric value
             // Don't fire for MSAA string value changes (e.g. text editing)
             // ATK values are always numeric
             g_object_notify( (GObject*)atkObj, "accessible-value" );
--- a/accessible/src/atk/nsAccessibleWrap.h
+++ b/accessible/src/atk/nsAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsApplicationAccessibleWrap.cpp
+++ b/accessible/src/atk/nsApplicationAccessibleWrap.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -700,17 +700,17 @@ nsApplicationAccessibleWrap::AppendChild
     }
 
     return PR_TRUE;
 }
 
 PRBool
 nsApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild)
 {
-    PRInt32 index = aChild->GetIndexInParent();
+    PRInt32 index = aChild->IndexInParent();
 
     AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild);
     atk_object_set_parent(atkAccessible, NULL);
     g_signal_emit_by_name(mAtkObject, "children_changed::remove", index,
                           atkAccessible, NULL);
 
     return nsApplicationAccessible::RemoveChild(aChild);
 }
--- a/accessible/src/atk/nsApplicationAccessibleWrap.h
+++ b/accessible/src/atk/nsApplicationAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsDocAccessibleWrap.cpp
+++ b/accessible/src/atk/nsDocAccessibleWrap.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsDocAccessibleWrap.h
+++ b/accessible/src/atk/nsDocAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsHTMLImageAccessibleWrap.h
+++ b/accessible/src/atk/nsHTMLImageAccessibleWrap.h
@@ -1,11 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsHTMLTableAccessibleWrap.h
+++ b/accessible/src/atk/nsHTMLTableAccessibleWrap.h
@@ -1,11 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsHyperTextAccessibleWrap.h
+++ b/accessible/src/atk/nsHyperTextAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMai.h
+++ b/accessible/src/atk/nsMai.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiHyperlink.cpp
+++ b/accessible/src/atk/nsMaiHyperlink.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -130,26 +130,26 @@ MaiHyperlink::MaiHyperlink(nsAccessible*
 MaiHyperlink::~MaiHyperlink()
 {
     if (mMaiAtkHyperlink) {
         MAI_ATK_HYPERLINK(mMaiAtkHyperlink)->maiHyperlink = nsnull;
         g_object_unref(mMaiAtkHyperlink);
     }
 }
 
-AtkHyperlink *
+AtkHyperlink*
 MaiHyperlink::GetAtkHyperlink(void)
 {
-    NS_ENSURE_TRUE(mHyperlink, nsnull);
+  NS_ENSURE_TRUE(mHyperlink, nsnull);
 
-    if (mMaiAtkHyperlink)
-        return mMaiAtkHyperlink;
+  if (mMaiAtkHyperlink)
+    return mMaiAtkHyperlink;
 
-    if (!mHyperlink->IsHyperLink())
-        return nsnull;
+  if (!mHyperlink->IsLink())
+    return nsnull;
 
     mMaiAtkHyperlink =
         reinterpret_cast<AtkHyperlink *>
                         (g_object_new(mai_atk_hyperlink_get_type(), NULL));
     NS_ASSERTION(mMaiAtkHyperlink, "OUT OF MEMORY");
     NS_ENSURE_TRUE(mMaiAtkHyperlink, nsnull);
 
     /* be sure to initialize it with "this" */
@@ -210,36 +210,34 @@ finalizeCB(GObject *aObj)
 }
 
 gchar *
 getUriCB(AtkHyperlink *aLink, gint aLinkIndex)
 {
     nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
     NS_ENSURE_TRUE(hyperlink, nsnull);
 
-    MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aLink);
-
-    nsCOMPtr<nsIURI> uri = hyperlink->GetAnchorURI(aLinkIndex);
+    nsCOMPtr<nsIURI> uri = hyperlink->AnchorURIAt(aLinkIndex);
     if (!uri)
         return nsnull;
 
     nsCAutoString cautoStr;
     nsresult rv = uri->GetSpec(cautoStr);
     NS_ENSURE_SUCCESS(rv, nsnull);
 
     return g_strdup(cautoStr.get());
 }
 
 AtkObject *
 getObjectCB(AtkHyperlink *aLink, gint aLinkIndex)
 {
     nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
     NS_ENSURE_TRUE(hyperlink, nsnull);
 
-    nsAccessible* anchor = hyperlink->GetAnchor(aLinkIndex);
+    nsAccessible* anchor = hyperlink->AnchorAt(aLinkIndex);
     NS_ENSURE_TRUE(anchor, nsnull);
 
     AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(anchor);
     //no need to add ref it, because it is "get" not "ref"
     return atkObj;
 }
 
 gint
@@ -261,17 +259,17 @@ getStartIndexCB(AtkHyperlink *aLink)
 }
 
 gboolean
 isValidCB(AtkHyperlink *aLink)
 {
     nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
     NS_ENSURE_TRUE(hyperlink, FALSE);
 
-    return static_cast<gboolean>(hyperlink->IsValid());
+    return static_cast<gboolean>(hyperlink->IsLinkValid());
 }
 
 gint
 getAnchorCountCB(AtkHyperlink *aLink)
 {
     nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
     NS_ENSURE_TRUE(hyperlink, -1);
 
--- a/accessible/src/atk/nsMaiHyperlink.h
+++ b/accessible/src/atk/nsMaiHyperlink.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -53,19 +53,18 @@ typedef struct _AtkHyperlink            
 class MaiHyperlink
 {
 public:
     MaiHyperlink(nsAccessible* aHyperLink);
     ~MaiHyperlink();
 
 public:
     AtkHyperlink *GetAtkHyperlink(void);
-    nsAccessible* GetAccHyperlink(void) {
-        return mHyperlink && mHyperlink->IsHyperLink() ? mHyperlink : nsnull;
-    }
+  nsAccessible* GetAccHyperlink()
+  { return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nsnull; }
 
 protected:
     nsAccessible* mHyperlink;
     AtkHyperlink *mMaiAtkHyperlink;
 public:
     static nsresult Initialize(AtkHyperlink *aObj, MaiHyperlink *aClass);
 };
 #endif /* __MAI_HYPERLINK_H__ */
--- a/accessible/src/atk/nsMaiInterfaceAction.cpp
+++ b/accessible/src/atk/nsMaiInterfaceAction.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceAction.h
+++ b/accessible/src/atk/nsMaiInterfaceAction.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceComponent.cpp
+++ b/accessible/src/atk/nsMaiInterfaceComponent.cpp
@@ -1,11 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -94,26 +93,26 @@ grabFocusCB(AtkComponent* aComponent)
 
 AtkObject*
 refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap, gint aX, gint aY,
                            AtkCoordType aCoordType)
 {
   if (!aAccWrap || aAccWrap->IsDefunct() || nsAccUtils::MustPrune(aAccWrap))
     return nsnull;
 
-  // nsAccessible::GetChildAtPoint(x,y) is in screen pixels.
+  // nsAccessible::ChildAtPoint(x,y) is in screen pixels.
   if (aCoordType == ATK_XY_WINDOW) {
     nsIntPoint winCoords =
       nsCoreUtils::GetScreenCoordsForWindow(aAccWrap->GetNode());
     aX += winCoords.x;
     aY += winCoords.y;
   }
 
-  nsAccessible* accAtPoint = aAccWrap->GetChildAtPoint(aX, aY,
-                                                       nsAccessible::eDirectChild);
+  nsAccessible* accAtPoint = aAccWrap->ChildAtPoint(aX, aY,
+                                                    nsAccessible::eDirectChild);
   if (!accAtPoint)
     return nsnull;
 
   AtkObject* atkObj = nsAccessibleWrap::GetAtkObject(accAtPoint);
   if (atkObj)
     g_object_ref(atkObj);
   return atkObj;
 }
--- a/accessible/src/atk/nsMaiInterfaceComponent.h
+++ b/accessible/src/atk/nsMaiInterfaceComponent.h
@@ -1,11 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceDocument.cpp
+++ b/accessible/src/atk/nsMaiInterfaceDocument.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceDocument.h
+++ b/accessible/src/atk/nsMaiInterfaceDocument.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceEditableText.cpp
+++ b/accessible/src/atk/nsMaiInterfaceEditableText.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceEditableText.h
+++ b/accessible/src/atk/nsMaiInterfaceEditableText.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
+++ b/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -44,21 +44,20 @@ void
 hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface)
 {
     g_return_if_fail(aIface != NULL);
 
     aIface->get_hyperlink = getHyperlinkCB;
 }
 
 AtkHyperlink*
-getHyperlinkCB(AtkHyperlinkImpl *aImpl)
+getHyperlinkCB(AtkHyperlinkImpl* aImpl)
 {
-    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
-    if (!accWrap)
-        return nsnull;
+  nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
+  if (!accWrap)
+    return nsnull;
 
-    NS_ENSURE_TRUE(accWrap->IsHyperLink(), nsnull);
+  NS_ENSURE_TRUE(accWrap->IsLink(), nsnull);
 
-    MaiHyperlink *maiHyperlink = accWrap->GetMaiHyperlink();
-    NS_ENSURE_TRUE(maiHyperlink, nsnull);
-    return maiHyperlink->GetAtkHyperlink();
-
+  MaiHyperlink* maiHyperlink = accWrap->GetMaiHyperlink();
+  NS_ENSURE_TRUE(maiHyperlink, nsnull);
+  return maiHyperlink->GetAtkHyperlink();
 }
--- a/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.h
+++ b/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceHypertext.cpp
+++ b/accessible/src/atk/nsMaiInterfaceHypertext.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceHypertext.h
+++ b/accessible/src/atk/nsMaiInterfaceHypertext.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceImage.cpp
+++ b/accessible/src/atk/nsMaiInterfaceImage.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceImage.h
+++ b/accessible/src/atk/nsMaiInterfaceImage.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceSelection.cpp
+++ b/accessible/src/atk/nsMaiInterfaceSelection.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceSelection.h
+++ b/accessible/src/atk/nsMaiInterfaceSelection.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceTable.cpp
+++ b/accessible/src/atk/nsMaiInterfaceTable.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceTable.h
+++ b/accessible/src/atk/nsMaiInterfaceTable.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceText.cpp
+++ b/accessible/src/atk/nsMaiInterfaceText.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceText.h
+++ b/accessible/src/atk/nsMaiInterfaceText.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceValue.cpp
+++ b/accessible/src/atk/nsMaiInterfaceValue.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsMaiInterfaceValue.h
+++ b/accessible/src/atk/nsMaiInterfaceValue.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsRoleMap.h
+++ b/accessible/src/atk/nsRoleMap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsRootAccessibleWrap.cpp
+++ b/accessible/src/atk/nsRootAccessibleWrap.cpp
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsRootAccessibleWrap.h
+++ b/accessible/src/atk/nsRootAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsStateMap.h
+++ b/accessible/src/atk/nsStateMap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsTextAccessibleWrap.h
+++ b/accessible/src/atk/nsTextAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsXULListboxAccessibleWrap.h
+++ b/accessible/src/atk/nsXULListboxAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsXULMenuAccessibleWrap.h
+++ b/accessible/src/atk/nsXULMenuAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/atk/nsXULTreeGridAccessibleWrap.h
+++ b/accessible/src/atk/nsXULTreeGridAccessibleWrap.h
@@ -1,10 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2: */
+/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
--- a/accessible/src/base/AccEvent.cpp
+++ b/accessible/src/base/AccEvent.cpp
@@ -308,18 +308,18 @@ AccMutationEvent::
 // AccHideEvent
 ////////////////////////////////////////////////////////////////////////////////
 
 AccHideEvent::
   AccHideEvent(nsAccessible* aTarget, nsINode* aTargetNode) :
   AccMutationEvent(::nsIAccessibleEvent::EVENT_HIDE, aTarget, aTargetNode)
 {
   mParent = mAccessible->GetParent();
-  mNextSibling = mAccessible->GetCachedNextSibling();
-  mPrevSibling = mAccessible->GetCachedPrevSibling();
+  mNextSibling = mAccessible->NextSibling();
+  mPrevSibling = mAccessible->PrevSibling();
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccShowEvent
 ////////////////////////////////////////////////////////////////////////////////
 
 AccShowEvent::
--- a/accessible/src/base/AccGroupInfo.cpp
+++ b/accessible/src/base/AccGroupInfo.cpp
@@ -42,17 +42,17 @@
 AccGroupInfo::AccGroupInfo(nsAccessible* aItem, PRUint32 aRole) :
   mPosInSet(0), mSetSize(0), mParent(nsnull)
 {
   MOZ_COUNT_CTOR(AccGroupInfo);
   nsAccessible* parent = aItem->GetParent();
   if (!parent)
     return;
 
-  PRInt32 indexInParent = aItem->GetIndexInParent();
+  PRInt32 indexInParent = aItem->IndexInParent();
   PRInt32 level = nsAccUtils::GetARIAOrDefaultLevel(aItem);
 
   // Compute position in set.
   mPosInSet = 1;
   for (PRInt32 idx = indexInParent - 1; idx >=0 ; idx--) {
     nsAccessible* sibling = parent->GetChildAt(idx);
     PRUint32 siblingRole = sibling->Role();
 
@@ -147,27 +147,27 @@ AccGroupInfo::AccGroupInfo(nsAccessible*
   // parent. Or, if the parent is something other than a tree we will
   // return that.
 
   if (parentRole != nsIAccessibleRole::ROLE_GROUPING) {
     mParent = parent;
     return;
   }
 
-  nsAccessible* parentPrevSibling = parent->GetSiblingAtOffset(-1);
+  nsAccessible* parentPrevSibling = parent->PrevSibling();
   if (!parentPrevSibling)
     return;
 
   PRUint32 parentPrevSiblingRole = parentPrevSibling->Role();
   if (parentPrevSiblingRole == nsIAccessibleRole::ROLE_TEXT_LEAF) {
     // XXX Sometimes an empty text accessible is in the hierarchy here,
     // although the text does not appear to be rendered, GetRenderedText()
     // says that it is so we need to skip past it to find the true
     // previous sibling.
-    parentPrevSibling = parentPrevSibling->GetSiblingAtOffset(-1);
+    parentPrevSibling = parentPrevSibling->PrevSibling();
     if (parentPrevSibling)
       parentPrevSiblingRole = parentPrevSibling->Role();
   }
 
   // Previous sibling of parent group is a tree item, this is the
   // conceptual tree item parent.
   if (parentPrevSiblingRole == nsIAccessibleRole::ROLE_OUTLINEITEM)
     mParent = parentPrevSibling;
--- a/accessible/src/base/Makefile.in
+++ b/accessible/src/base/Makefile.in
@@ -82,16 +82,17 @@ CPPSRCS = \
 
 EXPORTS = \
   a11yGeneric.h \
   nsAccDocManager.h \
   nsAccessibilityService.h \
   nsAccessible.h \
   nsAccessNode.h \
   nsARIAMap.h \
+	States.h \
   $(NULL)
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
--- a/accessible/src/base/NotificationController.cpp
+++ b/accessible/src/base/NotificationController.cpp
@@ -510,24 +510,24 @@ NotificationController::CoalesceTextChan
 void
 NotificationController::CoalesceTextChangeEventsFor(AccShowEvent* aTailEvent,
                                                     AccShowEvent* aThisEvent)
 {
   AccTextChangeEvent* textEvent = aThisEvent->mTextChangeEvent;
   if (!textEvent)
     return;
 
-  if (aTailEvent->mAccessible->GetIndexInParent() ==
-      aThisEvent->mAccessible->GetIndexInParent() + 1) {
+  if (aTailEvent->mAccessible->IndexInParent() ==
+      aThisEvent->mAccessible->IndexInParent() + 1) {
     // If tail target was inserted after this target, i.e. tail target is next
     // sibling of this target.
     aTailEvent->mAccessible->AppendTextTo(textEvent->mModifiedText);
 
-  } else if (aTailEvent->mAccessible->GetIndexInParent() ==
-             aThisEvent->mAccessible->GetIndexInParent() -1) {
+  } else if (aTailEvent->mAccessible->IndexInParent() ==
+             aThisEvent->mAccessible->IndexInParent() -1) {
     // If tail target was inserted before this target, i.e. tail target is
     // previous sibling of this target.
     nsAutoString startText;
     aTailEvent->mAccessible->AppendTextTo(startText);
     textEvent->mModifiedText = startText + textEvent->mModifiedText;
     textEvent->mStart -= startText.Length();
   }
 
--- a/accessible/src/base/nsARIAGridAccessible.cpp
+++ b/accessible/src/base/nsARIAGridAccessible.cpp
@@ -976,17 +976,17 @@ nsARIAGridCellAccessible::GetColumnIndex
     return NS_ERROR_FAILURE;
 
   nsAccessible* row = GetParent();
   if (!row)
     return NS_OK;
 
   *aColumnIndex = 0;
 
-  PRInt32 indexInRow = GetIndexInParent();
+  PRInt32 indexInRow = IndexInParent();
   for (PRInt32 idx = 0; idx < indexInRow; idx++) {
     nsAccessible* cell = row->GetChildAt(idx);
     PRUint32 role = cell->Role();
     if (role == nsIAccessibleRole::ROLE_GRID_CELL ||
         role == nsIAccessibleRole::ROLE_ROWHEADER ||
         role == nsIAccessibleRole::ROLE_COLUMNHEADER)
       (*aColumnIndex)++;
   }
@@ -1008,17 +1008,17 @@ nsARIAGridCellAccessible::GetRowIndex(PR
     return NS_OK;
 
   nsAccessible* table = row->GetParent();
   if (!table)
     return NS_OK;
 
   *aRowIndex = 0;
 
-  PRInt32 indexInTable = row->GetIndexInParent();
+  PRInt32 indexInTable = row->IndexInParent();
   for (PRInt32 idx = 0; idx < indexInTable; idx++) {
     row = table->GetChildAt(idx);
     if (row->Role() == nsIAccessibleRole::ROLE_ROW)
       (*aRowIndex)++;
   }
 
   return NS_OK;
 }
--- a/accessible/src/base/nsAccDocManager.cpp
+++ b/accessible/src/base/nsAccDocManager.cpp
@@ -45,17 +45,17 @@
 #include "nsRootAccessibleWrap.h"
 #include "States.h"
 
 #include "nsCURILoader.h"
 #include "nsDocShellLoadTypes.h"
 #include "nsIChannel.h"
 #include "nsIContentViewer.h"
 #include "nsIDOMDocument.h"
-#include "nsIEventListenerManager.h"
+#include "nsEventListenerManager.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMWindow.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIWebNavigation.h"
 #include "nsServiceManagerUtils.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccDocManager
@@ -386,26 +386,26 @@ nsAccDocManager::IsEventTargetDocument(n
   return (contentType == nsIDocShellTreeItem::typeContent);
 }
 
 void
 nsAccDocManager::AddListeners(nsIDocument *aDocument,
                               PRBool aAddDOMContentLoadedListener)
 {
   nsPIDOMWindow *window = aDocument->GetWindow();
-  nsPIDOMEventTarget *target = window->GetChromeEventHandler();
-  nsIEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
+  nsIDOMEventTarget *target = window->GetChromeEventHandler();
+  nsEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
   elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
-                              NS_EVENT_FLAG_CAPTURE, nsnull);
+                              NS_EVENT_FLAG_CAPTURE);
 
   NS_LOG_ACCDOCCREATE_TEXT("  added 'pagehide' listener")
 
   if (aAddDOMContentLoadedListener) {
     elm->AddEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
-                                NS_EVENT_FLAG_CAPTURE, nsnull);
+                                NS_EVENT_FLAG_CAPTURE);
     NS_LOG_ACCDOCCREATE_TEXT("  added 'DOMContentLoaded' listener")
   }
 }
 
 nsDocAccessible*
 nsAccDocManager::CreateDocOrRootAccessible(nsIDocument *aDocument)
 {
   // Ignore temporary, hiding, resource documents and documents without
--- a/accessible/src/base/nsAccessNode.cpp
+++ b/accessible/src/base/nsAccessNode.cpp
@@ -85,17 +85,17 @@ nsApplicationAccessible *nsAccessNode::g
 
 /*
  * Class nsAccessNode
  */
  
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessible. nsISupports
 
-NS_IMPL_CYCLE_COLLECTION_0(nsAccessNode)
+NS_IMPL_CYCLE_COLLECTION_1(nsAccessNode, mContent)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsAccessNode)
   NS_INTERFACE_MAP_ENTRY(nsIAccessNode)
   NS_INTERFACE_MAP_ENTRY(nsAccessNode)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAccessNode)
 NS_INTERFACE_MAP_END
  
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsAccessNode)
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -169,17 +169,17 @@ nsresult nsAccessible::QueryInterface(RE
     if (mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue) {
       *aInstancePtr = static_cast<nsIAccessibleValue*>(this);
       NS_ADDREF_THIS();
       return NS_OK;
     }
   }                       
 
   if (aIID.Equals(NS_GET_IID(nsIAccessibleHyperLink))) {
-    if (IsHyperLink()) {
+    if (IsLink()) {
       *aInstancePtr = static_cast<nsIAccessibleHyperLink*>(this);
       NS_ADDREF_THIS();
       return NS_OK;
     }
     return NS_ERROR_NO_INTERFACE;
   }
 
   return nsAccessNodeWrap::QueryInterface(aIID, aInstancePtr);
@@ -445,27 +445,35 @@ nsAccessible::GetParent(nsIAccessible **
   return *aParent ? NS_OK : NS_ERROR_FAILURE;
 }
 
   /* readonly attribute nsIAccessible nextSibling; */
 NS_IMETHODIMP
 nsAccessible::GetNextSibling(nsIAccessible **aNextSibling) 
 {
   NS_ENSURE_ARG_POINTER(aNextSibling);
+  *aNextSibling = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
 
   nsresult rv = NS_OK;
   NS_IF_ADDREF(*aNextSibling = GetSiblingAtOffset(1, &rv));
   return rv;
 }
 
   /* readonly attribute nsIAccessible previousSibling; */
 NS_IMETHODIMP
 nsAccessible::GetPreviousSibling(nsIAccessible * *aPreviousSibling) 
 {
   NS_ENSURE_ARG_POINTER(aPreviousSibling);
+  *aPreviousSibling = nsnull;
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
 
   nsresult rv = NS_OK;
   NS_IF_ADDREF(*aPreviousSibling = GetSiblingAtOffset(-1, &rv));
   return rv;
 }
 
   /* readonly attribute nsIAccessible firstChild; */
 NS_IMETHODIMP
@@ -575,17 +583,17 @@ nsAccessible::GetChildCount(PRInt32 *aCh
 }
 
 /* readonly attribute long indexInParent; */
 NS_IMETHODIMP
 nsAccessible::GetIndexInParent(PRInt32 *aIndexInParent)
 {
   NS_ENSURE_ARG_POINTER(aIndexInParent);
 
-  *aIndexInParent = GetIndexInParent();
+  *aIndexInParent = IndexInParent();
   return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
 }
 
 nsresult nsAccessible::GetTranslatedString(const nsAString& aKey, nsAString& aStringOut)
 {
   nsXPIDLString xsValue;
 
   if (!gStringBundle || 
@@ -598,17 +606,17 @@ nsresult nsAccessible::GetTranslatedStri
 
 nsresult nsAccessible::GetFullKeyName(const nsAString& aModifierName, const nsAString& aKeyName, nsAString& aStringOut)
 {
   nsXPIDLString modifierName, separator;
 
   if (!gKeyStringBundle ||
       NS_FAILED(gKeyStringBundle->GetStringFromName(PromiseFlatString(aModifierName).get(), 
                                                     getter_Copies(modifierName))) ||
-      NS_FAILED(gKeyStringBundle->GetStringFromName(PromiseFlatString(NS_LITERAL_STRING("MODIFIER_SEPARATOR")).get(), 
+      NS_FAILED(gKeyStringBundle->GetStringFromName(NS_LITERAL_STRING("MODIFIER_SEPARATOR").get(), 
                                                     getter_Copies(separator)))) {
     return NS_ERROR_FAILURE;
   }
 
   aStringOut = modifierName + separator + aKeyName; 
   return NS_OK;
 }
 
@@ -759,20 +767,20 @@ nsAccessible::GetFocusedChild(nsIAccessi
     if (focusedChild && focusedChild->GetParent() != this)
       focusedChild = nsnull;
   }
 
   NS_IF_ADDREF(*aFocusedChild = focusedChild);
   return NS_OK;
 }
 
-// nsAccessible::GetChildAtPoint()
+// nsAccessible::ChildAtPoint()
 nsAccessible*
-nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                              EWhichChildAtPoint aWhichChild)
+nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                           EWhichChildAtPoint aWhichChild)
 {
   // If we can't find the point in a child, we will return the fallback answer:
   // we return |this| if the point is within it, otherwise nsnull.
   PRInt32 x = 0, y = 0, width = 0, height = 0;
   nsresult rv = GetBounds(&x, &y, &width, &height);
   NS_ENSURE_SUCCESS(rv, nsnull);
 
   nsAccessible* fallbackAnswer = nsnull;
@@ -826,17 +834,17 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
 
       PRInt32 childX, childY, childWidth, childHeight;
       child->GetBounds(&childX, &childY, &childWidth, &childHeight);
       if (aX >= childX && aX < childX + childWidth &&
           aY >= childY && aY < childY + childHeight &&
           (child->State() & states::INVISIBLE) == 0) {
 
         if (aWhichChild == eDeepestChild)
-          return child->GetChildAtPoint(aX, aY, eDeepestChild);
+          return child->ChildAtPoint(aX, aY, eDeepestChild);
 
         return child;
       }
     }
 
     // The point is in this accessible but not in a child. We are allowed to
     // return |this| as the answer.
     return accessible;
@@ -868,32 +876,32 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
                               nsIAccessible **aAccessible)
 {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nsnull;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  NS_IF_ADDREF(*aAccessible = GetChildAtPoint(aX, aY, eDirectChild));
+  NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDirectChild));
   return NS_OK;
 }
 
 // nsIAccessible getDeepestChildAtPoint(in long x, in long y)
 NS_IMETHODIMP
 nsAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
                                      nsIAccessible **aAccessible)
 {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nsnull;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  NS_IF_ADDREF(*aAccessible = GetChildAtPoint(aX, aY, eDeepestChild));
+  NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDeepestChild));
   return NS_OK;
 }
 
 void nsAccessible::GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame)
 {
 /*
  * This method is used to determine the bounds of a content node.
  * Because HTML wraps and links are not always rectangular, this
@@ -2568,62 +2576,62 @@ nsAccessible::GetURI(PRInt32 aIndex, nsI
   NS_ENSURE_ARG_POINTER(aURI);
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount()))
     return NS_ERROR_INVALID_ARG;
 
-  *aURI = GetAnchorURI(aIndex).get();
+  *aURI = AnchorURIAt(aIndex).get();
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsAccessible::GetAnchor(PRInt32 aIndex, nsIAccessible** aAccessible)
 {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nsnull;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount()))
     return NS_ERROR_INVALID_ARG;
 
-  NS_IF_ADDREF(*aAccessible = GetAnchor(aIndex));
+  NS_IF_ADDREF(*aAccessible = AnchorAt(aIndex));
   return NS_OK;
 }
 
 // readonly attribute boolean nsIAccessibleHyperLink::valid
 NS_IMETHODIMP
 nsAccessible::GetValid(PRBool *aValid)
 {
   NS_ENSURE_ARG_POINTER(aValid);
   *aValid = PR_FALSE;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  *aValid = IsValid();
+  *aValid = IsLinkValid();
   return NS_OK;
 }
 
 // readonly attribute boolean nsIAccessibleHyperLink::selected
 NS_IMETHODIMP
 nsAccessible::GetSelected(PRBool *aSelected)
 {
   NS_ENSURE_ARG_POINTER(aSelected);
   *aSelected = PR_FALSE;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  *aSelected = IsSelected();
+  *aSelected = IsLinkSelected();
   return NS_OK;
 
 }
 
 void
 nsAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
                            PRUint32 aLength)
 {
@@ -2831,21 +2839,21 @@ PRInt32
 nsAccessible::GetChildCount()
 {
   return mChildren.Length();
 }
 
 PRInt32
 nsAccessible::GetIndexOf(nsAccessible* aChild)
 {
-  return (aChild->mParent != this) ? -1 : aChild->GetIndexInParent();
+  return (aChild->mParent != this) ? -1 : aChild->IndexInParent();
 }
 
 PRInt32
-nsAccessible::GetIndexInParent() const
+nsAccessible::IndexInParent() const
 {
   return mIndexInParent;
 }
 
 PRInt32
 nsAccessible::GetEmbeddedChildCount()
 {
   if (IsChildrenFlag(eMixedChildren)) {
@@ -2882,78 +2890,59 @@ nsAccessible::GetIndexOfEmbeddedChild(ns
 
   return GetIndexOf(aChild);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HyperLinkAccessible methods
 
 bool
-nsAccessible::IsHyperLink()
+nsAccessible::IsLink()
 {
   // Every embedded accessible within hypertext accessible implements
   // hyperlink interface.
   return mParent && mParent->IsHyperText() && nsAccUtils::IsEmbeddedObject(this);
 }
 
 PRUint32
 nsAccessible::StartOffset()
 {
-  NS_PRECONDITION(IsHyperLink(), "StartOffset is called not on hyper link!");
+  NS_PRECONDITION(IsLink(), "StartOffset is called not on hyper link!");
 
   nsHyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nsnull;
   return hyperText ? hyperText->GetChildOffset(this) : 0;
 }
 
 PRUint32
 nsAccessible::EndOffset()
 {
-  NS_PRECONDITION(IsHyperLink(), "EndOffset is called on not hyper link!");
+  NS_PRECONDITION(IsLink(), "EndOffset is called on not hyper link!");
 
   nsHyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nsnull;
   return hyperText ? (hyperText->GetChildOffset(this) + 1) : 0;
 }
 
-bool
-nsAccessible::IsValid()
-{
-  NS_PRECONDITION(IsHyperLink(), "IsValid is called on not hyper link!");
-
-  return (0 == (State() & states::INVALID));
-  // XXX In order to implement this we would need to follow every link
-  // Perhaps we can get information about invalid links from the cache
-  // In the mean time authors can use role="link" aria-invalid="true"
-  // to force it for links they internally know to be invalid
-}
-
-bool
-nsAccessible::IsSelected()
-{
-  NS_PRECONDITION(IsHyperLink(), "IsSelected is called on not hyper link!");
-  return (gLastFocusedNode == GetNode());
-}
-
 PRUint32
 nsAccessible::AnchorCount()
 {
-  NS_PRECONDITION(IsHyperLink(), "AnchorCount is called on not hyper link!");
+  NS_PRECONDITION(IsLink(), "AnchorCount is called on not hyper link!");
   return 1;
 }
 
 nsAccessible*
-nsAccessible::GetAnchor(PRUint32 aAnchorIndex)
+nsAccessible::AnchorAt(PRUint32 aAnchorIndex)
 {
-  NS_PRECONDITION(IsHyperLink(), "GetAnchor is called on not hyper link!");
+  NS_PRECONDITION(IsLink(), "GetAnchor is called on not hyper link!");
   return aAnchorIndex == 0 ? this : nsnull;
 }
 
 already_AddRefed<nsIURI>
-nsAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
 {
-  NS_PRECONDITION(IsHyperLink(), "GetAnchorURI is called on not hyper link!");
+  NS_PRECONDITION(IsLink(), "AnchorURIAt is called on not hyper link!");
 
   if (aAnchorIndex != 0)
     return nsnull;
 
   // Check if it's a simple xlink.
   if (nsCoreUtils::IsXLink(mContent)) {
     nsAutoString href;
     mContent->GetAttr(kNameSpaceID_XLink, nsAccessibilityAtoms::href, href);
@@ -3161,49 +3150,31 @@ nsAccessible::EnsureChildren()
 
   if (document)
     document->NotifyOfCachingEnd(this);
 
   return false;
 }
 
 nsAccessible*
-nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError)
+nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const
 {
-  if (IsDefunct()) {
-    if (aError)
-      *aError = NS_ERROR_FAILURE;
-
-    return nsnull;
-  }
-
-  nsAccessible *parent = GetParent();
-  if (!parent) {
+  if (!mParent || mIndexInParent == -1) {
     if (aError)
       *aError = NS_ERROR_UNEXPECTED;
 
     return nsnull;
   }
 
-  if (mIndexInParent == -1) {
-    if (aError)
-      *aError = NS_ERROR_UNEXPECTED;
-
+  if (aError && mIndexInParent + aOffset >= mParent->GetChildCount()) {
+    *aError = NS_OK; // fail peacefully
     return nsnull;
   }
 
-  if (aError) {
-    PRInt32 childCount = parent->GetChildCount();
-    if (mIndexInParent + aOffset >= childCount) {
-      *aError = NS_OK; // fail peacefully
-      return nsnull;
-    }
-  }
-
-  nsAccessible* child = parent->GetChildAt(mIndexInParent + aOffset);
+  nsAccessible* child = mParent->GetChildAt(mIndexInParent + aOffset);
   if (aError && !child)
     *aError = NS_ERROR_UNEXPECTED;
 
   return child;
 }
 
 nsAccessible *
 nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -35,16 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef _nsAccessible_H_
 #define _nsAccessible_H_
 
 #include "nsAccessNodeWrap.h"
+#include "States.h"
 
 #include "nsIAccessible.h"
 #include "nsIAccessibleHyperLink.h"
 #include "nsIAccessibleSelectable.h"
 #include "nsIAccessibleValue.h"
 #include "nsIAccessibleRole.h"
 #include "nsIAccessibleStates.h"
 
@@ -192,33 +193,33 @@ public:
 
   /**
    * Returns attributes for accessible without explicitly setted ARIA
    * attributes.
    */
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
 
   /**
-   * Used by GetChildAtPoint() method to get direct or deepest child at point.
+   * Used by ChildAtPoint() method to get direct or deepest child at point.
    */
   enum EWhichChildAtPoint {
     eDirectChild,
     eDeepestChild
   };
 
   /**
    * Return direct or deepest child at the given point.
    *
    * @param  aX           [in] x coordinate relative screen
    * @param  aY           [in] y coordinate relative screen
    * @param  aWhichChild  [in] flag points if deepest or direct child
    *                        should be returned
    */
-  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                        EWhichChildAtPoint aWhichChild);
+  virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                     EWhichChildAtPoint aWhichChild);
 
   /**
    * Return calculated group level based on accessible hierarchy.
    */
   virtual PRInt32 GetLevelInternal();
 
   /**
    * Calculate position in group and group size ('posinset' and 'setsize') based
@@ -292,55 +293,64 @@ public:
   /**
    * Return index of the given child accessible.
    */
   virtual PRInt32 GetIndexOf(nsAccessible* aChild);
 
   /**
    * Return index in parent accessible.
    */
-  virtual PRInt32 GetIndexInParent() const;
+  virtual PRInt32 IndexInParent() const;
 
   /**
    * Return true if accessible has children;
    */
   PRBool HasChildren() { return !!GetChildAt(0); }
 
   /**
+   * Return next/previous sibling of the accessible.
+   */
+  inline nsAccessible* NextSibling() const
+    {  return GetSiblingAtOffset(1); }
+  inline nsAccessible* PrevSibling() const
+    { return GetSiblingAtOffset(-1); }
+
+  /**
    * Return embedded accessible children count.
    */
   PRInt32 GetEmbeddedChildCount();
 
   /**
    * Return embedded accessible child at the given index.
    */
   nsAccessible* GetEmbeddedChildAt(PRUint32 aIndex);
 
   /**
    * Return index of the given embedded accessible child.
    */
   PRInt32 GetIndexOfEmbeddedChild(nsAccessible* aChild);
 
   /**
-   * Return cached accessible of parent-child relatives.
+   * Return number of content children/content child at index. The content
+   * child is created from markup in contrast to it's never constructed by its
+   * parent accessible (like treeitem accessibles for XUL trees).
    */
-  nsAccessible* GetCachedNextSibling() const
-  {
-    return mParent ?
-      mParent->mChildren.SafeElementAt(mIndexInParent + 1, nsnull).get() : nsnull;
-  }
-  nsAccessible* GetCachedPrevSibling() const
-  {
-    return mParent ?
-      mParent->mChildren.SafeElementAt(mIndexInParent - 1, nsnull).get() : nsnull;
-  }
-  PRUint32 GetCachedChildCount() const { return mChildren.Length(); }
-  nsAccessible* GetCachedChildAt(PRUint32 aIndex) const { return mChildren.ElementAt(aIndex); }
+  PRUint32 ContentChildCount() const { return mChildren.Length(); }
+  nsAccessible* ContentChildAt(PRUint32 aIndex) const
+    { return mChildren.ElementAt(aIndex); }
+
+  /**
+   * Return true if children were initialized.
+   */
   inline bool AreChildrenCached() const
     { return !IsChildrenFlag(eChildrenUninitialized); }
+
+  /**
+   * Return true if the accessible is attached to tree.
+   */
   bool IsBoundToParent() const { return !!mParent; }
 
   //////////////////////////////////////////////////////////////////////////////
   // Miscellaneous methods
 
   /**
    * Handle accessible event, i.e. process it, notifies observers and fires
    * platform specific event.
@@ -392,52 +402,66 @@ public:
   nsTextAccessible* AsTextLeaf();
 
   //////////////////////////////////////////////////////////////////////////////
   // HyperLinkAccessible
 
   /**
    * Return true if the accessible is hyper link accessible.
    */
-  virtual bool IsHyperLink();
+  virtual bool IsLink();
 
   /**
    * Return the start offset of the link within the parent accessible.
    */
   virtual PRUint32 StartOffset();
 
   /**
    * Return the end offset of the link within the parent accessible.
    */
   virtual PRUint32 EndOffset();
 
   /**
    * Return true if the link is valid (e. g. points to a valid URL).
    */
-  virtual bool IsValid();
+  inline bool IsLinkValid()
+  {
+    NS_PRECONDITION(IsLink(), "IsLinkValid is called on not hyper link!");
+
+    // XXX In order to implement this we would need to follow every link
+    // Perhaps we can get information about invalid links from the cache
+    // In the mean time authors can use role="link" aria-invalid="true"
+    // to force it for links they internally know to be invalid
+    return (0 == (State() & states::INVALID));
+  }
 
   /**
    * Return true if the link currently has the focus.
    */
-  virtual bool IsSelected();
+  inline bool IsLinkSelected()
+  {
+    NS_PRECONDITION(IsLink(),
+                    "IsLinkSelected() called on something that is not a hyper link!");
+    return gLastFocusedNode == GetNode();
+  }
 
   /**
    * Return the number of anchors within the link.
    */
   virtual PRUint32 AnchorCount();
 
   /**
    * Returns an anchor accessible at the given index.
    */
-  virtual nsAccessible* GetAnchor(PRUint32 aAnchorIndex);
+  virtual nsAccessible* AnchorAt(PRUint32 aAnchorIndex);
 
   /**
    * Returns an anchor URI at the given index.
    */
-  virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+  virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
 
   //////////////////////////////////////////////////////////////////////////////
   // SelectAccessible
 
   /**
    * Return true if the accessible is a select control containing selectable
    * items.
    */
@@ -498,17 +522,17 @@ protected:
    */
   virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent);
   void UnbindFromParent();
 
   /**
    * Return sibling accessible at the given offset.
    */
   virtual nsAccessible* GetSiblingAtOffset(PRInt32 aOffset,
-                                           nsresult *aError = nsnull);
+                                           nsresult *aError = nsnull) const;
 
   /**
    * Flags used to describe the state and type of children.
    */
   enum ChildrenFlags {
     eChildrenUninitialized = 0, // children aren't initialized
     eMixedChildren = 1 << 0, // text leaf children are presented
     eEmbeddedChildren = 1 << 1 // all children are embedded objects
--- a/accessible/src/base/nsApplicationAccessible.cpp
+++ b/accessible/src/base/nsApplicationAccessible.cpp
@@ -164,18 +164,18 @@ nsApplicationAccessible::GroupPosition(P
   NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
   *aSimilarItemsInGroup = 0;
   NS_ENSURE_ARG_POINTER(aPositionInGroup);
   *aPositionInGroup = 0;
   return NS_OK;
 }
 
 nsAccessible*
-nsApplicationAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                         EWhichChildAtPoint aWhichChild)
+nsApplicationAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                      EWhichChildAtPoint aWhichChild)
 {
   return nsnull;
 }
 
 NS_IMETHODIMP
 nsApplicationAccessible::GetRelationByType(PRUint32 aRelationType,
                                            nsIAccessibleRelation **aRelation)
 {
@@ -423,25 +423,19 @@ nsApplicationAccessible::CacheChildren()
         GetAccService()->GetDocAccessible(docNode); // ensure creation
       }
     }
     windowEnumerator->HasMoreElements(&hasMore);
   }
 }
 
 nsAccessible*
-nsApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError)
+nsApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset,
+                                            nsresult* aError) const
 {
-  if (IsDefunct()) {
-    if (aError)
-      *aError = NS_ERROR_FAILURE;
-
-    return nsnull;
-  }
-
   if (aError)
     *aError = NS_OK; // fail peacefully
 
   return nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessNode and nsAccessNode
--- a/accessible/src/base/nsApplicationAccessible.h
+++ b/accessible/src/base/nsApplicationAccessible.h
@@ -58,17 +58,16 @@
  * All the accessibility objects for toplevel windows are direct children of
  * the nsApplicationAccessible instance.
  */
 
 class nsApplicationAccessible: public nsAccessibleWrap,
                                public nsIAccessibleApplication
 {
 public:
-  using nsAccessible::GetChildAtPoint;
 
   nsApplicationAccessible();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessNode
   NS_SCRIPTABLE NS_IMETHOD GetDOMNode(nsIDOMNode** aDOMNode);
@@ -121,26 +120,26 @@ public:
   virtual bool IsPrimaryForNode() const;
 
   // nsAccessible
   virtual void ApplyARIAState(PRUint64* aState);
   virtual void Description(nsString& aDescription);
   virtual PRUint32 NativeRole();
   virtual PRUint64 State();
   virtual PRUint64 NativeState();
-  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                        EWhichChildAtPoint aWhichChild);
+  virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                     EWhichChildAtPoint aWhichChild);
 
   virtual void InvalidateChildren();
 
 protected:
 
   // nsAccessible
   virtual void CacheChildren();
   virtual nsAccessible* GetSiblingAtOffset(PRInt32 aOffset,
-                                           nsresult *aError = nsnull);
+                                           nsresult *aError = nsnull) const;
 
 private:
   nsCOMPtr<nsIXULAppInfo> mAppInfo;
 };
 
 #endif
 
--- a/accessible/src/base/nsBaseWidgetAccessible.cpp
+++ b/accessible/src/base/nsBaseWidgetAccessible.cpp
@@ -64,18 +64,18 @@ nsLeafAccessible::
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsLeafAccessible, nsAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLeafAccessible: nsAccessible public
 
 nsAccessible*
-nsLeafAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                  EWhichChildAtPoint aWhichChild)
+nsLeafAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                               EWhichChildAtPoint aWhichChild)
 {
   // Don't walk into leaf accessibles.
   return this;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLeafAccessible: nsAccessible private
 
@@ -195,24 +195,24 @@ nsLinkableAccessible::Shutdown()
   mActionAcc = nsnull;
   nsAccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible: HyperLinkAccessible
 
 already_AddRefed<nsIURI>
-nsLinkableAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsLinkableAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
 {
   if (mIsLink) {
-    NS_ASSERTION(mActionAcc->IsHyperLink(),
+    NS_ASSERTION(mActionAcc->IsLink(),
                  "nsIAccessibleHyperLink isn't implemented.");
 
-    if (mActionAcc->IsHyperLink())
-      return mActionAcc->GetAnchorURI(aAnchorIndex);
+    if (mActionAcc->IsLink())
+      return mActionAcc->AnchorURIAt(aAnchorIndex);
   }
 
   return nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible: nsAccessible protected
 
--- a/accessible/src/base/nsBaseWidgetAccessible.h
+++ b/accessible/src/base/nsBaseWidgetAccessible.h
@@ -50,26 +50,25 @@
   */
 
 /** 
   * Leaf version of DOM Accessible -- has no children
   */
 class nsLeafAccessible : public nsAccessibleWrap
 {
 public:
-  using nsAccessible::GetChildAtPoint;
 
   nsLeafAccessible(nsIContent *aContent, nsIWeakReference *aShell);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsAccessible
-  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                        EWhichChildAtPoint aWhichChild);
+  virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                     EWhichChildAtPoint aWhichChild);
 
 protected:
 
   // nsAccessible
   virtual void CacheChildren();
 };
 
 /**
@@ -97,17 +96,17 @@ public:
 
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint64 NativeState();
 
   // HyperLinkAccessible
-  virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+  virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
 
 protected:
   // nsAccessible
   virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent);
 
   /**
    * Parent accessible that provides an action for this linkable accessible.
    */
--- a/accessible/src/base/nsCoreUtils.cpp
+++ b/accessible/src/base/nsCoreUtils.cpp
@@ -38,27 +38,26 @@
 
 #include "nsCoreUtils.h"
 
 #include "nsIAccessibleTypes.h"
 
 #include "nsAccessNode.h"
 
 #include "nsIDocument.h"
-#include "nsIDOM3Node.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMWindowInternal.h"
 #include "nsIDOMXULElement.h"
 #include "nsIDocShell.h"
 #include "nsIContentViewer.h"
-#include "nsIEventListenerManager.h"
+#include "nsEventListenerManager.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsIScrollableFrame.h"
 #include "nsEventStateManager.h"
 #include "nsISelection2.h"
 #include "nsISelectionController.h"
 #include "nsPIDOMWindow.h"
 #include "nsGUIEvent.h"
@@ -74,17 +73,17 @@ static NS_DEFINE_IID(kRangeCID, NS_RANGE
 ////////////////////////////////////////////////////////////////////////////////
 // nsCoreUtils
 ////////////////////////////////////////////////////////////////////////////////
 
 PRBool
 nsCoreUtils::HasClickListener(nsIContent *aContent)
 {
   NS_ENSURE_TRUE(aContent, PR_FALSE);
-  nsIEventListenerManager* listenerManager =
+  nsEventListenerManager* listenerManager =
     aContent->GetListenerManager(PR_FALSE);
 
   return listenerManager &&
     (listenerManager->HasListenersFor(NS_LITERAL_STRING("click")) ||
      listenerManager->HasListenersFor(NS_LITERAL_STRING("mousedown")) ||
      listenerManager->HasListenersFor(NS_LITERAL_STRING("mouseup")));
 }
 
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -133,29 +133,31 @@ nsDocAccessible::~nsDocAccessible()
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocAccessible)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDocAccessible, nsAccessible)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDocument)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mNotificationController,
                                                   NotificationController)
 
   PRUint32 i, length = tmp->mChildDocuments.Length();
   for (i = 0; i < length; ++i) {
-    NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mChildDocuments[i]");
-    cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mChildDocuments[i].get()));
+    NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mChildDocuments[i],
+                                                         nsIAccessible)
   }
 
   CycleCollectorTraverseCache(tmp->mAccessibleCache, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDocAccessible, nsAccessible)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDocument)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mNotificationController)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSTARRAY(mChildDocuments)
   tmp->mDependentIDsHash.Clear();
   tmp->mNodeToAccessibleMap.Clear();
   ClearCache(tmp->mAccessibleCache);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDocAccessible)
@@ -1914,51 +1916,54 @@ nsDocAccessible::UpdateTreeInternal(nsAc
   return updateFlags;
 }
 
 void
 nsDocAccessible::CacheChildrenInSubtree(nsAccessible* aRoot)
 {
   aRoot->EnsureChildren();
 
-  PRUint32 count = aRoot->GetChildCount();
-  for (PRUint32 idx = 0; idx < count; idx++)  {
-    nsAccessible* child = aRoot->GetChildAt(idx);
+  // Make sure we create accessible tree defined in DOM only, i.e. if accessible
+  // provides specific tree (like XUL trees) then tree creation is handled by
+  // this accessible.
+  PRUint32 count = aRoot->ContentChildCount();
+  for (PRUint32 idx = 0; idx < count; idx++) {
+    nsAccessible* child = aRoot->ContentChildAt(idx);
     NS_ASSERTION(child, "Illicit tree change while tree is created!");
     // Don't cross document boundaries.
     if (child && child->IsContent())
       CacheChildrenInSubtree(child);
   }
 }
 
 void
 nsDocAccessible::UncacheChildrenInSubtree(nsAccessible* aRoot)
 {
   if (aRoot->IsElement())
     RemoveDependentIDsFor(aRoot);
 
-  PRUint32 count = aRoot->GetCachedChildCount();
+  PRUint32 count = aRoot->ContentChildCount();
   for (PRUint32 idx = 0; idx < count; idx++)
-    UncacheChildrenInSubtree(aRoot->GetCachedChildAt(idx));
+    UncacheChildrenInSubtree(aRoot->ContentChildAt(idx));
 
   if (aRoot->IsPrimaryForNode() &&
       mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot)
     mNodeToAccessibleMap.Remove(aRoot->GetNode());
 }
 
 void
 nsDocAccessible::ShutdownChildrenInSubtree(nsAccessible* aAccessible)
 {
   // Traverse through children and shutdown them before this accessible. When
   // child gets shutdown then it removes itself from children array of its
   //parent. Use jdx index to process the cases if child is not attached to the
   // parent and as result doesn't remove itself from its children.
-  PRUint32 count = aAccessible->GetCachedChildCount();
+  PRUint32 count = aAccessible->ContentChildCount();
   for (PRUint32 idx = 0, jdx = 0; idx < count; idx++) {
-    nsAccessible* child = aAccessible->GetCachedChildAt(jdx);
+    nsAccessible* child = aAccessible->ContentChildAt(jdx);
     if (!child->IsBoundToParent()) {
       NS_ERROR("Parent refers to a child, child doesn't refer to parent!");
       jdx++;
     }
 
     ShutdownChildrenInSubtree(child);
   }
 
--- a/accessible/src/base/nsOuterDocAccessible.cpp
+++ b/accessible/src/base/nsOuterDocAccessible.cpp
@@ -69,33 +69,33 @@ nsOuterDocAccessible::NativeRole()
 
 PRUint64
 nsOuterDocAccessible::NativeState()
 {
   return nsAccessible::NativeState() & ~states::FOCUSABLE;
 }
 
 nsAccessible*
-nsOuterDocAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                      EWhichChildAtPoint aWhichChild)
+nsOuterDocAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                   EWhichChildAtPoint aWhichChild)
 {
   PRInt32 docX = 0, docY = 0, docWidth = 0, docHeight = 0;
   nsresult rv = GetBounds(&docX, &docY, &docWidth, &docHeight);
   NS_ENSURE_SUCCESS(rv, nsnull);
 
   if (aX < docX || aX >= docX + docWidth || aY < docY || aY >= docY + docHeight)
     return nsnull;
 
   // Always return the inner doc as direct child accessible unless bounds
   // outside of it.
   nsAccessible* child = GetChildAt(0);
   NS_ENSURE_TRUE(child, nsnull);
 
   if (aWhichChild == eDeepestChild)
-    return child->GetChildAtPoint(aX, aY, eDeepestChild);
+    return child->ChildAtPoint(aX, aY, eDeepestChild);
   return child;
 }
 
 nsresult
 nsOuterDocAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
 {
   nsAutoString tag;
   aAttributes->GetStringProperty(NS_LITERAL_CSTRING("tag"), tag);
--- a/accessible/src/base/nsOuterDocAccessible.h
+++ b/accessible/src/base/nsOuterDocAccessible.h
@@ -65,18 +65,18 @@ public:
 
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint32 NativeRole();
   virtual PRUint64 NativeState();
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
-  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                        EWhichChildAtPoint aWhichChild);
+  virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                     EWhichChildAtPoint aWhichChild);
 
   virtual void InvalidateChildren();
   virtual PRBool AppendChild(nsAccessible *aAccessible);
   virtual PRBool RemoveChild(nsAccessible *aAccessible);
 
 protected:
   // nsAccessible
   virtual void CacheChildren();
--- a/accessible/src/base/nsRootAccessible.cpp
+++ b/accessible/src/base/nsRootAccessible.cpp
@@ -60,28 +60,27 @@
 #include "nsIDOMHTMLSelectElement.h"
 #include "nsIDOMDataContainerEvent.h"
 #include "nsIDOMNSEvent.h"
 #include "nsIDOMXULMenuListElement.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsIDOMXULPopupElement.h"
 #include "nsIDocument.h"
-#include "nsIEventListenerManager.h"
+#include "nsEventListenerManager.h"
 #include "nsIFrame.h"
 #include "nsIMenuFrame.h"
 #include "nsIHTMLDocument.h"
 #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 "nsIPrivateDOMEvent.h"
 #include "nsFocusManager.h"
 
 #ifdef MOZ_XUL
 #include "nsXULTreeAccessible.h"
 #include "nsIXULDocument.h"
 #include "nsIXULWindow.h"
 #endif
@@ -246,21 +245,21 @@ const char* const docEvents[] = {
   "DOMMenuInactive",
   "DOMMenuItemActive",
   "DOMMenuBarActive",
   "DOMMenuBarInactive"
 };
 
 nsresult nsRootAccessible::AddEventListeners()
 {
-  // nsIDOMNSEventTarget interface allows to register event listeners to
+  // nsIDOMEventTarget interface allows to register event listeners to
   // receive untrusted events (synthetic events generated by untrusted code).
   // For example, XBL bindings implementations for elements that are hosted in
   // non chrome document fire untrusted events.
-  nsCOMPtr<nsIDOMNSEventTarget> nstarget(do_QueryInterface(mDocument));
+  nsCOMPtr<nsIDOMEventTarget> nstarget(do_QueryInterface(mDocument));
 
   if (nstarget) {
     for (const char* const* e = docEvents,
                    * const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents);
          e < e_end; ++e) {
       nsresult rv = nstarget->AddEventListener(NS_ConvertASCIItoUTF16(*e),
                                                this, PR_TRUE, PR_TRUE, 2);
       NS_ENSURE_SUCCESS(rv, rv);
--- a/accessible/src/base/nsTextEquivUtils.cpp
+++ b/accessible/src/base/nsTextEquivUtils.cpp
@@ -514,17 +514,17 @@ PRUint32 nsTextEquivUtils::gRoleToNameRu
   eNoRule,           // ROLE_VIEWPORT
   eNoRule,           // ROLE_HEADER
   eNoRule,           // ROLE_FOOTER
   eFromSubtreeIfRec, // ROLE_PARAGRAPH
   eNoRule,           // ROLE_RULER
   eNoRule,           // ROLE_AUTOCOMPLETE
   eNoRule,           // ROLE_EDITBAR
   eFromValue,        // ROLE_ENTRY
-  eNoRule,           // ROLE_CAPTION
+  eFromSubtreeIfRec, // ROLE_CAPTION
   eNoRule,           // ROLE_DOCUMENT_FRAME
   eFromSubtreeIfRec, // ROLE_HEADING
   eNoRule,           // ROLE_PAGE
   eFromSubtreeIfRec, // ROLE_SECTION
   eNoRule,           // ROLE_REDUNDANT_OBJECT
   eNoRule,           // ROLE_FORM
   eNoRule,           // ROLE_IME
   eNoRule,           // ROLE_APP_ROOT
--- a/accessible/src/html/nsHTMLImageMapAccessible.cpp
+++ b/accessible/src/html/nsHTMLImageMapAccessible.cpp
@@ -80,23 +80,23 @@ nsHTMLImageMapAccessible::NativeRole()
 
 PRUint32
 nsHTMLImageMapAccessible::AnchorCount()
 {
   return GetChildCount();
 }
 
 nsAccessible*
-nsHTMLImageMapAccessible::GetAnchor(PRUint32 aAnchorIndex)
+nsHTMLImageMapAccessible::AnchorAt(PRUint32 aAnchorIndex)
 {
   return GetChildAt(aAnchorIndex);
 }
 
 already_AddRefed<nsIURI>
-nsHTMLImageMapAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsHTMLImageMapAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
 {
   nsAccessible* area = GetChildAt(aAnchorIndex);
   if (!area)
     return nsnull;
 
   nsIContent* linkContent = area->GetContent();
   return linkContent ? linkContent->GetHrefURI() : nsnull;
 }
@@ -238,41 +238,41 @@ nsHTMLAreaAccessible::NativeState()
       mRoleMapEntry->role != nsIAccessibleRole::ROLE_LINK) {
     return nsAccessible::NativeState();
   }
 
   return nsHTMLLinkAccessible::NativeState();
 }
 
 nsAccessible*
-nsHTMLAreaAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                      EWhichChildAtPoint aWhichChild)
+nsHTMLAreaAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                   EWhichChildAtPoint aWhichChild)
 {
   // Don't walk into area accessibles.
   return this;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLImageMapAccessible: HyperLinkAccessible
 
 PRUint32
 nsHTMLAreaAccessible::StartOffset()
 {
   // Image map accessible is not hypertext accessible therefore
   // StartOffset/EndOffset implementations of nsAccessible doesn't work here.
   // We return index in parent because image map contains area links only which
   // are embedded objects.
   // XXX: image map should be a hypertext accessible.
-  return GetIndexInParent();
+  return IndexInParent();
 }
 
 PRUint32
 nsHTMLAreaAccessible::EndOffset()
 {
-  return GetIndexInParent() + 1;
+  return IndexInParent() + 1;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLAreaAccessible: nsAccessible protected
 
 void
 nsHTMLAreaAccessible::CacheChildren()
 {
--- a/accessible/src/html/nsHTMLImageMapAccessible.h
+++ b/accessible/src/html/nsHTMLImageMapAccessible.h
@@ -57,18 +57,18 @@ public:
   // nsISupports and cycle collector
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsAccessible
   virtual PRUint32 NativeRole();
 
   // HyperLinkAccessible
   virtual PRUint32 AnchorCount();
-  virtual nsAccessible* GetAnchor(PRUint32 aAnchorIndex);
-  virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+  virtual nsAccessible* AnchorAt(PRUint32 aAnchorIndex);
+  virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
 
 protected:
 
   // nsAccessible
   virtual void CacheChildren();
 
 private:
   // Reference on linked map element if any.
@@ -77,30 +77,29 @@ private:
 
 
 /**
  * Accessible for image map areas - must be child of image.
  */
 class nsHTMLAreaAccessible : public nsHTMLLinkAccessible
 {
 public:
-  using nsAccessible::GetChildAtPoint;
 
   nsHTMLAreaAccessible(nsIContent *aContent, nsIWeakReference *aShell);
 
   // nsIAccessible
 
   NS_IMETHOD GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
 
   // nsAccessible
   virtual void Description(nsString& aDescription);
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual PRUint64 NativeState();
-  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                        EWhichChildAtPoint aWhichChild);
+  virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                     EWhichChildAtPoint aWhichChild);
 
   // HyperLinkAccessible
   virtual PRUint32 StartOffset();
   virtual PRUint32 EndOffset();
 
 protected:
 
   // nsAccessible
--- a/accessible/src/html/nsHTMLLinkAccessible.cpp
+++ b/accessible/src/html/nsHTMLLinkAccessible.cpp
@@ -161,24 +161,24 @@ nsHTMLLinkAccessible::DoAction(PRUint8 a
   DoCommand();
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HyperLinkAccessible
 
 bool
-nsHTMLLinkAccessible::IsHyperLink()
+nsHTMLLinkAccessible::IsLink()
 {
   // Expose HyperLinkAccessible unconditionally.
   return true;
 }
 
 already_AddRefed<nsIURI>
-nsHTMLLinkAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsHTMLLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
 {
   return aAnchorIndex == 0 ? mContent->GetHrefURI() : nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Protected members
 
 PRBool
--- a/accessible/src/html/nsHTMLLinkAccessible.h
+++ b/accessible/src/html/nsHTMLLinkAccessible.h
@@ -56,18 +56,18 @@ public:
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessible
   virtual PRUint32 NativeRole();
   virtual PRUint64 NativeState();
 
   // HyperLinkAccessible
-  virtual bool IsHyperLink();
-  virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+  virtual bool IsLink();
+  virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
 
 protected:
   enum { eAction_Jump = 0 };
 
   /**
    * Returns true if the link has href attribute.
    */
   PRBool IsLinked();
--- a/accessible/src/html/nsHTMLTableAccessible.cpp
+++ b/accessible/src/html/nsHTMLTableAccessible.cpp
@@ -308,29 +308,29 @@ nsHTMLTableCellAccessible::GetHeaderCell
   // Get header cells from @header attribute.
   IDRefsIterator iter(mContent, nsAccessibilityAtoms::headers);
   nsIContent* headerCellElm = iter.NextElem();
   if (headerCellElm) {
     nsresult rv = NS_OK;
     nsCOMPtr<nsIMutableArray> headerCells =
       do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
+    PRUint32 desiredRole = -1;
+    if (aRowOrColumnHeaderCell == nsAccUtils::eRowHeaderCells)
+      desiredRole = nsIAccessibleRole::ROLE_ROWHEADER;
+    else if (aRowOrColumnHeaderCell == nsAccUtils::eColumnHeaderCells)
+      desiredRole = nsIAccessibleRole::ROLE_COLUMNHEADER;
 
     do {
       nsAccessible* headerCell =
         GetAccService()->GetAccessibleInWeakShell(headerCellElm, mWeakShell);
 
-      if (headerCell &&
-          (aRowOrColumnHeaderCell == nsAccUtils::eRowHeaderCells &&
-              headerCell->Role() == nsIAccessibleRole::ROLE_ROWHEADER ||
-              aRowOrColumnHeaderCell == nsAccUtils::eColumnHeaderCells &&
-              headerCell->Role() == nsIAccessibleRole::ROLE_COLUMNHEADER)) {
+      if (headerCell && headerCell->Role() == desiredRole)
         headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
                                    PR_FALSE);
-      }
     } while ((headerCellElm = iter.NextElem()));
 
     NS_ADDREF(*aHeaderCells = headerCells);
     return NS_OK;
   }
 
   // Otherwise calculate header cells from hierarchy (see 11.4.3 "Algorithm to
   // find heading information" of w3c HTML 4.01).
@@ -459,20 +459,32 @@ nsHTMLTableAccessible::NativeState()
 {
   return nsAccessible::NativeState() | states::READONLY;
 }
 
 nsresult
 nsHTMLTableAccessible::GetNameInternal(nsAString& aName)
 {
   nsAccessible::GetNameInternal(aName);
+  if (!aName.IsEmpty())
+    return NS_OK;
 
-  if (aName.IsEmpty())
-    mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary, aName);
+  // Use table caption as a name.
+  nsAccessible* caption = Caption();
+  if (caption) {
+    nsIContent* captionContent = caption->GetContent();
+    if (captionContent) {
+      nsTextEquivUtils::AppendTextEquivFromContent(this, captionContent, &aName);
+      if (!aName.IsEmpty())
+        return NS_OK;
+    }
+  }
 
+  // If no caption then use summary as a name.
+  mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary, aName);
   return NS_OK;
 }
 
 nsresult
 nsHTMLTableAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
 {
   nsresult rv = nsAccessibleWrap::GetAttributesInternal(aAttributes);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -494,35 +506,31 @@ nsHTMLTableAccessible::GetAttributesInte
 NS_IMETHODIMP
 nsHTMLTableAccessible::GetRelationByType(PRUint32 aRelationType,
                                          nsIAccessibleRelation **aRelation)
 {
   nsresult rv = nsAccessibleWrap::GetRelationByType(aRelationType,
                                                     aRelation);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  if (aRelationType == nsIAccessibleRelation::RELATION_DESCRIBED_BY) {
-    nsCOMPtr<nsIAccessible> accCaption;
-    GetCaption(getter_AddRefs(accCaption));
-    return nsRelUtils::AddTarget(aRelationType, aRelation, accCaption);
-  }
+  if (aRelationType == nsIAccessibleRelation::RELATION_DESCRIBED_BY)
+    return nsRelUtils::AddTarget(aRelationType, aRelation, Caption());
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLTableAccessible: nsIAccessibleTable implementation
 
 NS_IMETHODIMP
 nsHTMLTableAccessible::GetCaption(nsIAccessible **aCaption)
 {
-  nsAccessible* firstChild = GetChildAt(0);
-  if (firstChild && firstChild->Role() == nsIAccessibleRole::ROLE_CAPTION)
-    NS_ADDREF(*aCaption = firstChild);
+  NS_ENSURE_ARG_POINTER(aCaption);
 
+  NS_IF_ADDREF(*aCaption = Caption());
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHTMLTableAccessible::GetSummary(nsAString &aSummary)
 {
   nsCOMPtr<nsIDOMHTMLTableElement> table(do_QueryInterface(mContent));
   NS_ENSURE_TRUE(table, NS_ERROR_FAILURE);
@@ -1199,23 +1207,19 @@ nsHTMLTableAccessible::RemoveRowsOrColum
   nsITableLayout *tableLayout = GetTableLayout();
   NS_ENSURE_STATE(tableLayout);
 
   nsCOMPtr<nsIPresShell> presShell(GetPresShell());
   nsRefPtr<nsFrameSelection> tableSelection =
     const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
 
   PRBool doUnselectRow = (aTarget == nsISelectionPrivate::TABLESELECTION_ROW);
-
-  nsresult rv = NS_OK;
   PRInt32 count = 0;
-  if (doUnselectRow)
-    rv = GetColumnCount(&count);
-  else
-    rv = GetRowCount(&count);
+  nsresult rv = doUnselectRow ? GetColumnCount(&count) : GetRowCount(&count);
+  NS_ENSURE_SUCCESS(rv, rv);
 
   PRInt32 startRowIdx = doUnselectRow ? aIndex : 0;
   PRInt32 endRowIdx = doUnselectRow ? aIndex : count - 1;
   PRInt32 startColIdx = doUnselectRow ? 0 : aIndex;
   PRInt32 endColIdx = doUnselectRow ? count - 1 : aIndex;
 
   if (aIsOuter)
     return tableSelection->RestrictCellsToSelection(mContent,
@@ -1263,27 +1267,33 @@ void
 nsHTMLTableAccessible::Description(nsString& aDescription)
 {
   // Helpful for debugging layout vs. data tables
   aDescription.Truncate();
   nsAccessible::Description(aDescription);
   if (!aDescription.IsEmpty())
     return;
 
-  nsCOMPtr<nsIAccessible> captionAccessible;
-  GetCaption(getter_AddRefs(captionAccessible));
-  nsCOMPtr<nsIAccessNode> captionAccessNode = do_QueryInterface(captionAccessible);
-  if (captionAccessNode) {
-    nsCOMPtr<nsIDOMNode> captionNode;
-    captionAccessNode->GetDOMNode(getter_AddRefs(captionNode));
-    nsCOMPtr<nsIContent> captionContent = do_QueryInterface(captionNode);
-    if (captionContent)
+  // Use summary as description if it weren't used as a name.
+  // XXX: get rid code duplication with NameInternal().
+  nsAccessible* caption = Caption();
+  if (caption) {
+    nsIContent* captionContent = caption->GetContent();
+    if (captionContent) {
+      nsAutoString captionText;
       nsTextEquivUtils::AppendTextEquivFromContent(this, captionContent,
-                                                   &aDescription);
+                                                   &captionText);
+
+      if (!captionText.IsEmpty()) { // summary isn't used as a name.
+        mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary,
+                          aDescription);
+      }
+    }
   }
+
 #ifdef SHOW_LAYOUT_HEURISTIC
   if (aDescription.IsEmpty()) {
     PRBool isProbablyForLayout;
     IsProbablyForLayout(&isProbablyForLayout);
     aDescription = mLayoutHeuristic;
   }
 #ifdef DEBUG_A11Y
   printf("\nTABLE: %s\n", NS_ConvertUTF16toUTF8(mLayoutHeuristic).get());
--- a/accessible/src/html/nsHTMLTableAccessible.h
+++ b/accessible/src/html/nsHTMLTableAccessible.h
@@ -136,16 +136,24 @@ public:
 
   // nsAccessible
   virtual void Description(nsString& aDescription);
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual PRUint32 NativeRole();
   virtual PRUint64 NativeState();
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
 
+  // TableAccessible
+  inline nsAccessible* Caption() const
+  {
+    nsAccessible* child = mChildren.SafeElementAt(0, nsnull);
+    return child && child->Role() == nsIAccessibleRole::ROLE_CAPTION ?
+      child : nsnull;
+  }
+
   // nsHTMLTableAccessible
 
   /**
    * Retun cell element at the given row and column index.
    */
   nsresult GetCellAt(PRInt32 aRowIndex, PRInt32 aColIndex,
                      nsIDOMElement* &aCell);
 
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -1149,17 +1149,17 @@ nsHyperTextAccessible::GetTextAttributes
         nsTextAttrsMgr textAttrsMgr(this, PR_TRUE, nsnull, -1);
         return textAttrsMgr.GetAttributes(*aAttributes);
       }
       return NS_OK;
     }
     return NS_ERROR_INVALID_ARG;
   }
 
-  PRInt32 accAtOffsetIdx = accAtOffset->GetIndexInParent();
+  PRInt32 accAtOffsetIdx = accAtOffset->IndexInParent();
   PRInt32 startOffset = GetChildOffset(accAtOffsetIdx);
   PRInt32 endOffset = GetChildOffset(accAtOffsetIdx + 1);
   PRInt32 offsetInAcc = aOffset - startOffset;
 
   nsTextAttrsMgr textAttrsMgr(this, aIncludeDefAttrs, accAtOffset,
                               accAtOffsetIdx);
   nsresult rv = textAttrsMgr.GetAttributes(*aAttributes, &startOffset,
                                            &endOffset);
@@ -2088,17 +2088,17 @@ nsHyperTextAccessible::InvalidateChildre
   mOffsets.Clear();
 
   nsAccessibleWrap::InvalidateChildren();
 }
 
 PRBool
 nsHyperTextAccessible::RemoveChild(nsAccessible* aAccessible)
 {
-  PRInt32 childIndex = aAccessible->GetIndexInParent();
+  PRInt32 childIndex = aAccessible->IndexInParent();
   PRInt32 count = mOffsets.Length() - childIndex;
   if (count > 0)
     mOffsets.RemoveElementsAt(childIndex, count);
 
   return nsAccessible::RemoveChild(aAccessible);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/src/msaa/CAccessibleHyperlink.cpp
+++ b/accessible/src/msaa/CAccessibleHyperlink.cpp
@@ -51,17 +51,17 @@
 
 STDMETHODIMP
 CAccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
 {
   *ppv = NULL;
 
   if (IID_IAccessibleHyperlink == iid) {
     nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
-    if (!thisObj->IsHyperLink())
+    if (!thisObj->IsLink())
       return E_NOINTERFACE;
 
     *ppv = static_cast<IAccessibleHyperlink*>(this);
     (reinterpret_cast<IUnknown*>(*ppv))->AddRef();
     return S_OK;
   }
 
   return CAccessibleAction::QueryInterface(iid, ppv);
@@ -71,23 +71,23 @@ CAccessibleHyperlink::QueryInterface(REF
 
 STDMETHODIMP
 CAccessibleHyperlink::get_anchor(long aIndex, VARIANT *aAnchor)
 {
 __try {
   VariantInit(aAnchor);
 
   nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
-  if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+  if (thisObj->IsDefunct() || !thisObj->IsLink())
     return E_FAIL;
 
   if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
     return E_INVALIDARG;
 
-  nsAccessible* anchor = thisObj->GetAnchor(aIndex);
+  nsAccessible* anchor = thisObj->AnchorAt(aIndex);
   if (!anchor)
     return S_FALSE;
 
   nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryObject(anchor));
   if (!winAccessNode)
     return E_FAIL;
 
   void *instancePtr = NULL;
@@ -106,23 +106,23 @@ CAccessibleHyperlink::get_anchor(long aI
 
 STDMETHODIMP
 CAccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT *aAnchorTarget)
 {
 __try {
   VariantInit(aAnchorTarget);
 
   nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
-  if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+  if (thisObj->IsDefunct() || !thisObj->IsLink())
     return E_FAIL;
 
   if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
     return E_INVALIDARG;
 
-  nsCOMPtr<nsIURI> uri = thisObj->GetAnchorURI(aIndex);
+  nsCOMPtr<nsIURI> uri = thisObj->AnchorURIAt(aIndex);
   if (!uri)
     return S_FALSE;
 
   nsCAutoString prePath;
   nsresult rv = uri->GetPrePath(prePath);
   if (NS_FAILED(rv))
     return GetHRESULT(rv);
 
@@ -146,52 +146,52 @@ CAccessibleHyperlink::get_anchorTarget(l
 
 STDMETHODIMP
 CAccessibleHyperlink::get_startIndex(long *aIndex)
 {
 __try {
   *aIndex = 0;
 
   nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
-  if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+  if (thisObj->IsDefunct() || !thisObj->IsLink())
     return E_FAIL;
 
   *aIndex = thisObj->StartOffset();
   return S_OK;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
 CAccessibleHyperlink::get_endIndex(long *aIndex)
 {
 __try {
   *aIndex = 0;
 
   nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
-  if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+  if (thisObj->IsDefunct() || !thisObj->IsLink())
     return E_FAIL;
 
   *aIndex = thisObj->EndOffset();
   return S_OK;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
 CAccessibleHyperlink::get_valid(boolean *aValid)
 {
 __try {
   *aValid = false;
 
   nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
-  if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+  if (thisObj->IsDefunct() || !thisObj->IsLink())
     return E_FAIL;
 
-  *aValid = thisObj->IsValid();
+  *aValid = thisObj->IsLinkValid();
   return S_OK;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -894,48 +894,30 @@ STDMETHODIMP nsAccessibleWrap::accNaviga
 
 STDMETHODIMP nsAccessibleWrap::accHitTest(
       /* [in] */ long xLeft,
       /* [in] */ long yTop,
       /* [retval][out] */ VARIANT __RPC_FAR *pvarChild)
 {
 __try {
   VariantInit(pvarChild);
-
-  // convert to window coords
-  nsCOMPtr<nsIAccessible> xpAccessible;
-
-  xLeft = xLeft;
-  yTop = yTop;
+  if (IsDefunct())
+    return E_FAIL;
 
-  if (nsAccUtils::MustPrune(this)) {
-    xpAccessible = this;
-  }
-  else {
-    GetChildAtPoint(xLeft, yTop, getter_AddRefs(xpAccessible));
-  }
+  nsAccessible* accessible = ChildAtPoint(xLeft, yTop, eDirectChild);
 
   // if we got a child
-  if (xpAccessible) {
+  if (accessible) {
     // if the child is us
-    if (xpAccessible == static_cast<nsIAccessible*>(this)) {
+    if (accessible == this) {
       pvarChild->vt = VT_I4;
       pvarChild->lVal = CHILDID_SELF;
     } else { // its not create an Accessible for it.
       pvarChild->vt = VT_DISPATCH;
-      pvarChild->pdispVal = NativeAccessible(xpAccessible);
-      nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(xpAccessible));
-      NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
-      nsCOMPtr<nsIDOMNode> domNode;
-      accessNode->GetDOMNode(getter_AddRefs(domNode));
-      if (!domNode) {
-        // Has already been shut down
-        pvarChild->vt = VT_EMPTY;
-        return E_FAIL;
-      }
+      pvarChild->pdispVal = NativeAccessible(accessible);
     }
   } else {
     // no child at that point
     pvarChild->vt = VT_EMPTY;
     return S_FALSE;
   }
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
 
@@ -1377,29 +1359,28 @@ nsAccessibleWrap::get_windowHandle(HWND 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
 nsAccessibleWrap::get_indexInParent(long *aIndexInParent)
 {
 __try {
-  *aIndexInParent = -1;
+  if (!aIndexInParent)
+    return E_INVALIDARG;
 
-  PRInt32 index = -1;
-  nsresult rv = GetIndexInParent(&index);
-  if (NS_FAILED(rv))
-    return GetHRESULT(rv);
+  *aIndexInParent = -1;
+  if (IsDefunct())
+    return E_FAIL;
 
-  if (index == -1)
+  *aIndexInParent = IndexInParent();
+  if (*aIndexInParent == -1)
     return S_FALSE;
 
-  *aIndexInParent = index;
   return S_OK;
-
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
 nsAccessibleWrap::get_locale(IA2Locale *aLocale)
 {
 __try {
--- a/accessible/src/msaa/nsRootAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsRootAccessibleWrap.cpp
@@ -36,17 +36,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsRootAccessibleWrap.h"
 
 #include "nsWinUtils.h"
 
 #include "nsIDOMEventTarget.h"
-#include "nsIEventListenerManager.h"
+#include "nsEventListenerManager.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 // Constructor/desctructor
 
 nsRootAccessibleWrap::
   nsRootAccessibleWrap(nsIDocument* aDocument, nsIContent* aRootContent,
                        nsIWeakReference* aShell) :
   nsRootAccessible(aDocument, aRootContent, aShell)
--- a/accessible/src/xforms/nsXFormsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsAccessible.cpp
@@ -557,18 +557,18 @@ nsXFormsSelectableItemAccessible::DoActi
 {
   if (aIndex != eAction_Click)
     return NS_ERROR_INVALID_ARG;
 
   DoCommand();
   return NS_OK;
 }
 
-PRBool
-nsXFormsSelectableItemAccessible::IsItemSelected()
+bool
+nsXFormsSelectableItemAccessible::IsSelected()
 {
   nsresult rv;
 
   nsINode* parent = mContent;
   while ((parent = parent->GetNodeParent())) {
     nsCOMPtr<nsIContent> content(do_QueryInterface(parent));
     if (!content)
       return PR_FALSE;
--- a/accessible/src/xforms/nsXFormsAccessible.h
+++ b/accessible/src/xforms/nsXFormsAccessible.h
@@ -189,13 +189,13 @@ public:
   nsXFormsSelectableItemAccessible(nsIContent *aContent,
                                    nsIWeakReference *aShell);
 
   NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD GetNumActions(PRUint8 *aCount);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
 protected:
-  PRBool IsItemSelected();
+  bool IsSelected();
 };
 
 #endif
 
--- a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
@@ -497,29 +497,29 @@ nsXFormsItemCheckgroupAccessible::Native
   return nsIAccessibleRole::ROLE_CHECKBUTTON;
 }
 
 PRUint64
 nsXFormsItemCheckgroupAccessible::NativeState()
 {
   PRUint64 state = nsXFormsSelectableItemAccessible::NativeState();
 
-  if (IsItemSelected())
+  if (IsSelected())
     state |= states::CHECKED;
 
   return state;
 }
 
 NS_IMETHODIMP
 nsXFormsItemCheckgroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   if (aIndex != eAction_Click)
     return NS_ERROR_INVALID_ARG;
 
-  if (IsItemSelected())
+  if (IsSelected())
     aName.AssignLiteral("uncheck");
   else
     aName.AssignLiteral("check");
 
   return NS_OK;
 }
 
 
@@ -539,17 +539,17 @@ nsXFormsItemRadiogroupAccessible::Native
   return nsIAccessibleRole::ROLE_RADIOBUTTON;
 }
 
 PRUint64
 nsXFormsItemRadiogroupAccessible::NativeState()
 {
   PRUint64 state = nsXFormsSelectableItemAccessible::NativeState();
 
-  if (IsItemSelected())
+  if (IsSelected())
     state |= states::CHECKED;
 
   return state;
 }
 
 NS_IMETHODIMP
 nsXFormsItemRadiogroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
@@ -622,17 +622,17 @@ PRUint64
 nsXFormsItemComboboxAccessible::NativeState()
 {
   PRUint64 state = nsXFormsSelectableItemAccessible::NativeState();
 
   if (state & states::UNAVAILABLE)
     return state;
 
   state |= states::SELECTABLE;
-  if (IsItemSelected())
+  if (IsSelected())
     state |= states::SELECTED;
 
   return state;
 }
 
 NS_IMETHODIMP
 nsXFormsItemComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
--- a/accessible/src/xul/nsXULListboxAccessible.cpp
+++ b/accessible/src/xul/nsXULListboxAccessible.cpp
@@ -1020,17 +1020,17 @@ nsXULListCellAccessible::GetColumnIndex(
     return NS_ERROR_FAILURE;
 
   nsAccessible* row = GetParent();
   if (!row)
     return NS_OK;
 
   *aColumnIndex = 0;
 
-  PRInt32 indexInRow = GetIndexInParent();
+  PRInt32 indexInRow = IndexInParent();
   for (PRInt32 idx = 0; idx < indexInRow; idx++) {
     nsAccessible* cell = row->GetChildAt(idx);
     PRUint32 role = cell->Role();
     if (role == nsIAccessibleRole::ROLE_CELL ||
         role == nsIAccessibleRole::ROLE_GRID_CELL ||
         role == nsIAccessibleRole::ROLE_ROWHEADER ||
         role == nsIAccessibleRole::ROLE_COLUMNHEADER)
       (*aColumnIndex)++;
@@ -1053,17 +1053,17 @@ nsXULListCellAccessible::GetRowIndex(PRI
     return NS_OK;
 
   nsAccessible* table = row->GetParent();
   if (!table)
     return NS_OK;
 
   *aRowIndex = 0;
 
-  PRInt32 indexInTable = row->GetIndexInParent();
+  PRInt32 indexInTable = row->IndexInParent();
   for (PRInt32 idx = 0; idx < indexInTable; idx++) {
     row = table->GetChildAt(idx);
     if (row->Role() == nsIAccessibleRole::ROLE_ROW)
       (*aRowIndex)++;
   }
 
   return NS_OK;
 }
--- a/accessible/src/xul/nsXULTextAccessible.cpp
+++ b/accessible/src/xul/nsXULTextAccessible.cpp
@@ -220,45 +220,45 @@ nsXULLinkAccessible::DoAction(PRUint8 aI
   DoCommand();
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULLinkAccessible: HyperLinkAccessible
 
 bool
-nsXULLinkAccessible::IsHyperLink()
+nsXULLinkAccessible::IsLink()
 {
   // Expose HyperLinkAccessible unconditionally.
   return true;
 }
 
 PRUint32
 nsXULLinkAccessible::StartOffset()
 {
   // If XUL link accessible is not contained by hypertext accessible then
   // start offset matches index in parent because the parent doesn't contains
   // a text.
   // XXX: accessible parent of XUL link accessible should be a hypertext
   // accessible.
-  if (nsAccessible::IsHyperLink())
+  if (nsAccessible::IsLink())
     return nsAccessible::StartOffset();
-  return GetIndexInParent();
+  return IndexInParent();
 }
 
 PRUint32
 nsXULLinkAccessible::EndOffset()
 {
-  if (nsAccessible::IsHyperLink())
+  if (nsAccessible::IsLink())
     return nsAccessible::EndOffset();
-  return GetIndexInParent() + 1;
+  return IndexInParent() + 1;
 }
 
 already_AddRefed<nsIURI>
-nsXULLinkAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsXULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
 {
   if (aAnchorIndex != 0)
     return nsnull;
 
   nsAutoString href;
   mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::href, href);
 
   nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
--- a/accessible/src/xul/nsXULTextAccessible.h
+++ b/accessible/src/xul/nsXULTextAccessible.h
@@ -92,19 +92,19 @@ public:
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessible
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual PRUint32 NativeRole();
   virtual PRUint64 NativeState();
 
   // HyperLinkAccessible
-  virtual bool IsHyperLink();
+  virtual bool IsLink();
   virtual PRUint32 StartOffset();
   virtual PRUint32 EndOffset();
-  virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+  virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
 
 protected:
   enum { eAction_Jump = 0 };
 
 };
 
 #endif  
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeAccessible.cpp
@@ -223,18 +223,18 @@ nsXULTreeAccessible::GetFocusedChild(nsI
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessible implementation (DON'T put methods here)
 
 nsAccessible*
-nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                     EWhichChildAtPoint aWhichChild)
+nsXULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                  EWhichChildAtPoint aWhichChild)
 {
   nsIFrame *frame = GetFrame();
   if (!frame)
     return nsnull;
 
   nsPresContext *presContext = frame->PresContext();
   nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
 
@@ -250,17 +250,17 @@ nsXULTreeAccessible::GetChildAtPoint(PRI
   nsCOMPtr<nsITreeColumn> column;
   nsCAutoString childEltUnused;
   mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
                    childEltUnused);
 
   // If we failed to find tree cell for the given point then it might be
   // tree columns.
   if (row == -1 || !column)
-    return nsAccessibleWrap::GetChildAtPoint(aX, aY, aWhichChild);
+    return nsAccessibleWrap::ChildAtPoint(aX, aY, aWhichChild);
 
   nsAccessible *child = GetTreeItemAccessible(row);
   if (aWhichChild == eDeepestChild && child) {
     // Look for accessible cell for the found item accessible.
     nsRefPtr<nsXULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
 
     nsAccessible *cell = treeitem->GetCellAccessible(column);
     if (cell)
@@ -632,19 +632,36 @@ nsXULTreeItemAccessibleBase::
   mTree(aTree), mTreeView(aTreeView), mRow(aRow)
 {
   mParent = aParent;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessibleBase: nsISupports implementation
 
-NS_IMPL_ISUPPORTS_INHERITED1(nsXULTreeItemAccessibleBase,
-                             nsAccessible,
-                             nsXULTreeItemAccessibleBase)
+NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeItemAccessibleBase)
+
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeItemAccessibleBase,
+                                                  nsAccessible)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTree)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTreeView)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeItemAccessibleBase,
+                                                nsAccessible)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTree)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTreeView)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+
+NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULTreeItemAccessibleBase)
+  NS_INTERFACE_TABLE_INHERITED1(nsXULTreeItemAccessibleBase,
+                                nsXULTreeItemAccessibleBase)
+NS_INTERFACE_TABLE_TAIL_INHERITING(nsAccessible)
+NS_IMPL_ADDREF_INHERITED(nsXULTreeItemAccessibleBase, nsAccessible)
+NS_IMPL_RELEASE_INHERITED(nsXULTreeItemAccessibleBase, nsAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessibleBase: nsIAccessible implementation
 
 NS_IMETHODIMP
 nsXULTreeItemAccessibleBase::GetFocusedChild(nsIAccessible **aFocusedChild) 
 {
   NS_ENSURE_ARG_POINTER(aFocusedChild);
@@ -964,19 +981,19 @@ nsXULTreeItemAccessibleBase::NativeState
   mTree->GetLastVisibleRow(&lastVisibleRow);
   if (mRow < firstVisibleRow || mRow > lastVisibleRow)
     state |= states::INVISIBLE;
 
   return state;
 }
 
 PRInt32
-nsXULTreeItemAccessibleBase::GetIndexInParent() const
+nsXULTreeItemAccessibleBase::IndexInParent() const
 {
-  return mParent ? mParent->GetCachedChildCount() + mRow : -1;
+  return mParent ? mParent->ContentChildCount() + mRow : -1;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessibleBase: nsAccessible protected methods
 
 void
 nsXULTreeItemAccessibleBase::DispatchClickEvent(nsIContent *aContent,
                                                 PRUint32 aActionIndex)
@@ -1003,29 +1020,22 @@ nsXULTreeItemAccessibleBase::DispatchCli
   }
 
   if (column)
     nsCoreUtils::DispatchClickEvent(mTree, mRow, column, pseudoElm);
 }
 
 nsAccessible*
 nsXULTreeItemAccessibleBase::GetSiblingAtOffset(PRInt32 aOffset,
-                                                nsresult* aError)
+                                                nsresult* aError) const
 {
-  if (IsDefunct()) {
-    if (aError)
-      *aError = NS_ERROR_FAILURE;
-
-    return nsnull;
-  }
-
   if (aError)
     *aError = NS_OK; // fail peacefully
 
-  return mParent->GetChildAt(GetIndexInParent() + aOffset);
+  return mParent->GetChildAt(IndexInParent() + aOffset);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessibleBase: protected implementation
 
 PRBool
 nsXULTreeItemAccessibleBase::IsExpandable()
 {
@@ -1045,51 +1055,78 @@ nsXULTreeItemAccessibleBase::IsExpandabl
           return PR_TRUE;
       }
     }
   }
 
   return PR_FALSE;
 }
 
+void
+nsXULTreeItemAccessibleBase::GetCellName(nsITreeColumn* aColumn,
+                                         nsAString& aName)
+{
+  mTreeView->GetCellText(mRow, aColumn, aName);
+
+  // If there is still no name try the cell value:
+  // This is for graphical cells. We need tree/table view implementors to
+  // implement FooView::GetCellValue to return a meaningful string for cases
+  // where there is something shown in the cell (non-text) such as a star icon;
+  // in which case GetCellValue for that cell would return "starred" or
+  // "flagged" for example.
+  if (aName.IsEmpty())
+    mTreeView->GetCellValue(mRow, aColumn, aName);
+}
+
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsXULTreeItemAccessible::
   nsXULTreeItemAccessible(nsIContent *aContent, nsIWeakReference *aShell,
                           nsAccessible *aParent, nsITreeBoxObject *aTree,
                           nsITreeView *aTreeView, PRInt32 aRow) :
   nsXULTreeItemAccessibleBase(aContent, aShell, aParent, aTree, aTreeView, aRow)
 {
   mColumn = nsCoreUtils::GetFirstSensibleColumn(mTree);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+// nsXULTreeItemAccessible: nsISupports implementation
+
+NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeItemAccessible)
+
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeItemAccessible,
+                                                  nsXULTreeItemAccessibleBase)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mColumn)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeItemAccessible,
+                                                nsXULTreeItemAccessibleBase)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mColumn)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeItemAccessible)
+NS_INTERFACE_MAP_END_INHERITING(nsXULTreeItemAccessibleBase)
+NS_IMPL_ADDREF_INHERITED(nsXULTreeItemAccessible, nsXULTreeItemAccessibleBase)
+NS_IMPL_RELEASE_INHERITED(nsXULTreeItemAccessible, nsXULTreeItemAccessibleBase)
+
+////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessible: nsIAccessible implementation
 
 NS_IMETHODIMP
 nsXULTreeItemAccessible::GetName(nsAString& aName)
 {
   aName.Truncate();
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  mTreeView->GetCellText(mRow, mColumn, aName);
-
-  // If there is still no name try the cell value:
-  // This is for graphical cells. We need tree/table view implementors to implement
-  // FooView::GetCellValue to return a meaningful string for cases where there is
-  // something shown in the cell (non-text) such as a star icon; in which case
-  // GetCellValue for that cell would return "starred" or "flagged" for example.
-  if (aName.IsEmpty())
-    mTreeView->GetCellValue(mRow, mColumn, aName);
-
+  GetCellName(mColumn, aName);
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessible: nsAccessNode implementation
 
 bool
 nsXULTreeItemAccessible::IsDefunct() const
@@ -1167,40 +1204,33 @@ nsXULTreeItemAccessible::CacheChildren()
 nsXULTreeColumnsAccessible::
   nsXULTreeColumnsAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsXULColumnsAccessible(aContent, aShell)
 {
 }
 
 nsAccessible*
 nsXULTreeColumnsAccessible::GetSiblingAtOffset(PRInt32 aOffset,
-                                               nsresult* aError)
+                                               nsresult* aError) const
 {
   if (aOffset < 0)
     return nsXULColumnsAccessible::GetSiblingAtOffset(aOffset, aError);
 
-  if (IsDefunct()) {
-    if (aError)
-      *aError = NS_ERROR_FAILURE;
-
-    return nsnull;
-  }
-
   if (aError)
-    *aError = NS_OK; // fail peacefully
+    *aError =  NS_OK; // fail peacefully
 
   nsCOMPtr<nsITreeBoxObject> tree = nsCoreUtils::GetTreeBoxObject(mContent);
   if (tree) {
     nsCOMPtr<nsITreeView> treeView;
     tree->GetView(getter_AddRefs(treeView));
     if (treeView) {
       PRInt32 rowCount = 0;
       treeView->GetRowCount(&rowCount);
       if (rowCount > 0 && aOffset <= rowCount) {
-        nsRefPtr<nsXULTreeAccessible> treeAcc = do_QueryObject(mParent);
+        nsRefPtr<nsXULTreeAccessible> treeAcc = do_QueryObject(GetParent());
 
         if (treeAcc)
           return treeAcc->GetTreeItemAccessible(aOffset - 1);
       }
     }
   }
 
   return nsnull;
--- a/accessible/src/xul/nsXULTreeAccessible.h
+++ b/accessible/src/xul/nsXULTreeAccessible.h
@@ -61,17 +61,16 @@ const PRUint32 kDefaultTreeCacheSize = 2
   { 0xb8, 0xe1, 0x2c, 0x44, 0xb0, 0x41, 0x85, 0xe3 }    \
 }
 
 class nsXULTreeAccessible : public nsAccessibleWrap
 {
 public:
   using nsAccessible::GetChildCount;
   using nsAccessible::GetChildAt;
-  using nsAccessible::GetChildAtPoint;
 
   nsXULTreeAccessible(nsIContent *aContent, nsIWeakReference *aShell);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeAccessible,
                                            nsAccessible)
 
@@ -81,18 +80,18 @@ public:
 
   // nsAccessNode
   virtual bool IsDefunct() const;
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint32 NativeRole();
   virtual PRUint64 NativeState();
-  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                        EWhichChildAtPoint aWhichChild);
+  virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                     EWhichChildAtPoint aWhichChild);
 
   virtual nsAccessible* GetChildAt(PRUint32 aIndex);
   virtual PRInt32 GetChildCount();
 
   // SelectAccessible
   virtual bool IsSelect();
   virtual already_AddRefed<nsIArray> SelectedItems();
   virtual PRUint32 SelectedItemCount();
@@ -172,18 +171,20 @@ class nsXULTreeItemAccessibleBase : publ
 {
 public:
   using nsAccessible::GetParent;
 
   nsXULTreeItemAccessibleBase(nsIContent *aContent, nsIWeakReference *aShell,
                               nsAccessible *aParent, nsITreeBoxObject *aTree,
                               nsITreeView *aTreeView, PRInt32 aRow);
 
-  // nsISupports
+  // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeItemAccessibleBase,
+                                           nsAccessibleWrap)
 
   // nsIAccessible
   NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
 
   NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
                        PRInt32 *aWidth, PRInt32 *aHeight);
 
   NS_IMETHOD SetSelected(PRBool aSelect); 
@@ -202,17 +203,17 @@ public:
 
   // nsAccessNode
   virtual bool IsDefunct() const;
   virtual void Shutdown();
   virtual bool IsPrimaryForNode() const;
 
   // nsAccessible
   virtual PRUint64 NativeState();
-  virtual PRInt32 GetIndexInParent() const;
+  virtual PRInt32 IndexInParent() const;
 
   // nsXULTreeItemAccessibleBase
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
 
   /**
    * Return row index associated with the accessible.
    */
   PRInt32 GetRowIndex() const { return mRow; }
@@ -230,25 +231,30 @@ public:
   virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx) = 0;
 
 protected:
   enum { eAction_Click = 0, eAction_Expand = 1 };
 
   // nsAccessible
   virtual void DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex);
   virtual nsAccessible* GetSiblingAtOffset(PRInt32 aOffset,
-                                           nsresult *aError = nsnull);
+                                           nsresult *aError = nsnull) const;
 
   // nsXULTreeItemAccessibleBase
 
   /**
    * Return true if the tree item accessible is expandable (contains subrows).
    */
   PRBool IsExpandable();
 
+  /**
+   * Return name for cell at the given column.
+   */
+  void GetCellName(nsITreeColumn* aColumn, nsAString& aName);
+
   nsCOMPtr<nsITreeBoxObject> mTree;
   nsCOMPtr<nsITreeView> mTreeView;
   PRInt32 mRow;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsXULTreeItemAccessibleBase,
                               NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
 
@@ -258,16 +264,21 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsXULTreeI
  */
 class nsXULTreeItemAccessible : public nsXULTreeItemAccessibleBase
 {
 public:
   nsXULTreeItemAccessible(nsIContent *aContent, nsIWeakReference *aShell,
                           nsAccessible *aParent, nsITreeBoxObject *aTree,
                           nsITreeView *aTreeView, PRInt32 aRow);
 
+  // nsISupports and cycle collection
+  NS_DECL_ISUPPORTS_INHERITED
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeItemAccessible,
+                                           nsXULTreeItemAccessibleBase)
+
   NS_IMETHOD GetName(nsAString& aName);
 
   // nsAccessNode
   virtual bool IsDefunct() const;
   virtual PRBool Init();
   virtual void Shutdown();
 
   // nsAccessible
@@ -294,12 +305,12 @@ class nsXULTreeColumnsAccessible : publi
 {
 public:
   nsXULTreeColumnsAccessible(nsIContent *aContent, nsIWeakReference *aShell);
 
 protected:
 
   // nsAccessible
   virtual nsAccessible* GetSiblingAtOffset(PRInt32 aOffset,
-                                           nsresult *aError = nsnull);
+                                           nsresult *aError = nsnull) const;
 };
 
 #endif
--- a/accessible/src/xul/nsXULTreeGridAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeGridAccessible.cpp
@@ -623,22 +623,22 @@ nsXULTreeGridRowAccessible::
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridRowAccessible: nsISupports and cycle collection implementation
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeGridRowAccessible)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeGridRowAccessible,
-                                                  nsAccessible)
+                                                  nsXULTreeItemAccessibleBase)
 CycleCollectorTraverseCache(tmp->mAccessibleCache, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeGridRowAccessible,
-                                                nsAccessible)
+                                                nsXULTreeItemAccessibleBase)
 ClearCache(tmp->mAccessibleCache);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeGridRowAccessible)
 NS_INTERFACE_MAP_STATIC_AMBIGUOUS(nsXULTreeGridRowAccessible)
 NS_INTERFACE_MAP_END_INHERITING(nsXULTreeItemAccessibleBase)
 
 NS_IMPL_ADDREF_INHERITED(nsXULTreeGridRowAccessible,
@@ -660,19 +660,38 @@ nsXULTreeGridRowAccessible::Shutdown()
 // nsXULTreeGridRowAccessible: nsAccessible implementation
 
 PRUint32
 nsXULTreeGridRowAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_ROW;
 }
 
+NS_IMETHODIMP
+nsXULTreeGridRowAccessible::GetName(nsAString& aName)
+{
+  aName.Truncate();
+
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsITreeColumns> columns;
+  mTree->GetColumns(getter_AddRefs(columns));
+  if (columns) {
+    nsCOMPtr<nsITreeColumn> primaryColumn;
+    columns->GetPrimaryColumn(getter_AddRefs(primaryColumn));
+    if (primaryColumn)
+      GetCellName(primaryColumn, aName);
+  }
+  return NS_OK;
+}
+
 nsAccessible*
-nsXULTreeGridRowAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                            EWhichChildAtPoint aWhichChild)
+nsXULTreeGridRowAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                         EWhichChildAtPoint aWhichChild)
 {
   nsIFrame *frame = GetFrame();
   if (!frame)
     return nsnull;
 
   nsPresContext *presContext = frame->PresContext();
   nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
 
@@ -792,20 +811,39 @@ nsXULTreeGridCellAccessible(nsIContent *
   mTreeView(aTreeView), mRow(aRow), mColumn(aColumn)
 {
   mParent = aRowAcc;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridCellAccessible: nsISupports implementation
 
-NS_IMPL_ISUPPORTS_INHERITED2(nsXULTreeGridCellAccessible,
-                             nsLeafAccessible,
-                             nsIAccessibleTableCell,
-                             nsXULTreeGridCellAccessible)
+NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTreeGridCellAccessible)
+
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXULTreeGridCellAccessible,
+                                                  nsLeafAccessible)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTree)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTreeView)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mColumn)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeGridCellAccessible,
+                                                nsLeafAccessible)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTree)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTreeView)
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mColumn)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+
+NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULTreeGridCellAccessible)
+  NS_INTERFACE_TABLE_INHERITED2(nsXULTreeGridCellAccessible,
+                                nsIAccessibleTableCell,
+                                nsXULTreeGridCellAccessible)
+NS_INTERFACE_TABLE_TAIL_INHERITING(nsLeafAccessible)
+NS_IMPL_ADDREF_INHERITED(nsXULTreeGridCellAccessible, nsLeafAccessible)
+NS_IMPL_RELEASE_INHERITED(nsXULTreeGridCellAccessible, nsLeafAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridCellAccessible: nsIAccessible implementation
 
 NS_IMETHODIMP
 nsXULTreeGridCellAccessible::GetFocusedChild(nsIAccessible **aFocusedChild) 
 {
   NS_ENSURE_ARG_POINTER(aFocusedChild);
@@ -1187,17 +1225,17 @@ nsXULTreeGridCellAccessible::NativeState
     if (checked.EqualsIgnoreCase("true"))
       states |= states::CHECKED;
   }
 
   return states;
 }
 
 PRInt32
-nsXULTreeGridCellAccessible::GetIndexInParent() const
+nsXULTreeGridCellAccessible::IndexInParent() const
 {
   return GetColumnIndex();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridCellAccessible: public implementation
 
 PRInt32
@@ -1239,27 +1277,20 @@ nsXULTreeGridCellAccessible::CellInvalid
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridCellAccessible: nsAccessible protected implementation
 
 nsAccessible*
 nsXULTreeGridCellAccessible::GetSiblingAtOffset(PRInt32 aOffset,
-                                                nsresult* aError)
+                                                nsresult* aError) const
 {
-  if (IsDefunct()) {
-    if (aError)
-      *aError = NS_ERROR_FAILURE;
-
-    return nsnull;
-  }
-
   if (aError)
-    *aError = NS_OK; // fail peacefully
+    *aError =  NS_OK; // fail peacefully
 
   nsCOMPtr<nsITreeColumn> columnAtOffset(mColumn), column;
   if (aOffset < 0) {
     for (PRInt32 index = aOffset; index < 0 && columnAtOffset; index++) {
       column = nsCoreUtils::GetPreviousSensibleColumn(columnAtOffset);
       column.swap(columnAtOffset);
     }
   } else {
@@ -1267,18 +1298,17 @@ nsXULTreeGridCellAccessible::GetSiblingA
       column = nsCoreUtils::GetNextSensibleColumn(columnAtOffset);
       column.swap(columnAtOffset);
     }
   }
 
   if (!columnAtOffset)
     return nsnull;
 
-  nsRefPtr<nsXULTreeItemAccessibleBase> rowAcc = do_QueryObject(mParent);
-
+  nsRefPtr<nsXULTreeItemAccessibleBase> rowAcc = do_QueryObject(GetParent());
   return rowAcc->GetCellAccessible(columnAtOffset);
 }
 
 void
 nsXULTreeGridCellAccessible::DispatchClickEvent(nsIContent *aContent,
                                                 PRUint32 aActionIndex)
 {
   if (IsDefunct())
--- a/accessible/src/xul/nsXULTreeGridAccessible.h
+++ b/accessible/src/xul/nsXULTreeGridAccessible.h
@@ -72,34 +72,34 @@ protected:
  * Represents accessible for XUL tree item in the case when XUL tree has
  * multiple columns.
  */
 class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
 {
 public:
   using nsAccessible::GetChildCount;
   using nsAccessible::GetChildAt;
-  using nsAccessible::GetChildAtPoint;
 
   nsXULTreeGridRowAccessible(nsIContent *aContent, nsIWeakReference *aShell,
                              nsAccessible *aParent, nsITreeBoxObject *aTree,
                              nsITreeView *aTreeView, PRInt32 aRow);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeGridRowAccessible,
-                                           nsAccessible)
+                                           nsXULTreeItemAccessibleBase)
 
   // nsAccessNode
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint32 NativeRole();
-  virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
-                                        EWhichChildAtPoint aWhichChild);
+  NS_IMETHOD GetName(nsAString& aName);
+  virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+                                     EWhichChildAtPoint aWhichChild);
 
   virtual nsAccessible* GetChildAt(PRUint32 aIndex);
   virtual PRInt32 GetChildCount();
 
   // nsXULTreeItemAccessibleBase
   virtual nsAccessible* GetCellAccessible(nsITreeColumn *aColumn);
   virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx);
 
@@ -134,16 +134,18 @@ public:
 
   nsXULTreeGridCellAccessible(nsIContent *aContent, nsIWeakReference *aShell,
                               nsXULTreeGridRowAccessible *aRowAcc,
                               nsITreeBoxObject *aTree, nsITreeView *aTreeView,
                               PRInt32 aRow, nsITreeColumn* aColumn);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeGridCellAccessible,
+                                           nsLeafAccessible)
 
   // nsIAccessible
   NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
 
   NS_IMETHOD GetName(nsAString& aName);
   NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
                        PRInt32 *aWidth, PRInt32 *aHeight);
 
@@ -158,17 +160,17 @@ public:
   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;
+  virtual PRInt32 IndexInParent() const;
 
   // nsXULTreeGridCellAccessible
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
 
   /**
    * Return index of the column.
    */
   PRInt32 GetColumnIndex() const;
@@ -177,17 +179,17 @@ public:
    * Fire name or state change event if the accessible text or value has been
    * changed.
    */
   void CellInvalidated();
 
 protected:
   // nsAccessible
   virtual nsAccessible* GetSiblingAtOffset(PRInt32 aOffset,
-                                           nsresult *aError = nsnull);
+                                           nsresult *aError = nsnull) const;
   virtual void DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex);
 
   // nsXULTreeGridCellAccessible
 
   /**
    * Return true if value of cell can be modified.
    */
   PRBool IsEditable() const;
--- a/accessible/tests/mochitest/attributes/test_obj.html
+++ b/accessible/tests/mochitest/attributes/test_obj.html
@@ -48,38 +48,41 @@ https://bugzilla.mozilla.org/show_bug.cg
       // ARIA
       testAttrs("live", {"live" : "polite"}, true);
       testAttrs("live2", {"live" : "polite"}, true);
       testAbsentAttrs("live3", {"live" : ""});
       testAttrs("log", {"live" : "polite"}, true);
       testAttrs("logAssertive", {"live" : "assertive"}, true);
       testAttrs("marquee", {"live" : "off"}, true);
       testAttrs("status", {"live" : "polite"}, true);
+      testAttrs("tablist", {"live" : "polite"}, true);
       testAttrs("timer", {"live" : "off"}, true);
 
       // container-live object attribute
       testAttrs("liveChild", {"container-live" : "polite"}, true);
       testAttrs("live2Child", {"container-live" : "polite"}, true);
       testAttrs("logChild", {"container-live" : "polite"}, true);
       testAttrs("logAssertiveChild", {"container-live" : "assertive"}, true);
       testAttrs("marqueeChild", {"container-live" : "off"}, true);
       testAttrs("statusChild", {"container-live" : "polite"}, true);
+      testAttrs("tablistChild", {"container-live" : "polite"}, true);
       testAttrs("timerChild", {"container-live" : "off"}, true);
 
       // container-live-role object attribute
       testAttrs("log", {"container-live-role" : "log"}, true);
       testAttrs("logAssertive", {"container-live-role" : "log"}, true);
       testAttrs("marquee", {"container-live-role" : "marquee"}, true);
       testAttrs("status", {"container-live-role" : "status"}, true);
       testAttrs("timer", {"container-live-role" : "timer"}, true);
       testAttrs("logChild", {"container-live-role" : "log"}, true);
       testAttrs("logAssertive", {"container-live-role" : "log"}, true);
       testAttrs("logAssertiveChild", {"container-live-role" : "log"}, true);
       testAttrs("marqueeChild", {"container-live-role" : "marquee"}, true);
       testAttrs("statusChild", {"container-live-role" : "status"}, true);
+      testAttrs("tablistChild", {"container-live-role" : "tablist"}, true);
       testAttrs("timerChild", {"container-live-role" : "timer"}, true);
 
       // absent aria-label and aria-labelledby object attribute
       testAbsentAttrs("label", {"label" : "foo"});
       testAbsentAttrs("labelledby", {"labelledby" : "label"});
 
       // container that has no default live attribute
       testAttrs("liveGroup", {"live" : "polite"}, true);
@@ -115,17 +118,21 @@ https://bugzilla.mozilla.org/show_bug.cg
      title="Make explicit that aria-label is not an object attribute">
     Mozilla Bug 475006
   </a>
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
      title="make HTML <output> accessible">
     Mozilla Bug 558036
   </a>
-
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=663136"
+     title="Add test coverage for tablist as implicit live region">
+    Mozilla Bug 663136
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <!-- aria -->
   <div id="atomic" aria-atomic="true"></div>
   <div id="autocomplete" role="textbox" aria-autocomplete="true"></div>
@@ -149,16 +156,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <!-- back to aria -->
   <div id="live" aria-live="polite">excuse <div id="liveChild">me</div></div>
   <div id="live2" role="marquee" aria-live="polite">excuse <div id="live2Child">me</div></div>
   <div id="live3" role="region">excuse</div>
   <div id="log" role="log">excuse <div id="logChild">me</div></div>
   <div id="logAssertive" role="log" aria-live="assertive">excuse <div id="logAssertiveChild">me</div></div>
   <div id="marquee" role="marquee">excuse <div id="marqueeChild">me</div></div>
   <div id="status" role="status">excuse <div id="statusChild">me</div></div>
+  <div id="tablist" role="tablist">tablist <div id="tablistChild">tab</div></div>
   <div id="timer" role="timer">excuse <div id="timerChild">me</div></div>
 
   <!-- aria-label[ledby] should not be an object attribute -->
   <div id="label" role="checkbox" aria-label="foo"></div>
   <div id="labelledby" role="checkbox" aria-labelledby="label"></div>
 
   <!-- unusual live case -->
   <div id="liveGroup" role="group" aria-live="polite">
--- a/accessible/tests/mochitest/name/Makefile.in
+++ b/accessible/tests/mochitest/name/Makefile.in
@@ -52,13 +52,14 @@ include $(topsrcdir)/config/rules.mk
 		nsRootAcc_wnd.xul \
 		test_button.html \
 		test_general.html \
 		test_general.xul \
 		test_link.html \
 		test_list.html \
 		test_markup.html \
 		test_nsRootAcc.xul \
+		test_tree.xul \
 		markuprules.xml \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
--- a/accessible/tests/mochitest/name/markup.js
+++ b/accessible/tests/mochitest/name/markup.js
@@ -2,17 +2,16 @@
 // Name tests described by "markuprules.xml" file.
 
 var gNameRulesFileURL = "markuprules.xml";
 
 var gRuleDoc = null;
 
 // Debuggin stuff.
 var gDumpToConsole = false;
-gA11yEventDumpToConsole = gDumpToConsole;
 
 /**
  * Start name tests. Run through markup elements and test names for test
  * element (see namerules.xml for details).
  */
 function testNames()
 {
   var request = new XMLHttpRequest();
@@ -144,17 +143,17 @@ function testNameForRule(aElm, aRuleElm)
 {
   if (aRuleElm.hasAttribute("attr")) {
     if (gDumpToConsole) {
       dump("\nProcessing rule { attr: " + aRuleElm.getAttribute("attr") +" }\n");
     }
 
     testNameForAttrRule(aElm, aRuleElm);
 
-  } else if (aRuleElm.hasAttribute("elm") && aRuleElm.hasAttribute("elmattr")) {
+  } else if (aRuleElm.hasAttribute("elm")) {
     if (gDumpToConsole) {
       dump("\nProcessing rule { elm: " + aRuleElm.getAttribute("elm") +
            ", elmattr: " + aRuleElm.getAttribute("elmattr") +" }\n");
     }
 
     testNameForElmRule(aElm, aRuleElm);
 
   } else if (aRuleElm.getAttribute("fromsubtree") == "true") {
@@ -173,17 +172,17 @@ function testNameForAttrRule(aElm, aRule
 
   var attr = aRule.getAttribute("attr");
   var attrValue = aElm.getAttribute(attr);
 
   var type = aRule.getAttribute("type");
   if (type == "string") {
     name = attrValue;
 
-  } else if (type == "ref") {
+  } else if (type == "ref" && attrValue) {
     var ids = attrValue.split(/\s+/);
     for (var idx = 0; idx < ids.length; idx++) {
       var labelElm = getNode(ids[idx]);
       if (name != "")
         name += " ";
 
       name += labelElm.getAttribute("a11yname");
     }
@@ -192,47 +191,63 @@ function testNameForAttrRule(aElm, aRule
   var msg = "Attribute '" + attr + "' test. ";
   testName(aElm, name, msg);
   aElm.removeAttribute(attr);
 
   gTestIterator.iterateNext();
 }
 
 function testNameForElmRule(aElm, aRule)
-{  
-  var elm = aRule.getAttribute("elm");
-  var elmattr = aRule.getAttribute("elmattr");
+{
+  var labelElm;
 
-  var filter = {
-    acceptNode: function filter_acceptNode(aNode)
-    {
-      if (aNode.localName == this.mLocalName &&
-          aNode.getAttribute(this.mAttrName) == this.mAttrValue)
-        return NodeFilter.FILTER_ACCEPT;
+  var tagname = aRule.getAttribute("elm");
+  var attrname = aRule.getAttribute("elmattr");
+  if (attrname) {
+    var filter = {
+      acceptNode: function filter_acceptNode(aNode)
+      {
+        if (aNode.localName == this.mLocalName &&
+            aNode.getAttribute(this.mAttrName) == this.mAttrValue)
+          return NodeFilter.FILTER_ACCEPT;
+
+        return NodeFilter.FILTER_SKIP;
+      },
 
-      return NodeFilter.FILTER_SKIP;
-    },
+      mLocalName: tagname,
+      mAttrName: attrname,
+      mAttrValue: aElm.getAttribute("id")
+    };
+
+    var treeWalker = document.createTreeWalker(document.body,
+                                               NodeFilter.SHOW_ELEMENT,
+                                               filter, false);
+    labelElm = treeWalker.nextNode();
 
-    mLocalName: elm,
-    mAttrName: elmattr,
-    mAttrValue: aElm.getAttribute("id")
-  };
+  } else {
+    // if attrname is empty then look for the element in subtree.
+    labelElm = aElm.getElementsByTagName(tagname)[0];
+    if (!labelElm)
+      labelElm = aElm.getElementsByTagName("html:" + tagname)[0];
+  }
 
-  var treeWalker = document.createTreeWalker(document.body,
-                                             NodeFilter.SHOW_ELEMENT,
-                                             filter, false);
-  var labelElm = treeWalker.nextNode();
-  var msg = "Element '" + elm + "' test.";
+  if (!labelElm) {
+    ok(false, msg + " Failed to find '" + tagname + "' element.");
+    gTestIterator.iterateNext();
+    return;
+  }
+
+  var msg = "Element '" + tagname + "' test.";
   testName(aElm, labelElm.getAttribute("a11yname"), msg);
 
   var parentNode = labelElm.parentNode;
 
   if (gDumpToConsole) {
     dump("\nProcessed elm rule. Wait for reorder event on " +
-         prettyName(parentNode) + "'\n");
+         prettyName(parentNode) + "\n");
   }
   waitForEvent(EVENT_REORDER, parentNode,
                gTestIterator.iterateNext, gTestIterator);
 
   parentNode.removeChild(labelElm);
 }
 
 function testNameForSubtreeRule(aElm, aRule)
--- a/accessible/tests/mochitest/name/markuprules.xml
+++ b/accessible/tests/mochitest/name/markuprules.xml
@@ -1,36 +1,55 @@
 <?xml version="1.0"?>
 
 <!--
- This XML file is used to create sequence of accessible name tests. It consist of
- two sections. The first section 'ruledfn' declares name computation rules.
- The second section 'rulesample' defines markup samples we need to check name
- computation rules for.
+  This XML file is used to create sequence of accessible name tests. It consist
+  of two sections. The first section 'ruledfn' declares name computation rules.
+  The second section 'rulesample' defines markup samples we need to check name
+  computation rules for.
 
-  Section 'ruledfn' consist of 'ruleset' elements. Every 'ruleset' element is
+  <ruledfn>
+    <ruleset>
+      <rule>
+
+  Section 'ruledfn' contains 'ruleset' elements. Every 'ruleset' element is
   presented by 'rule' elements so that sequence of 'rule' elements gives the
   sequence of name computations rules. Every 'rule' element can be one of four
   types.
-   * name is equal to the value of attribute presented on the element. Example,
-     'aria-label' attribute. In this case 'rule' element has 'attr' attribute
-     pointing to attribute name and 'type' attribute with 'string' value. For
-     example, <rule attr="aria-label" type="string"/>.
-   * name is calculated from elements that are pointed to by attribute value on
-     the element. Example is 'aria-labelledby'. In this case 'rule' element
-     has 'attr' attribute holding the sequence of IDs of elements used to
-     compute the name, in addition the 'rule' element has 'type' attribute with
-     'ref' value. For example, <rule attr="aria-labelledby" type="ref"/>.
-   * name is calculated from another element. Example, html:label@for element.
-     In this case 'rule' element has 'elm' and 'elmattr' attributes. These
-     attributes are used to find an element by tagname and attribute with value
-     equaled to ID of the element. For example, <rule elm="label" elmattr="for"/>.
-   * name is computed from subtree. Example, html:button. In this case 'rule'
-     element has 'fromsubtree' attribute with 'true' value. For example,
-     <rule fromsubtree="true"/>
+
+   * <rule attr='' type='string'/> used when name is equal to the value of
+     attribute presented on the element.
+
+     Example, 'aria-label' attribute. In this case 'rule' element has 'attr'
+     attribute pointing to attribute name and 'type' attribute with 'string'
+     value. For example, <rule attr="aria-label" type="string"/>.
+
+   * <rule attr='' type='ref'/> used when name is calculated from elements that
+     are pointed to by attribute value on the element.
+
+     Example is 'aria-labelledby'. In this case 'rule' element has 'attr'
+     attribute holding the sequence of IDs of elements used to compute the name,
+     in addition the 'rule' element has 'type' attribute with 'ref' value.
+     For example, <rule attr="aria-labelledby" type="ref"/>.
+
+   * <rule elm='' elmattr=''/> used when name is calculated from another
+     element. These attributes are used to find an element by tagname and
+     attribute with value equaled to ID of the element. If 'elmattr' is missed
+     then element from subtree with the given tagname is used.
+
+     Example, html:label@for element, <rule elm="label" elmattr="for"/>.
+     Example, html:caption element, <rule elm="caption"/>
+
+   * <rule fromsubtree='true'/> used when name is computed from subtree.
+
+     Example, html:button. In this case 'rule' element has 'fromsubtree'
+     attribute with 'true' value.
+
+  <rulesample>
+    <markup ruleset=''>
 
   Section 'rulesample' provides set of markup samples ('markup' elements). Every
   'markup' element contains an element that accessible name will be computed for
   (let's call it test element). In addition the 'markup' element contains some
   other elements from native markup used in name calculation process for test
   element. Test element is pointed to by 'ref' attribute on 'markup' element.
   Also 'markup' element has 'ruleset' attribute to indicate ruleset for the test
   element.
@@ -115,16 +134,22 @@
 
     <ruleset id="htmloption">
       <ruleset ref="aria"/>
       <rule attr="label" type="string"/>
       <rule fromsubtree="true"/>
       <rule attr="title" type="string"/>
     </ruleset>
 
+    <ruleset id="htmltable">
+      <ruleset ref="htmlelm_start"/>
+      <rule elm="caption"/>
+      <rule attr="summary" type="string"/>
+      <ruleset ref="htmlelm_end"/>
+    </ruleset>
   </ruledfn>
 
   <rulesample>
 
     <markup ref="html:button" ruleset="htmlctrl" id="markup1test">
       <html:span id="l1" a11yname="test2">test2</html:span>
       <html:span id="l2" a11yname="test3">test3</html:span>
       <html:label for="btn" a11yname="test4">test4</html:label>
@@ -205,11 +230,30 @@
               <html:li>Listitem1</html:li>
               <html:li>Listitem2</html:li>
             </html:ul>
           </html:td>
         </html:tr>
       </html:table>
     </markup>
 
+    <markup ref="html:table" ruleset="htmltable"
+            id="markup6test">
+      <html:span id="l1" a11yname="lby_tst6_1">lby_tst6_1</html:span>
+      <html:span id="l2" a11yname="lby_tst6_2">lby_tst6_2</html:span>
+      <html:label for="t" a11yname="label_tst6">label_tst6</html:label>
+      <!-- layout frame are recreated due to varous reasons, here's text frame
+          placed after caption frame triggres table frame recreation when
+          caption element is removed from DOM; get rid text node after caption
+          node to make the test working -->
+      <html:table id="t" aria-label="arialabel_tst6"
+                  aria-labelledby="l1 l2"
+                  summary="summary_tst6"
+                  title="title_tst6">
+        <html:caption a11yname="caption_tst6">caption_tst6</html:caption><html:tr>
+          <html:td>cell1</html:td>
+          <html:td>cell2</html:td>
+        </html:tr>
+      </html:table>
+    </markup>
   </rulesample>
 
 </rules>
--- a/accessible/tests/mochitest/name/test_markup.html
+++ b/accessible/tests/mochitest/name/test_markup.html
@@ -16,30 +16,38 @@
   <script type="application/javascript"
           src="../name.js"></script>
 
   <script type="application/javascript"
           src="markup.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpID = "eventdump";
+    //gDumpToConsole = true;
+    //gA11yEventDumpToConsole = true;
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(testNames);
   </script>
 
 </head>
 
 <body>
 
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=459635"
      title="nsIAccessible::name calculation for elements">
     Mozilla Bug 459635
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=666212"
+     title="summary attribute content mapped to accessible name in MSAA">
+    Mozilla Bug 666212
+  </a>
+
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <div id="eventdump"></div>
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/name/test_tree.xul
@@ -0,0 +1,200 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+<?xml-stylesheet href="general.css"
+                 type="text/css"?>
+
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="Accessibility Name Calculating Test.">
+
+  <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="../treeview.js" />
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../role.js"></script>
+  <script type="application/javascript"
+          src="../name.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+
+  <script type="application/javascript">
+  <![CDATA[
+    function treeTester(aID)
+    {
+      this.DOMNode = getNode(aID);
+
+      this.invoke = function treeTester_invoke()
+      {
+        this.DOMNode.treeBoxObject.view = new nsTreeTreeView();
+      }
+
+      this.check = function treeTester_check(aEvent)
+      {
+        var tree = {
+          role: ROLE_OUTLINE,
+          children: [
+            {
+              role: ROLE_LIST
+            },
+            {
+              role: ROLE_OUTLINEITEM,
+              children: [],
+              name: "row1col"
+            },
+            {
+              role: ROLE_OUTLINEITEM,
+              children: [],
+              name: "row2_col"
+            },
+            {
+              role: ROLE_OUTLINEITEM,
+              children: [],
+              name: "row2.1_col"
+            },
+            {
+              role: ROLE_OUTLINEITEM,
+              children: [],
+              name: "row2.2_col"
+            },
+            {
+              role: ROLE_OUTLINEITEM,
+              children: [],
+              name: "row3_col"
+            },
+            {
+              role: ROLE_OUTLINEITEM,
+              children: [],
+              name: "row4col"
+            }
+          ]
+        };
+        testAccessibleTree(this.DOMNode, tree);
+      }
+
+      this.getID = function treeTester_getID()
+      {
+        return "Tree name testing for " + aID;
+      }
+    }
+
+    function tableTester(aID)
+    {
+      this.DOMNode = getNode(aID);
+
+      this.invoke = function tableTester_invoke()
+      {
+        this.DOMNode.treeBoxObject.view = new nsTableTreeView(2);
+      }
+
+      this.check = function tableTester_check(aEvent)
+      {
+        var tree = {
+          role: ROLE_TREE_TABLE,
+          children: [
+            {
+              role: ROLE_LIST
+            },
+            {
+              role: ROLE_ROW,
+              children: [
+                {
+                  role: ROLE_GRID_CELL,
+                  children: [],
+                  name: "row0_col1"
+                },
+                {
+                  role: ROLE_GRID_CELL,
+                  children: [],
+                  name: "row0_col2"
+                }
+              ],
+              name: "row0_col1"
+            },
+            {
+              role: ROLE_ROW,
+              children: [
+                {
+                  role: ROLE_GRID_CELL,
+                  children: [],
+                  name: "row1_col1"
+                },
+                {
+                  role: ROLE_GRID_CELL,
+                  children: [],
+                  name: "row1_col2"
+                }
+              ],
+              name: "row1_col1"
+            }
+          ]
+        };
+        testAccessibleTree(this.DOMNode, tree);
+      }
+
+      this.getID = function tableTester_getID()
+      {
+        return "Tree name testing for " + aID;
+      }
+    }
+
+    var gQueue = null;
+    function doTest()
+    {
+      var gQueue = new eventQueue(EVENT_REORDER);
+
+      gQueue.push(new treeTester("tree"));
+      gQueue.push(new tableTester("table"));
+
+      gQueue.invoke(); // Will call SimpleTest.finish()
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  ]]>
+  </script>
+
+  <hbox flex="1" style="overflow: auto;">
+
+  <body xmlns="http://www.w3.org/1999/xhtml">
+    <a target="_blank"
+       href="https://bugzilla.mozilla.org/show_bug.cgi?id=546812"
+       title="Treegrid row accessible shouldn't inherit name from tree accessible">
+      Mozilla Bug 546812
+    </a>
+  <p id="display"></p>
+    <div id="content" style="display: none">
+    </div>
+    <pre id="test">
+    </pre>
+  </body>
+
+  <vbox flex="1">
+
+  <tree id="tree" flex="1">
+    <treecols>
+      <treecol id="col" flex="1" primary="true" label="column"/>
+    </treecols>
+    <treechildren/>
+  </tree>
+
+  <tree id="table" flex="1">
+    <treecols>
+      <treecol id="col1" flex="1" label="column" primary="true"/>
+      <treecol id="col2" flex="1" label="column 2"/>
+    </treecols>
+    <treechildren/>
+  </tree>
+
+  </vbox> <!-- close tests area -->
+  </hbox> <!-- close main area -->
+</window>
+
--- a/accessible/tests/mochitest/test_descr.html
+++ b/accessible/tests/mochitest/test_descr.html
@@ -33,38 +33,65 @@
 
       // Description from @title attribute, name is generated from @alt
       // attribute.
       testDescr("img3", "description");
 
       // Description from content of h2.
       testDescr("p", "heading");
 
+      // From table summary (caption is used as a name)
+      testDescr("table1", "summary");
+
+      // Empty (summary is used as a name)
+      testDescr("table2", "");
+
+      // From title (summary is used as a name)
+      testDescr("table3", "title");
+
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 
 </head>
 
 <body>
 
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=489944"
      title="@title attribute no longer exposed on accDescription">
     Mozilla Bug 489944
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=666212"
+     title="summary attribute content mapped to accessible name in MSAA">
+    Mozilla Bug 666212
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <p id="description">aria description</p>
   <img id="img1" aria-describedby="description" />
   <img id="img2" title="title" />
   <img id="img3" alt="name" title="description" />
 
   <h2 id="heading">heading</h2>
   <p id="p" aria-describedby="heading" role="button">click me</p>
+
+  <table id="table1" summary="summary">
+    <caption>caption</caption>
+    <tr><td>cell</td></tr>
+  </table>
+
+  <table id="table2" summary="summary">
+    <tr><td>cell</td></tr>
+  </table>
+
+  <table id="table3" summary="summary" title="title">
+    <tr><td>cell</td></tr>
+  </table>
 </body>
 </html>
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -18,16 +18,17 @@
 # Portions created by the Initial Developer are Copyright (C) 2001
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #  Brian Ryner <bryner@brianryner.com>
 #  Jonathan Wilson <jonwil@tpgi.com.au>
 #  Dan Mosedale <dmose@mozilla.org>
 #  Benjamin Smedberg <benjamin@smedbergs.us>
+#  Jared Wein <jwein@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -86,45 +87,32 @@ endif
 
 LIBS += $(JEMALLOC_LIBS)
 
 ifdef LIBXUL_SDK
 include $(topsrcdir)/config/rules.mk
 else
 # Build a binary bootstrapping with XRE_main
 
-ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
-else
-PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
-endif
 
 CPPSRCS = nsBrowserApp.cpp
 
 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
+LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build
 
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-LIBS += $(DIST)/bin/XUL
-TK_LIBS := $(TK_LIBS)
-else
-EXTRA_DSO_LIBS += xul
-endif
+DEFINES += -DXPCOM_GLUE
+STL_FLAGS=
 
 LIBS += \
-	$(STATIC_COMPONENTS_LINKER_PATH) \
 	$(EXTRA_DSO_LIBS) \
-	$(XPCOM_GLUE_LDOPTS) \
-	$(NSPR_LIBS) \
+	$(XPCOM_STANDALONE_GLUE_LDOPTS) \
 	$(NULL)
 
-ifdef MOZ_JPROF
-LIBS += -ljprof
-endif
-
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
 MOZ_WINCONSOLE = 0
 endif
 endif
 
@@ -189,44 +177,34 @@ ifeq ($(OS_TEST),x86_64)
 # set stack to 2MB on x64 build.  See bug 582910
 LDFLAGS += -STACK:2097152
 endif
 endif
 endif
 
 ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
 
-$(MOZ_APP_NAME):: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS)
-	cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \
-		-e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@
-	chmod +x $@
+libs:: 
+	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 
-libs:: $(MOZ_APP_NAME)
-	$(INSTALL) $< $(DIST)/bin
-
-install:: $(MOZ_APP_NAME)
-	$(SYSINSTALL) $< $(DESTDIR)$(bindir)
-
-GARBAGE += $(MOZ_APP_NAME)
 GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, firefox.js)
 
 endif
 
 endif # LIBXUL_SDK
 
 DEFINES += -DFIREFOX_ICO=\"$(DIST)/branding/firefox.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\"
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DMOZILLA_OFFICIAL
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 libs::
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(DIST)/bin/icons
-	$(INSTALL) $(IFLAGS1) $(DIST)/branding/document.png   $(DIST)/bin/icons
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png  $(DIST)/bin/chrome/icons/default
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png  $(DIST)/bin/chrome/icons/default
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png  $(DIST)/bin/chrome/icons/default
 endif
 
 ifdef MOZ_SPLASHSCREEN
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 libs::
@@ -268,17 +246,17 @@ libs repackage:: $(PROGRAM) application.
 	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
 	$(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
 	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
 	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%LOWER_APP_NAME%/$(LOWER_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
 	sed -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
 	rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
 	$(RM) $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/mangle $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/shlibsign
 ifdef LIBXUL_SDK
-	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(APP_NAME).app/Contents/MacOS/firefox-bin
+	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(APP_NAME).app/Contents/MacOS/firefox
 else
 	$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
 	rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
 endif
 	-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
 	cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(APP_NAME).app/Contents/Resources/firefox.icns
 	cp -RL $(DIST)/branding/document.icns $(DIST)/$(APP_NAME).app/Contents/Resources/document.icns
 	printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
--- a/browser/app/macbuild/Contents/Info.plist.in
+++ b/browser/app/macbuild/Contents/Info.plist.in
@@ -138,17 +138,17 @@
 			</array>
 			<key>CFBundleTypeName</key>
 			<string>HTML5 Video (WebM)</string>
 			<key>CFBundleTypeRole</key>
 			<string>Viewer</string>
 		</dict>
 	</array>
 	<key>CFBundleExecutable</key>
-	<string>firefox-bin</string>
+	<string>firefox</string>
 	<key>CFBundleGetInfoString</key>
 	<string>%APP_NAME% %APP_VERSION%</string>
 	<key>CFBundleIconFile</key>
 	<string>firefox</string>
 	<key>CFBundleIdentifier</key>
 	<string>org.mozilla.%LOWER_APP_NAME%</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -31,39 +31,49 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+#include "nsXPCOMGlue.h"
 #include "nsXULAppAPI.h"
-#ifdef XP_WIN
+#if defined(XP_WIN)
 #include <windows.h>
 #include <stdlib.h>
+#elif defined(XP_UNIX)
+#include <sys/time.h>
+#include <sys/resource.h>
 #endif
 
 #include <stdio.h>
 #include <stdarg.h>
+#include <string.h>
 
 #include "plstr.h"
 #include "prprf.h"
 #include "prenv.h"
 
 #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
 // we want a wmain entry point
 #include "nsWindowsWMain.cpp"
+#define snprintf _snprintf
+#define strcasecmp _stricmp
 #endif
+#include "BinaryPath.h"
+
+#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
+
+#include "mozilla/Telemetry.h"
 
 static void Output(const char *fmt, ... )
 {
   va_list ap;
   va_start(ap, fmt);
 
 #if defined(XP_WIN) && !MOZ_WINCONSOLE
   PRUnichar msg[2048];
@@ -80,53 +90,79 @@ static void Output(const char *fmt, ... 
  * Return true if |arg| matches the given argument name.
  */
 static PRBool IsArg(const char* arg, const char* s)
 {
   if (*arg == '-')
   {
     if (*++arg == '-')
       ++arg;
-    return !PL_strcasecmp(arg, s);
+    return !strcasecmp(arg, s);
   }
 
 #if defined(XP_WIN) || defined(XP_OS2)
   if (*arg == '/')
-    return !PL_strcasecmp(++arg, s);
+    return !strcasecmp(++arg, s);
 #endif
 
   return PR_FALSE;
 }
 
 /**
  * A helper class which calls NS_LogInit/NS_LogTerm in its scope.
  */
 class ScopedLogging
 {
 public:
   ScopedLogging() { NS_LogInit(); }
   ~ScopedLogging() { NS_LogTerm(); }
 };
 
-int main(int argc, char* argv[])
-{
-  ScopedLogging log;
+XRE_GetFileFromPathType XRE_GetFileFromPath;
+XRE_CreateAppDataType XRE_CreateAppData;
+XRE_FreeAppDataType XRE_FreeAppData;
+#ifdef XRE_HAS_DLL_BLOCKLIST
+XRE_SetupDllBlocklistType XRE_SetupDllBlocklist;
+#endif
+XRE_TelemetryAccumulateType XRE_TelemetryAccumulate;
+XRE_mainType XRE_main;
 
+static const nsDynamicFunctionLoad kXULFuncs[] = {
+    { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
+    { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData },
+    { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData },
+#ifdef XRE_HAS_DLL_BLOCKLIST
+    { "XRE_SetupDllBlocklist", (NSFuncPtr*) &XRE_SetupDllBlocklist },
+#endif
+    { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate },
+    { "XRE_main", (NSFuncPtr*) &XRE_main },
+    { nsnull, nsnull }
+};
+
+static int do_main(const char *exePath, int argc, char* argv[])
+{
   nsCOMPtr<nsILocalFile> appini;
-  nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini));
+#ifdef XP_WIN
+  // exePath comes from mozilla::BinaryPath::Get, which returns a UTF-8
+  // encoded path, so it is safe to convert it
+  nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), PR_FALSE,
+                                getter_AddRefs(appini));
+#else
+  nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), PR_FALSE,
+                                      getter_AddRefs(appini));
+#endif
   if (NS_FAILED(rv)) {
-    Output("Couldn't calculate the application directory.");
     return 255;
   }
+
   appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini"));
 
   // Allow firefox.exe to launch XULRunner apps via -app <application.ini>
   // Note that -app must be the *first* argument.
-  char *appEnv = nsnull;
-  const char *appDataFile = PR_GetEnv("XUL_APP_FILE");
+  const char *appDataFile = getenv("XUL_APP_FILE");
   if (appDataFile && *appDataFile) {
     rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appini));
     if (NS_FAILED(rv)) {
       Output("Invalid path found: '%s'", appDataFile);
       return 255;
     }
   }
   else if (argc > 1 && IsArg(argv[1], "app")) {
@@ -136,28 +172,115 @@ int main(int argc, char* argv[])
     }
 
     rv = XRE_GetFileFromPath(argv[2], getter_AddRefs(appini));
     if (NS_FAILED(rv)) {
       Output("application.ini path not recognized: '%s'", argv[2]);
       return 255;
     }
 
-    appEnv = PR_smprintf("XUL_APP_FILE=%s", argv[2]);
-    PR_SetEnv(appEnv);
+    char appEnv[MAXPATHLEN];
+    snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", argv[2]);
+    if (putenv(appEnv)) {
+      Output("Couldn't set %s.\n", appEnv);
+      return 255;
+    }
     argv[2] = argv[0];
     argv += 2;
     argc -= 2;
   }
 
   nsXREAppData *appData;
   rv = XRE_CreateAppData(appini, &appData);
   if (NS_FAILED(rv)) {
     Output("Couldn't read application.ini");
     return 255;
   }
 
   int result = XRE_main(argc, argv, appData);
   XRE_FreeAppData(appData);
-  if (appEnv)
-    PR_smprintf_free(appEnv);
   return result;
 }
+
+int main(int argc, char* argv[])
+{
+  char exePath[MAXPATHLEN];
+
+  nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath);
+  if (NS_FAILED(rv)) {
+    Output("Couldn't calculate the application directory.\n");
+    return 255;
+  }
+
+  char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
+  if (!lastSlash || (lastSlash - exePath > MAXPATHLEN - sizeof(XPCOM_DLL) - 1))
+    return 255;
+
+  strcpy(++lastSlash, XPCOM_DLL);
+
+  int gotCounters;
+#if defined(XP_UNIX)
+  struct rusage initialRUsage;
+  gotCounters = !getrusage(RUSAGE_SELF, &initialRUsage);
+#elif defined(XP_WIN)
+  // GetProcessIoCounters().ReadOperationCount seems to have little to
+  // do with actual read operations. It reports 0 or 1 at this stage
+  // in the program. Luckily 1 coincides with when prefetch is
+  // enabled. If Windows prefetch didn't happen we can do our own
+  // faster dll preloading.
+  IO_COUNTERS ioCounters;
+  gotCounters = GetProcessIoCounters(GetCurrentProcess(), &ioCounters);
+  if (gotCounters && !ioCounters.ReadOperationCount)
+#endif
+  {
+      XPCOMGlueEnablePreload();
+  }
+
+
+  rv = XPCOMGlueStartup(exePath);
+  if (NS_FAILED(rv)) {
+    Output("Couldn't load XPCOM.\n");
+    return 255;
+  }
+
+  rv = XPCOMGlueLoadXULFunctions(kXULFuncs);
+  if (NS_FAILED(rv)) {
+    Output("Couldn't load XRE functions.\n");
+    return 255;
+  }
+
+#ifdef XRE_HAS_DLL_BLOCKLIST
+  XRE_SetupDllBlocklist();
+#endif
+
+  if (gotCounters) {
+#if defined(XP_WIN)
+    XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_OPS,
+                            int(ioCounters.ReadOperationCount));
+    XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_TRANSFER,
+                            int(ioCounters.ReadTransferCount / 1024));
+    IO_COUNTERS newIoCounters;
+    if (GetProcessIoCounters(GetCurrentProcess(), &newIoCounters)) {
+      XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_OPS,
+                              int(newIoCounters.ReadOperationCount - ioCounters.ReadOperationCount));
+      XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_TRANSFER,
+                              int((newIoCounters.ReadTransferCount - ioCounters.ReadTransferCount) / 1024));
+    }
+#elif defined(XP_UNIX)
+    XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_HARD_FAULTS,
+                            int(initialRUsage.ru_majflt));
+    struct rusage newRUsage;
+    if (!getrusage(RUSAGE_SELF, &newRUsage)) {
+      XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_HARD_FAULTS,
+                              int(newRUsage.ru_majflt - initialRUsage.ru_majflt));
+    }
+#endif
+  }
+
+  int result;
+  {
+    ScopedLogging log;
+    result = do_main(exePath, argc, argv);
+  }
+
+  XPCOMGlueShutdown();
+  return result;
+}
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -161,20 +161,16 @@ pref("app.update.url", "https://aus3.moz
 // app.update.url.manual is in branding section
 // app.update.url.details is in branding section
 
 // User-settable override to app.update.url for testing purposes.
 //pref("app.update.url.override", "");
 
 // app.update.interval is in branding section
 
-// Interval: Time before prompting the user again to restart to install the
-//           latest download (in seconds) default=1 day
-pref("app.update.nagTimer.restart", 86400);
-
 // Give the user x seconds to react before showing the big UI. default=12 hours
 pref("app.update.promptWaitTime", 43200);
 // Show the Update Checking/Ready UI when the user was idle for x seconds
 pref("app.update.idletime", 60);
 
 // Whether or not we show a dialog box informing the user that the update was
 // successfully applied. This is off in Firefox by default since we show a 
 // upgrade start page instead! Other apps may wish to show this UI, and supply
@@ -296,16 +292,17 @@ pref("browser.urlbar.match.url", "@");
 // more (intersection). Add the following values to set the behavior as the
 // default: 1: history, 2: bookmark, 4: tag, 8: title, 16: url, 32: typed,
 //          64: javascript, 128: tabs
 // E.g., 0 = show all results (no filtering), 1 = only visited pages in history,
 // 2 = only bookmarks, 3 = visited bookmarks, 1+16 = history matching in the url
 pref("browser.urlbar.default.behavior", 0);
 
 pref("browser.urlbar.formatting.enabled", true);
+pref("browser.urlbar.trimURLs", true);
 
 // Number of milliseconds to wait for the http headers (and thus
 // the Content-Disposition filename) before giving up and falling back to 
 // picking a filename without that info in hand so that the user sees some
 // feedback from their action.
 pref("browser.download.saveLinkAsFilenameTimeout", 1000);
 
 pref("browser.download.useDownloadDir", true);
@@ -997,19 +994,21 @@ pref("services.sync.prefs.sync.security.
 pref("services.sync.prefs.sync.security.warn_leaving_secure", true);
 pref("services.sync.prefs.sync.security.warn_submit_insecure", true);
 pref("services.sync.prefs.sync.security.warn_viewing_mixed", true);
 pref("services.sync.prefs.sync.signon.rememberSignons", true);
 pref("services.sync.prefs.sync.spellchecker.dictionary", true);
 pref("services.sync.prefs.sync.xpinstall.whitelist.required", true);
 #endif
 
-// Disable the error console and inspector
+// Disable the error console
 pref("devtools.errorconsole.enabled", false);
-pref("devtools.inspector.enabled", false);
+
+// Enable the Inspector
+pref("devtools.inspector.enabled", true);
 
 // Enable the Scratchpad tool.
 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
@@ -1025,16 +1024,22 @@ pref("devtools.webconsole.position", "ab
 
 // 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);
 
+// The developer tools editor configuration:
+// - tabsize: how many spaces to use when a Tab character is displayed.
+// - expandtab: expand Tab characters to spaces.
+pref("devtools.editor.tabsize", 4);
+pref("devtools.editor.expandtab", true);
+
 // 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/Makefile.in
+++ b/browser/base/Makefile.in
@@ -52,17 +52,16 @@ CHROME_DEPS += $(abs_srcdir)/content/ove
 ifdef ENABLE_TESTS
 DIRS += content/test
 endif
 
 EXTRA_JS_MODULES = \
 	content/openLocationLastURL.jsm \
 	content/NetworkPrioritizer.jsm \
 	content/domplate.jsm \
-	content/stylePanel.jsm \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 PRE_RELEASE_SUFFIX := ""
 
 DEFINES += \
 	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
--- a/browser/base/content/aboutDialog.css
+++ b/browser/base/content/aboutDialog.css
@@ -16,16 +16,19 @@
 
 #bottomBox {
   padding: 15px 10px 0;
 }
 
 #version {
   margin-top: 10px;
   -moz-margin-start: 0;
+  -moz-user-select: text;
+  -moz-user-focus: normal;
+  cursor: text;
 }
 
 #distribution,
 #distributionId {
   font-weight: bold;
   display: none;
   margin-top: 0;
   margin-bottom: 0;
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -65,17 +65,17 @@ function init(aEvent)
     // Pref is unset
   }
 
   // Include the build ID if this is an "a#" (nightly or aurora) build
   let version = Services.appinfo.version;
   if (/a\d+$/.test(version)) {
     let buildID = Services.appinfo.appBuildID;
     let buildDate = buildID.slice(0,4) + "-" + buildID.slice(4,6) + "-" + buildID.slice(6,8);
-    document.getElementById("version").value += " (" + buildDate + ")";
+    document.getElementById("version").textContent += " (" + buildDate + ")";
   }
 
 #ifdef MOZ_OFFICIAL_BRANDING
   // Hide the Charlton trademark attribution for non-en-US/en-GB
   // DO NOT REMOVE without consulting people involved with bug 616193
   let chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"].
                        getService(Components.interfaces.nsIXULChromeRegistry);
   let currentLocale = chromeRegistry.getSelectedLocale("global");
--- a/browser/base/content/aboutDialog.xul
+++ b/browser/base/content/aboutDialog.xul
@@ -71,17 +71,17 @@
         >
 
   <script type="application/javascript" src="chrome://browser/content/aboutDialog.js"/>
 
   <vbox id="aboutDialogContainer">
     <hbox id="clientBox">
       <vbox id="leftBox" flex="1"/>
       <vbox id="rightBox" flex="1">
-#expand <label id="version" value="__MOZ_APP_VERSION__"/>
+#expand <label id="version">__MOZ_APP_VERSION__</label>
         <label id="distribution" class="text-blurb"/>
         <label id="distributionId" class="text-blurb"/>
 
         <vbox id="detailsBox" aria-describedby="communityDesc contributeDesc">
           <vbox id="updateBox">
 #ifdef MOZ_UPDATER
             <deck id="updateDeck" orient="vertical">
               <hbox id="updateButtonBox" align="center">
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..22a260da2c5838e2547dc40464fc22c599113881
GIT binary patch
literal 1866
zc$@)B2etT#P)<h;3K|Lk000e1NJLTq001Ze001%w1^@s6F0+}C000LONkl<ZcwWtx
zYiv|S6vxlq-4+U}0Kq5<)$qX&n4nQjFws~LM2$vCl=wl!5J41!L?EJ2iuFUI5+N8~
zCLpDVKvPtaNReO)6qFXAu>gfWwy)i7yW8DuxBI$xuIJ9o?%dtG>Ajmm<uw1ybUSnQ
zH)rNQ9UI){F(}|$<*hSNi%^?U+i!tBM=d~2$O=%KfU3ssanyFyQq-bbpf6FoQ0-bF
zECZ^lx&<{I1;eCV)Rs5*UVq9Ia8Aje_o@J|qkxJLgOn7x3Bs%@%dYz#JJ@UsO#zYU
zag?3YCBXzF3{hgiKv-W?0;XFr$+$%6Aw|Sg`FA^D@ss0WlmiAGC!s`6-BuHFk13$4
z#P8xu;u8g|O0Xp)lMpTk))Y*HXCJx~+xr+~=CKGO;HV&}JX1g=9&@B_FJCcH#mdu^
zKPDH}%(x#$<+617V@I&xbEJ&pGv}e^luQ8$QEV!RA2SC|*5GD7z~Mw7B>g-OAv4ZR
z15EswZ!sZ~I4&x0#TE-OxV6tu(!&`b*Up>-c@9a;6B4lEh?@fnONrI7M%9ab`78sR
z5po<Kmtz}rCjd}cT+~dWZ-kpY2}bAI!Ad+hZX}LRg%s`uy_2m03Q!bpxe#t76uvOo
zGMs><^AOUm&&SM>)nh@N2XXFLi*6kO>*ff!7Edp%-*XK9y408v>W9i2*jRBA{Qcns
zB%MFXVM{%SB&#!MbTII3EqW<GrE&$IY=xrIN+?*djl$~V=jwWR_v`(zeCw}N`brkP
zn4h}cV8z8opKw4-ig4=%TvGl}MD$sejK7P%fE>>tN9WiDB;zy#<ZNjN_>IRVK(jYO
zrH@@J=fQK+ra;mB+3@I;iJ*@Kv!8&E=RO0kJv|lH;oo&Z^MqmwygYTRxGXH2MDGd?
zT2kqRwZApN&gxD*1O4(7-@Fg&-kt@S;@c&!!lCsG4DgtT=KHC(EB(T@c+H4P8kB8V
z$}c|4{vIUQQW*iMd!<<`&6FvBdS0troc_Y19o{zr@~umk=@@=(iTqTwYt_Z+6GdMi
zWA4bKMi?xX8UC&}gaFIp4C+hHSE;*H(*q4coy;TM$y8}!e28SV#X_`WcpibVis)o|
z<sb}&#Wwj_S{RGK`qoWie4|-&F+x!w4n{#UhjGzji;0B_DkRk;Y45h7M|xgJLK0cA
z02q&^99TA=b=-j{l%44qvM>+N%LN=V7BvTy!y!VHINw}8nYZp>1WK#hQEgCqI(y+<
zDo>CCvXI0RMeYj_a~BiRAM?1_agZdMK}}|n#B+?csuhV!@p1_`O2@W08Uxwa-De6I
z8wfPZ{vL>SHshoSj<BH+GSO0I(|?JES2+u9zJ!g9<>i2KzzY#)11NH|%@nYu`e2=^
z5}y+EL!|jCgc~kF)Oii$9v1?N#Iy?5;rPNNwn!xgv5qDPH~tF)4RsK6wSp?gAr=Z$
znF9J+>LLT)_KhHdPFDJQLH4?lO#{?H3dg64f5wJTI<`0jj=NidM8mW%ZV$P=`SgJw
zO#xBy+P!P`2VFOoqgfjCpi0n(pgyrZ65sO7TP<85F*pfZxx1Y%ScDphhx>kMtlB%T
z=f*jo6~HJ;xp?4<Bd5Mw_)68L`48jD3i`WRR%?t{MNHWbl0CzA3nkd-nUic19WVR4
zfP_PU3%}yIa%%3m-76od+Vsw}Gdn(9)meAE2LM8*fIL4A7SUF7xbytJ!itc$y_lBR
zqg5fMeX*#dn9g8zaDZ?m6a)p$r=4%-*+U;(tK3l^_IvcD)cOG{fWQa3ST#k|mVLG_
z+UMN?DuKAmiH*W5DKTkKAfTm$sc<oJcZY@@_cdKurY$(FAVE|cikJfm^`V@o22>Nu
zje@^-F5e(W2abUvgW`6w<8QY!^VsZ3r%PHNrPWq;w^Bn4_*`GrAKvs2UwA9(Iu*+;
zqre)VQ8Hg;7YgbsN>&g#R;R|XGM-jeDTHKTTz0KRQ*^aaQ=kzlYW93us(B67fr_L*
zV9Wu{<wyC@Fp=vgb}v>H*{Mdup!9TLvFucmPNdg^h8h4|Og);ekOOt<t97#hfg7mb
zbNQsN?fjAVv_r3=0Z5<=BnLt|9JD3<ejq^~HAQoE`4VafHaCodTL}o<K#`W}a%cCo
zvx@=iM9`rK#EcTfs(D@16yC<#r5zXk@NgsaqF^`xRep}*SC4M1!%KY?U?3EQR6K3W
z6yDB~%fD}~<>yU<gkb^XQc&&eQZGJ=Teu+ssX0785G=1LTV2M-b)wYa0~Ct$N~-u@
zVMi?F-$x<k*oBJ+i;Ik=7=A$D+vnyNc`-iM_M<75aZ_{)Qw%qt@lx-JNBWhs-+xrd
zO%dSN68yh_LOvZ(Byp+VPJqCn0>Tux6QGbsm}2PhADS<~&U=8j8~^|S07*qoM6N<$
Ef@x4__W%F@
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e0724fb6df5bbf0a601af72a82d60d942b99d939
GIT binary patch
literal 3287
zc$@*(3@G!7P)<h;3K|Lk000e1NJLTq001Ze001%w1^@s6F0+}C000c0Nkl<ZcwX(9
z3vgBSoyR}tb#HQS9wa0o1VF-5AcR+W8mqk2N>^oZwQJXQtfFYAzPjL!wWD<{R&*;4
zx^}A;ZL`%WENx0bTA&LEAR)xW1jv&lH{6@#zTdC&+L=3!D@2eibnDFScjnHyGiT=B
z&wPIKKfm9cpU9Uy{|^YT;r`i0dw;%aziFDa2i|+Q@=FKk568FH>}b92*Bib$PYv}n
zZdfz>%`X+8w?95Q7PIok+xz*KSC0}+sP}&V&M8$_3{X$C<Y<YH*7mmjb_7GrgH>au
zjVT;izI5q4@^Tcq93cig5kx^Wt{kAQbf(hw*HcNgfA6+uZf6LwDB_NaITZ{z-9*A+
z>~;&HDBS`axh%j`w0XUuM@s-AVI$w?Is<Vpf@E&3-uys0myoqf$`_|JX}rtfrlGMB
zQxFi~Ah6@I4vF7&Xk{Xnd?6AFZUI0~JgBD=gnTZF?Iwb0JbMWz_x5EsO+WD951+v8
zb>i#~Vi+cdW<JPg@{@<|TL0)bZng~xu;cKXk9b-S;OlR>dBD|L4s6kNZ9q3=;*kg=
zOYF1wg2a-k>iO4RFOQpC!1XtbVQNJQZf~jyI0dlrr_T@j#d8nzynnReh0~o5%a8yK
z-JBYY1sGm3mbwGKs;z$QsW&@Y>x%?Q!5>L8bLvEsFUaBrGnBEFt4VvEw70m)&zG1r
zBj;U!=YI0g;y_p(IMa1@Y-ygs{7L!Ap#jSFepAdQ>T@!!qN-@-f~tE<%O*?FSR4c^
zlEqffXA*Tcj`6i^e<R^-JDup+6Y8sbBRaM6E8;-spQ*1sh|?P(98EELOu>no+D&pK
zo;uw4!7j^`0-a?uMj0cAWu=D%C@OhRBiTu*8U<yunKElRnw}=Dn%Hvk*|U3BfKQSP
z_cqAZydImq;6CGQ&DEOcL>^kmo@Itm(hd?yaQi|;qw$x4KaINTtG^NDI8nb3w?B%e
zN27o-)Kk1mlI`1NYd)G9ClYj%N@<9K6^kX8XiR<NkMI6qn2`#&m7LO<7Hffkw~?OM
zFn0Rpv88P`8+PZh>8&~{rkAkd+L>|SaR4oyy45apGHX#j#W@~E6?xbGPdmwKK@_jo
z4P&pCHVyPNM#_U{pqujPRe}~d>q*C*#ey0~b?l-wm`!u;-yoIEWYqYHjGXgzI*K3S
z+1HzxQ(0_#V%=@CpL=K9=J46QqD7YQI$UI1qaonk%jqNsfEB4!?59aJK{%NtsU=Vi
zg|L<<d%EjLcWuY%>Od=7!Scz&nK42}mNfEnBqmHNCp7k6w%0VHCla-$DzDXi$1w~W
zU8i~w73-QS)r;4KU4At?n4my3Fv1RUhfkoTsS#E65;BJ~eq=G(A}ErGtO!V=fko6A
zRz8QeU_REuiL#!km#vCGPjeTENFWAmy;6YW<MHjT*~9LC|0BnK^LrA`4qWj(Tuvu8
z#g37TF%a?*NG8d)h$xDHB7;SNWXVECOkF~<Zy##fr0IitipI|T;br&YKfm+jnEqpL
zFKei&j^-AbrDJDTGHvN~hy^+5l1WxhDfOqr6lgxuzD{D{0BJRaqJS)dMG{EGA}qb_
zF04``k{+Y8DafqV>#1D+_)E8b|5v_6x7`2YU2E@{J7mDOUwh&1ISa-+>W?<;?d)l`
zmrR<^x>vSw_xGM;{PYRr=2{R;a3xCcwlpIJx`>5+Xle>kl96RO(|dDsZQMFHO!Djj
zKHTFacfuW1E_sM>uwLB!v+Bay0|)<cpzm~D_km|_zGT2$%ZRzxEv$S?k+PULEuZ@y
z`3FXnP9fP<L;a2yd8c{@s;`Y=OD}$Zihb=Vw5ShJG%-X0Q&-W`F#^5-3#Z8Bn8*3J
z)<<i5lCsh?!G=w=YS(Zw|55(+kd=lH8}a)cZ+{_R>z>zaN2;HC@70$!*Zu639m<dY
zxtdrwLg}c<xH}Hx7>FU3RB`pxs~K57ky4uzHPFQe?ICK8b&yiQd$x<7mXB#`K8e@S
z%8Hp0I_eJbyIn4H(j>f{wDjpLT(p!MW*1Vr-~n7d6L+t-_`Sz(>aBicS;YkbMUich
zp!d%1P7fbCRPyt(m{K`|$bf^eIFZTMJcvEl#{2~fIef&)n{OQ?5pi<5tCwK!8M<mV
zF(z_~W#v#+7UFAjt%#9B{O8_Y@~k;z%M!78l&qXATAgVU$rxGoTt<v3;dq^sqaU}9
zZfxzYzkhLwJP5FP=S!AkB6`EbiV9xc@?%ylo5hh+UV@=0;b@2v6Rx4ZWhbw1SkLyF
zT{!#wgvlqKNbucj3n@(XF>mGV%wPFEa+B@ME$N`D_yoQ6?T8T(DH-ADu~wQJ9pur&
z!P<QsI~_pp*-6apC*ld?^9Se~@G4e|vT_ihAd1TcL6l<QFzI-LA3eQ>`|tcZzutC&
z-~FM1?xtfj*VWPPh@p~&E0oF%0ITMVCJ_iRY~onTCru#L`UZ7<3NL<i9qWIo(tkEU
z@u*x5?r*`-7+~+dM#8}`X2UP&JG7DU;ls2xbkNn~L^lj976n<Bo*E1&2rqteMO9S-
z9xpfEu#h`$tfIpa<hzfpXUF@;sGPHiq+#J?YdbejEvDtPi*9d-DHUZz&g`elr=gYK
z%joG<D3xpYk2;aEQW?Ky;gAl$-S6O@bvtl&b}&;tL3=|Zz5QM+Sr$Z5#57H0Nt*l2
zZCB@f3V3SwD@7no<Gcj?0c>^)>+W00->;a%?++g5ot;N%>gwa~zA_4z%gu?FZj!o+
zRT6M?cM{J3DobYCnKHJ3vZ7M#BWI8ZCvn&;=s=$)GirDdd8r89Jsy&}iPfs`NiYG^
zG=*GS)|yWN1yOpQ!O7T6r&WT%Ah+E(o9!FF&6LskxIH1x^z>8v@fj8^oW*z6ehrs1
zz^Jm}IOEwg`5+uh5sIZ5nV-NhpyTe3QC3pG)2l0)S!B}h2_Q%kk|<(wZVb~PJ1gti
z&z5+N2^trSfX5p|ktBY(;clM1dkMQ50yw<}lgfwFxc?-FkF=0fgP2`g*?ZW>$L)SJ
z-*NQbTK;WEBUP1Sczk&|Ax|IfU>rq}I6vmOUvkgyBnqP75CjoXR6f^cBALSP^>gp)
z`E1?vEsDmCX5Gv0)9DCv?06?NJKKn!+)waN598eTPsBcWo|A13ZmJl^s;N2jy4<8R
z0Z9`1yhwmym^vU_sFPe35BZ7t2aqim5QOs}!36r;e)4S=UVid#S-oN&2V43uZH4^2
z`WWx+Zs%<C5ju|jfh;}Ewc|>WlObHb7=k1s3}!<V00ELZ0P;m!oo(3g%oOc&oI#Wn
zL{S=415pr&C)4=-VZM3GEH*xR3%-a(Q(uJlYdhKB<YU!>8O$!p!t3*(A|OcuCW9l(
zkk-H-6G-Wo(2GsOB(JCxMFG#5Hqwb0vTPk(asa^NjbgXLJ5R6V8_O!GoKVUu_gq7P
zki-*8AW9OzIdCQ*2_TE$jhMJXpc^0xmpClws*2T?LvFr}aG#5y+l3^{nLj&UgOIVQ
z5sjv~=eh~pzjzF!5(JZK#@hLC0$^1jshPC9H3p(4f|!9D+PGyH2Brx)g?6-f98Xsd
z>0}ZqV{<Sh0-S7fa;DEuTs4q|!R8bZBvIgOK%=EkBd%sFB3#ZyZRiGBHY?dykw||(
zLARTXP4QFtNU}sI6ek)@qUr|WNCH_F&UtKDWRbXPa@v)m*RLUFVBzvdelv6QK@hOz
zW}&CzczgR%H62-&05elc-#`d6V-tLlM8>LVf+PqivWO?Fa>|(?mNu}+!ezZ-?Y^*0
zlWbcSwk(P8fQOJjoUsSsb_cO!%z{6XK-UbiEfT5$t<D%70|_#)7gwTQ3Sha3`2=8G
z2og~wcbE-RRS66P=|AhwJj6v&L=Z&MszxxL#vM-5)Dt8a)3C}S!o|fM1)=a#OS};n
z4|HD8re>0Dw~&*kU}`E>Mb4BRflNu;odMdNApjIv_#$g}0E>a>P!35CFcH{vv634)
zl#~@PqjDVfY)j@)0T_UkF?vzBPM{FjdO2%|$ACFN08BnF>6AvcO<~dENn~ebAiwB`
zb>Ih|2#8*ZHN;0iA@CBI=I4Q`X#+tJGZT+t7+fUHKq;`{FR_ML2UGwaFgf=FrfFc9
z0K%vDK66_K9tLIr-oNCY<P=Z>R9|44W3XZRfUAJb|C_6@yMb$g#D8;{3=W%sGQj!Q
z*wq~Za)2$I7Xi9~DZpcY?Pa0?d<U2>2tph{5cv^M4zzulww=cTJ0Jkh{GZtu{}<^&
V0dzR3C*%MC002ovPDHLkV1n%yJ|zGE
--- a/browser/base/content/aboutHome.css
+++ b/browser/base/content/aboutHome.css
@@ -249,16 +249,36 @@ body[dir=rtl] #searchSubmit:active {
 }
 
 #snippets:hover:active {
   background-color: rgb(210,210,210);
   box-shadow: 0 2px 3px rgba(0,0,0,.3) inset,
               0 1px 0 rgba(255,255,255,.5);
 }
 
+#defaultSnippet1,
+#defaultSnippet2 {
+  display: table-row;
+  text-align: start;
+}
+
+#defaultSnippet1::before,
+#defaultSnippet2::before {
+  display: table-cell;
+  vertical-align: middle;
+  -moz-padding-end: 1em;
+}
+
+#defaultSnippet1::before {
+  content: url("chrome://browser/content/aboutHome-snippet1.png");
+}
+#defaultSnippet2::before {
+  content: url("chrome://browser/content/aboutHome-snippet2.png");
+}
+
 #sessionRestoreContainer {
   padding-top: 1.5%;
   text-align: center;
 }
 
 @media all and (max-height: 370px) {
   #sessionRestoreContainer {
     position: relative;
--- a/browser/base/content/aboutHome.js
+++ b/browser/base/content/aboutHome.js
@@ -136,18 +136,18 @@ const SEARCH_ENGINES = {
 };
 
 // The process of adding a new default snippet involves:
 //   * add a new entity to aboutHome.dtd
 //   * add a <span/> for it in aboutHome.xhtml
 //   * add an entry here in the proper ordering (based on spans)
 // The <a/> part of the snippet will be linked to the corresponding url.
 const DEFAULT_SNIPPETS_URLS = [
-  "http://www.mozilla.com/firefox/4.0/features"
-, "https://addons.mozilla.org/firefox/?src=snippet"
+  "http://www.mozilla.com/firefox/features/?WT.mc_ID=default1"
+, "https://addons.mozilla.org/firefox/?src=snippet&WT.mc_ID=default2"
 ];
 
 const SNIPPETS_UPDATE_INTERVAL_MS = 86400000; // 1 Day.
 
 let gSearchEngine;
 
 function onLoad(event)
 {
--- a/browser/base/content/aboutHome.xhtml
+++ b/browser/base/content/aboutHome.xhtml
@@ -82,18 +82,18 @@
           <input id="searchSubmit" type="submit" value="&abouthome.searchEngineButton.label;" />
         </div>
       </form>
     </div>
 
     <div id="contentContainer">
       <div id="snippetContainer">
         <div id="defaultSnippets" hidden="true">
-          <span>&abouthome.defaultSnippet1.v1;</span>
-          <span>&abouthome.defaultSnippet2.v1;</span>
+          <span id="defaultSnippet1">&abouthome.defaultSnippet1.v1;</span>
+          <span id="defaultSnippet2">&abouthome.defaultSnippet2.v1;</span>
         </div>
         <div id="snippets"/>
       </div>
 
       <div id="sessionRestoreContainer">
         <button id="restorePreviousSession">&historyRestoreLastSession.label;</button>
       </div>
     </div>
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -381,16 +381,17 @@
                           label="&showAllHistoryCmd2.label;"
 #ifndef XP_MACOSX
                           key="showAllHistoryKb"
 #endif
                           command="Browser:ShowAllHistory"/>
                 <menuseparator id="showAllHistorySeparator"/>
 #ifdef MOZ_SERVICES_SYNC
                 <menuitem id="sync-tabs-menuitem"
+                          class="syncTabsMenuItem"
                           label="&syncTabsMenu.label;"
                           oncommand="BrowserOpenSyncTabs();"
                           disabled="true"/>
 #endif
                 <menuitem id="historyRestoreLastSession"
                           class="restoreLastSession"
                           label="&historyRestoreLastSession.label;"
                           oncommand="restoreLastSession();"
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -654,18 +654,21 @@ HistoryMenu.prototype = {
     m.setAttribute("label", gNavigatorBundle.getString("menuRestoreAllWindows.label"));
     m.setAttribute("oncommand",
       "for (var i = 0; i < " + undoItems.length + "; i++) undoCloseWindow();");
   },
 
   toggleTabsFromOtherComputers: function PHM_toggleTabsFromOtherComputers() {
     // This is a no-op if MOZ_SERVICES_SYNC isn't defined
 #ifdef MOZ_SERVICES_SYNC
-    // enable/disable the Tabs From Other Computers menu
-    let menuitem = document.getElementById("sync-tabs-menuitem");
+    // Enable/disable the Tabs From Other Computers menu. Some of the menus handled
+    // by HistoryMenu do not have this menuitem.
+    let menuitem = this._rootElt.getElementsByClassName("syncTabsMenuItem")[0];
+    if (!menuitem)
+      return;
 
     // If Sync isn't configured yet, then don't show the menuitem.
     if (Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED ||
         Weave.Svc.Prefs.get("firstSync", "") == "notReady") {
       menuitem.setAttribute("hidden", true);
       return;
     }
 
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -186,17 +186,17 @@
                  accesskey="&dontShowMessage.accesskey;"
                  type="checkbox"
                  oncommand="gPopupBlockerObserver.dontShowMessage();"/>
     <broadcaster id="blockedPopupsSeparator"/>
     <broadcaster id="isImage"/>
     <broadcaster id="isFrameImage"/>
     <broadcaster id="singleFeedMenuitemState" disabled="true"/>
     <broadcaster id="multipleFeedsMenuState" hidden="true"/>
-    <broadcaster id="tabviewGroupsNumber" groups="0"/>
+    <broadcaster id="tabviewGroupsNumber" groups="1"/>
 #ifdef MOZ_SERVICES_SYNC
     <broadcaster id="sync-setup-state"/>
     <broadcaster id="sync-syncnow-state"/>
 #endif
     <broadcaster id="workOfflineMenuitemState"/>
   </broadcasterset>
 
   <keyset id="mainKeyset">
@@ -237,17 +237,17 @@
     <key id="key_openDownloads" key="&downloadsUnix.commandkey;" command="Tools:Downloads" modifiers="accel,shift"/>
 #else
     <key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
 #endif
     <key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
     <key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" oncommand="toJavaScriptConsole();" modifiers="accel,shift" disabled="true"/>
     <key id="key_webConsole" key="&webConsoleCmd.commandkey;" oncommand="HUDConsoleUI.toggleHUD();" modifiers="accel,shift"/>
     <key id="key_inspect" key="&inspectMenu.commandkey;" command="Tools:Inspect" modifiers="accel,shift"/>
-    <key id="key_scratchpad" keycode="&scratchpad.keycode;"
+    <key id="key_scratchpad" keycode="&scratchpad.keycode;" modifiers="shift"
          keytext="&scratchpad.keytext;" command="Tools:Scratchpad"/>
     <key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile"  modifiers="accel"/>
     <key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
     <key id="printKb" key="&printCmd.commandkey;" command="cmd_print"  modifiers="accel"/>
     <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/>
     <key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift"/>
     <key id="key_undo"
          key="&undoCmd.key;"
--- a/browser/base/content/browser-tabview.js
+++ b/browser/base/content/browser-tabview.js
@@ -35,25 +35,28 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 let TabView = {
   _deck: null,
   _iframe: null,
   _window: null,
+  _initialized: false,
   _browserKeyHandlerInitialized: false,
   _isFrameLoading: false,
   _initFrameCallbacks: [],
+  _lastSessionGroupName: null,
   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",
+  GROUPS_IDENTIFIER: "tabview-groups",
   VISIBILITY_IDENTIFIER: "tabview-visibility",
-  GROUPS_IDENTIFIER: "tabview-groups",
+  LAST_SESSION_GROUP_NAME_IDENTIFIER: "tabview-last-session-group-name",