merge fx-team to m-c
authorRob Campbell <rcampbell@mozilla.com>
Thu, 18 Aug 2011 16:32:06 -0300
changeset 76786 932c8414512f32c41e0d3eb9c9e483658ed7ab27
parent 76785 c0e7a77e62d85c975092318f2ecbc1b16937d1f1 (current diff)
parent 76778 cbb901789b3b7b301271540daeaf68c9bc10d9d1 (diff)
child 76789 b6b6c8e74766b7616d9f603a63528b7501b04f2c
child 76814 ec4956f17090631ec826f27e3da5ac6956717083
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge fx-team to m-c
gfx/src/gfxIFormats.idl
gfx/src/gfxidltypes.idl
gfx/src/mozilla-decoder.cpp
gfx/src/mozilla-decoder.h
js/src/xpconnect/idl/nsIScriptableInterfaces.idl
security/manager/ssl/public/nsICipherInfo.idl
security/manager/ssl/src/nsCipherInfo.cpp
security/manager/ssl/src/nsCipherInfo.h
--- a/Makefile.in
+++ b/Makefile.in
@@ -198,29 +198,14 @@ ifdef MOZ_CRASHREPORTER
 endif
 
 codesighs:
 	$(MAKE) -C $(MOZ_BUILD_APP)/installer codesighs
 
 # defined in package-name.mk
 export MOZ_SOURCE_STAMP
 
-#XXX: this is a hack, since we don't want to clobber for MSVC
-# PGO support, but we can't do this test in client.mk
-ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
-# No point in clobbering if PGO has been explicitly disabled.
-ifndef NO_PROFILE_GUIDED_OPTIMIZE
-maybe_clobber_profiledbuild: clean
-else
-maybe_clobber_profiledbuild:
-endif
-else
-maybe_clobber_profiledbuild:
-endif
-
-.PHONY: maybe_clobber_profiledbuild
-
 # Look for R_386_PC32 relocations in shared libs, these
 # break x86_64 builds and SELinux users.
 ifeq ($(OS_TARGET)_$(TARGET_XPCOM_ABI),Linux_x86-gcc3)
 scheck::
 	@relcount=`find $(DIST)/bin -name "*.so" | xargs objdump -R | grep R_386_PC32 | wc -l` && if test $$relcount -gt 0; then echo "FAILED: R_386_PC32 relocations detected in a shared library.  Did you use a system header without adding it to config/system-headers?"; exit 1; else echo "PASSED"; fi
 endif
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -74,17 +74,18 @@ nsContextMenu.prototype = {
                    document.popupRangeOffset);
     if (!this.shouldDisplay)
       return;
 
     this.browser = aBrowser;
 
     this.hasPageMenu = false;
     if (!aIsShift) {
-      this.hasPageMenu = PageMenu.init(this.target, aXulMenu);
+      this.hasPageMenu = PageMenu.maybeBuildAndAttachMenu(this.target,
+                                                          aXulMenu);
     }
 
     this.isFrameImage = document.getElementById("isFrameImage");
     this.ellipsis = "\u2026";
     try {
       this.ellipsis = gPrefService.getComplexValue("intl.ellipsis",
                                                    Ci.nsIPrefLocalizedString).data;
     } catch (e) { }
--- a/browser/base/content/test/test_contextmenu.html
+++ b/browser/base/content/test/test_contextmenu.html
@@ -44,19 +44,20 @@ function executeCopyCommand(command, exp
   // The easiest way to check the clipboard is to paste the contents into a
   // textbox
   input.focus();
   input.value = "";
   input.controllers.getControllerForCommand("cmd_paste").doCommand("cmd_paste");
   is(input.value, expectedValue, "paste for command " + command);
 }
 
-function invokeItemAction(ident)
+function invokeItemAction(generatedItemId)
 {
-  var item = contextMenu.getElementsByAttribute("ident", ident)[0];
+  var item = contextMenu.getElementsByAttribute("generateditemid",
+                                                generatedItemId)[0];
   ok(item, "Got generated XUL menu item");
   item.doCommand();
   is(pagemenu.hasAttribute("hopeless"), false, "attribute got removed");
 }
 
 function getVisibleMenuItems(aMenu, aData) {
     var items = [];
     var accessKeys = {};
@@ -64,17 +65,17 @@ function getVisibleMenuItems(aMenu, aDat
         var item = aMenu.childNodes[i];
         if (item.hidden)
             continue;
 
         var key = item.accessKey;
         if (key)
             key = key.toLowerCase();
 
-        var isGenerated = item.hasAttribute("generated");
+        var isGenerated = item.hasAttribute("generateditemid");
 
         if (item.nodeName == "menuitem") {
             var isSpellSuggestion = item.className == "spell-suggestion";
             if (isSpellSuggestion) {
               is(item.id, "", "child menuitem #" + i + " is a spelling suggestion");
             } else if (isGenerated) {
               is(item.id, "", "child menuitem #" + i + " is a generated item");
             } else {
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -94,17 +94,17 @@ endif
 
 ifneq (,$(filter aurora beta,$(MOZ_UPDATE_CHANNEL)))
 DEFINES += -DSHIP_FEEDBACK=1
 endif
 
 ifdef MOZ_PKG_MANIFEST_P
 MOZ_PKG_MANIFEST = package-manifest
 
-$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P)
+$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(GLOBAL_DEPS)
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $< > $@
 
 GARBAGE += $(MOZ_PKG_MANIFEST)
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 MOZ_PKG_MAC_DSSTORE=branding/dsstore
 MOZ_PKG_MAC_BACKGROUND=branding/background.png
--- a/build/unix/elfhack/elfhack.cpp
+++ b/build/unix/elfhack/elfhack.cpp
@@ -393,20 +393,21 @@ int do_relocation_section(Elf *elf, unsi
     }
 
     ElfSegment *relro = elf->getSegmentByType(PT_GNU_RELRO);
 
     ElfRel_Section<Rel_Type> *section = (ElfRel_Section<Rel_Type> *)dyn->getSectionForType(Rel_Type::d_tag);
     assert(section->getType() == Rel_Type::sh_type);
 
     Elf32_Shdr relhack32_section =
-        { 0, SHT_PROGBITS, SHF_ALLOC, 0, -1, 0, SHN_UNDEF, 0,
+        { 0, SHT_PROGBITS, SHF_ALLOC, 0, (Elf32_Off)-1, 0, SHN_UNDEF, 0,
           Elf_RelHack::size(elf->getClass()), Elf_RelHack::size(elf->getClass()) }; // TODO: sh_addralign should be an alignment, not size
     Elf32_Shdr relhackcode32_section =
-        { 0, SHT_PROGBITS, SHF_ALLOC | SHF_EXECINSTR, 0, -1, 0, SHN_UNDEF, 0, 1, 0 };
+        { 0, SHT_PROGBITS, SHF_ALLOC | SHF_EXECINSTR, 0, (Elf32_Off)-1, 0,
+          SHN_UNDEF, 0, 1, 0 };
     Elf_Shdr relhack_section(relhack32_section);
     Elf_Shdr relhackcode_section(relhackcode32_section);
     ElfRelHack_Section *relhack = new ElfRelHack_Section(relhack_section);
     ElfRelHackCode_Section *relhackcode = new ElfRelHackCode_Section(relhackcode_section, *elf);
 
     ElfSymtab_Section *symtab = (ElfSymtab_Section *) section->getLink();
     Elf_SymValue *sym = symtab->lookup("__cxa_pure_virtual");
 
--- a/build/unix/elfhack/elfxx.h
+++ b/build/unix/elfhack/elfxx.h
@@ -271,17 +271,17 @@ public:
                 T::template swap<big_endian>(*this, e);
                 file.write((char *)&e, sizeof(e));
                 return;
             }
         }
         throw std::runtime_error("Unsupported ELF class or data encoding");
     }
 
-    static inline int size(char ei_class)
+    static inline unsigned int size(char ei_class)
     {
         if (ei_class == ELFCLASS32)
             return sizeof(typename T::Type32);
         else if (ei_class == ELFCLASS64)
             return sizeof(typename T::Type64);
         return 0;
     }
 };
--- a/client.mk
+++ b/client.mk
@@ -207,17 +207,16 @@ ifdef MOZ_OBJDIR
 else
   PGO_OBJDIR := $(TOPSRCDIR)
 endif
 
 profiledbuild::
 	$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_GENERATE=1
 	$(MAKE) -C $(PGO_OBJDIR) package
 	OBJDIR=${PGO_OBJDIR} JARLOG_DIR=${PGO_OBJDIR}/jarlog/en-US $(PROFILE_GEN_SCRIPT)
-	$(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
 	$(MAKE) -f $(TOPSRCDIR)/client.mk realbuild MOZ_PROFILE_USE=1
 
 #####################################################
 # Build date unification
 
 ifdef MOZ_UNIFY_BDATE
 ifndef MOZ_BUILD_DATE
 ifdef MOZ_BUILD_PROJECTS
@@ -249,17 +248,17 @@ else
 	done
 endif
 endif
 
 # If we're building multiple projects, but haven't specified which project,
 # loop through them.
 
 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
-configure depend realbuild install export libs clean realclean distclean alldep preflight postflight maybe_clobber_profiledbuild upload sdk::
+configure depend realbuild install export libs clean realclean distclean alldep preflight postflight upload sdk::
 	set -e; \
 	for app in $(MOZ_BUILD_PROJECTS); do \
 	  $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
 	done
 
 else
 
 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
@@ -273,16 +272,17 @@ CONFIG_CACHE  = $(wildcard $(OBJDIR)/con
 
 EXTRA_CONFIG_DEPS := \
 	$(TOPSRCDIR)/aclocal.m4 \
 	$(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
 	$(TOPSRCDIR)/js/src/aclocal.m4 \
 	$(NULL)
 
 $(CONFIGURES): %: %.in $(EXTRA_CONFIG_DEPS)
+	@$(PYTHON) $(TOPSRCDIR)/js/src/config/check-sync-dirs.py $(TOPSRCDIR)/js/src/build $(TOPSRCDIR)/build
 	@echo Generating $@ using autoconf
 	cd $(@D); $(AUTOCONF)
 
 CONFIG_STATUS_DEPS := \
 	$(wildcard $(CONFIGURES)) \
 	$(TOPSRCDIR)/allmakefiles.sh \
 	$(TOPSRCDIR)/.mozconfig.mk \
 	$(wildcard $(TOPSRCDIR)/nsprpub/configure) \
@@ -341,23 +341,24 @@ ifdef MOZ_PREFLIGHT
 	  $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
 	done
 endif
 
 ####################################
 # Build it
 
 realbuild::  $(OBJDIR)/Makefile $(OBJDIR)/config.status
+	@$(PYTHON) $(TOPSRCDIR)/js/src/config/check-sync-dirs.py $(TOPSRCDIR)/js/src/config $(TOPSRCDIR)/config
 	$(MOZ_MAKE)
 
 ####################################
 # Other targets
 
 # Pass these target onto the real build system
-install export libs clean realclean distclean alldep maybe_clobber_profiledbuild upload sdk:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
+install export libs clean realclean distclean alldep upload sdk:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
 	$(MOZ_MAKE) $@
 
 ####################################
 # Postflight
 
 realbuild alldep postflight::
 ifdef MOZ_POSTFLIGHT
 	set -e; \
@@ -406,9 +407,9 @@ cleansrcdir:
 echo-variable-%:
 	@echo $($*)
 
 # This makefile doesn't support parallel execution. It does pass
 # MOZ_MAKE_FLAGS to sub-make processes, so they will correctly execute
 # in parallel.
 .NOTPARALLEL:
 
-.PHONY: checkout real_checkout depend realbuild build profiledbuild maybe_clobber_profiledbuild export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all upload sdk
+.PHONY: checkout real_checkout depend realbuild build profiledbuild export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all upload sdk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -428,17 +428,17 @@ ifdef MOZ_UPDATE_XTERM
 # Its good not to have a newline at the end of the titlebar string because it
 # makes the make -s output easier to read.  Echo -n does not work on all
 # platforms, but we can trick sed into doing it.
 UPDATE_TITLE = sed -e "s!Y!$(1) in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2)!" $(MOZILLA_DIR)/config/xterm.str;
 endif
 
 define SUBMAKE # $(call SUBMAKE,target,directory)
 +@$(UPDATE_TITLE)
-+@$(MAKE) $(if $(2),-C $(2)) $(1)
++$(MAKE) $(if $(2),-C $(2)) $(1)
 
 endef # The extra line is important here! don't delete it
 
 ifneq (,$(strip $(DIRS)))
 LOOP_OVER_DIRS = \
   $(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
 endif
 
@@ -893,18 +893,21 @@ ifdef PROGRAM
 	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/$(MOZ_APP_NAME)
 endif
 ifdef SHARED_LIBRARY
 	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(SHARED_LIBRARY_NAME) $(DIST)/$(MOZ_APP_NAME)
 endif
 endif # SHARED_LIBRARY || PROGRAM
+else  # ! WINNT_
+# Force rebuilding all objects on the second pass
+$(OBJS): FORCE
 endif # WINNT_
-endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
+endif # MOZ_PROFILE_USE
 ifdef MOZ_PROFILE_GENERATE
 # Clean up profiling data during PROFILE_GENERATE phase
 export::
 ifeq ($(OS_ARCH)_$(GNU_CC), WINNT_)
 	-$(RM) *.pgd
 else
 ifdef GNU_CC
 	-$(RM) *.gcda
--- a/content/html/content/src/nsHTMLAnchorElement.cpp
+++ b/content/html/content/src/nsHTMLAnchorElement.cpp
@@ -46,16 +46,17 @@
 #include "nsContentUtils.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsGkAtoms.h"
 #include "nsIPresShell.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsHTMLDNSPrefetch.h"
+#include "nsDOMMemoryReporter.h"
 
 using namespace mozilla::dom;
 
 class nsHTMLAnchorElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLAnchorElement,
                             public nsILink,
                             public Link
 {
@@ -76,16 +77,21 @@ public:
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLAnchorElement
   NS_DECL_NSIDOMHTMLANCHORELEMENT  
 
+  // TODO: we do not really count Link::mCachedURI but given that it's a
+  // nsCOMPtr<nsIURI>, that would be required adding SizeOf() to the interface.
+  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsHTMLAnchorElement,
+                                              nsGenericHTMLElement)
+
   // nsILink
   NS_IMETHOD LinkAdded() { return NS_OK; }
   NS_IMETHOD LinkRemoved() { return NS_OK; }
 
   // override from nsGenericHTMLElement
   NS_IMETHOD GetDraggable(PRBool* aDraggable);
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
@@ -449,8 +455,9 @@ nsHTMLAnchorElement::ParseAttribute(PRIn
                                               aResult);
 }
 
 nsEventStates
 nsHTMLAnchorElement::IntrinsicState() const
 {
   return Link::LinkState() | nsGenericHTMLElement::IntrinsicState();
 }
+
--- a/content/html/content/src/nsHTMLAudioElement.cpp
+++ b/content/html/content/src/nsHTMLAudioElement.cpp
@@ -221,17 +221,17 @@ nsHTMLAudioElement::MozWriteAudio(const 
   // on number of channels.
   if (dataLength % mChannels != 0) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   // Don't write more than can be written without blocking.
   PRUint32 writeLen = NS_MIN(mAudioStream->Available(), dataLength);
 
-  nsresult rv = mAudioStream->Write(JS_GetTypedArrayData(tsrc), writeLen, PR_TRUE);
+  nsresult rv = mAudioStream->Write(JS_GetTypedArrayData(tsrc), writeLen);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // Return the actual amount written.
   *aRetVal = writeLen;
   return rv;
 }
--- a/content/html/content/src/nsHTMLDivElement.cpp
+++ b/content/html/content/src/nsHTMLDivElement.cpp
@@ -35,16 +35,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 #include "nsIDOMHTMLDivElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
+#include "nsDOMMemoryReporter.h"
 
 class nsHTMLDivElement : public nsGenericHTMLElement,
                          public nsIDOMHTMLDivElement
 {
 public:
   nsHTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLDivElement();
 
@@ -58,16 +59,19 @@ public:
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLDivElement
   NS_DECL_NSIDOMHTMLDIVELEMENT
 
+  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsHTMLDivElement,
+                                              nsGenericHTMLElement)
+
   virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
--- a/content/html/content/src/nsHTMLSpanElement.cpp
+++ b/content/html/content/src/nsHTMLSpanElement.cpp
@@ -36,16 +36,17 @@
  * ***** END LICENSE BLOCK ***** */
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsIAtom.h"
 #include "nsRuleData.h"
+#include "nsDOMMemoryReporter.h"
 
 class nsHTMLSpanElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLElement
 {
 public:
   nsHTMLSpanElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLSpanElement();
 
@@ -56,16 +57,19 @@ public:
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
+  NS_DECL_AND_IMPL_DOM_MEMORY_REPORTER_SIZEOF(nsHTMLSpanElement,
+                                              nsGenericHTMLElement)
+
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Span)
 
--- a/content/html/content/test/test_bug408231.html
+++ b/content/html/content/test/test_bug408231.html
@@ -51,17 +51,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       ["selectall", "true"],
       ["strikethrough", "true"],
       ["styleWithCSS", "true"],
       ["subscript", "true"],
       ["superscript", "true"],
       ["underline", "true"],
       ["undo", "false"],
       ["unlink", "true"],
-      ["not-a-command", "exception"]
+      ["not-a-command", "false"]
     ];
     
     var commandStateResults = [
       ["contentReadOnly", "exception"],
       ["copy", "exception"],
       ["createlink", "exception"],
       ["cut", "exception"],
       ["decreasefontsize", "exception"],
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -3389,19 +3389,19 @@ nsHTMLDocument::QueryCommandEnabled(cons
   GetMidasCommandManager(getter_AddRefs(cmdMgr));
   if (!cmdMgr)
     return NS_ERROR_FAILURE;
 
   nsIDOMWindow *window = GetWindow();
   if (!window)
     return NS_ERROR_FAILURE;
 
-  nsCAutoString cmdToDispatch, paramStr;
+  nsCAutoString cmdToDispatch;
   if (!ConvertToMidasInternalCommand(commandID, cmdToDispatch))
-    return NS_ERROR_NOT_IMPLEMENTED;
+    return NS_OK; // queryCommandEnabled returns false on unsupported commands
 
   return cmdMgr->IsCommandEnabled(cmdToDispatch.get(), window, _retval);
 }
 
 /* boolean queryCommandIndeterm (in DOMString commandID); */
 NS_IMETHODIMP
 nsHTMLDocument::QueryCommandIndeterm(const nsAString & commandID,
                                      PRBool *_retval)
@@ -3512,17 +3512,28 @@ nsHTMLDocument::QueryCommandSupported(co
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = PR_FALSE;
 
   // if editing is not on, bail
   if (!IsEditingOnAfterFlush())
     return NS_ERROR_FAILURE;
 
-  return NS_ERROR_NOT_IMPLEMENTED;
+  // get command manager
+  nsCOMPtr<nsICommandManager> cmdMgr;
+  GetMidasCommandManager(getter_AddRefs(cmdMgr));
+  if (!cmdMgr)
+    return NS_ERROR_FAILURE;
+
+  // commandID is supported if it can be converted to a Midas command
+  nsCAutoString cmdToDispatch;
+  if (ConvertToMidasInternalCommand(commandID, cmdToDispatch))
+    *_retval = PR_TRUE;
+
+  return NS_OK;
 }
 
 /* DOMString queryCommandText(in DOMString commandID); */
 NS_IMETHODIMP
 nsHTMLDocument::QueryCommandText(const nsAString & commandID,
                                  nsAString & _retval)
 {
   _retval.SetLength(0);
--- a/content/media/nsAudioAvailableEventManager.cpp
+++ b/content/media/nsAudioAvailableEventManager.cpp
@@ -111,17 +111,17 @@ void nsAudioAvailableEventManager::Dispa
       break;
     }
     nsCOMPtr<nsIRunnable> event = mPendingEvents[0];
     mPendingEvents.RemoveElementAt(0);
     NS_DispatchToMainThread(event, NS_DISPATCH_NORMAL);
   }
 }
 
-void nsAudioAvailableEventManager::QueueWrittenAudioData(SoundDataValue* aAudioData,
+void nsAudioAvailableEventManager::QueueWrittenAudioData(AudioDataValue* aAudioData,
                                                          PRUint32 aAudioDataLength,
                                                          PRUint64 aEndTimeSampleOffset)
 {
   ReentrantMonitorAutoEnter mon(mReentrantMonitor);
 
   PRUint32 currentBufferSize = mNewSignalBufferLength;
   if (currentBufferSize == 0) {
     NS_WARNING("Decoder framebuffer length not set.");
@@ -131,34 +131,34 @@ void nsAudioAvailableEventManager::Queue
   if (!mSignalBuffer ||
       (mSignalBufferPosition == 0 && mSignalBufferLength != currentBufferSize)) {
     if (!mSignalBuffer || (mSignalBufferLength < currentBufferSize)) {
       // Only resize if buffer is empty or smaller.
       mSignalBuffer = new float[currentBufferSize];
     }
     mSignalBufferLength = currentBufferSize;
   }
-  SoundDataValue* audioData = aAudioData;
+  AudioDataValue* audioData = aAudioData;
   PRUint32 audioDataLength = aAudioDataLength;
   PRUint32 signalBufferTail = mSignalBufferLength - mSignalBufferPosition;
 
   // Group audio samples into optimal size for event dispatch, and queue.
   while (signalBufferTail <= audioDataLength) {
     float time = 0.0;
     // Guard against unsigned number overflow during first frame time calculation.
     if (aEndTimeSampleOffset > mSignalBufferPosition + audioDataLength) {
       time = (aEndTimeSampleOffset - mSignalBufferPosition - audioDataLength) / 
              mSamplesPerSecond;
     }
 
     // Fill the signalBuffer.
     PRUint32 i;
     float *signalBuffer = mSignalBuffer.get() + mSignalBufferPosition;
     for (i = 0; i < signalBufferTail; ++i) {
-      signalBuffer[i] = MOZ_CONVERT_SOUND_SAMPLE(audioData[i]);
+      signalBuffer[i] = MOZ_CONVERT_AUDIO_SAMPLE(audioData[i]);
     }
     audioData += signalBufferTail;
     audioDataLength -= signalBufferTail;
 
     if (mPendingEvents.Length() > 0) {
       // Check last event timecode to make sure that all queued events
       // are in non-descending sequence.
       nsAudioAvailableEventRunner* lastPendingEvent =
@@ -167,17 +167,17 @@ void nsAudioAvailableEventManager::Queue
         // Clear the queue to start a fresh sequence.
         mPendingEvents.Clear();
       } else if (mPendingEvents.Length() >= MAX_PENDING_EVENTS) {
         NS_WARNING("Hit audio event queue max.");
         mPendingEvents.RemoveElementsAt(0, mPendingEvents.Length() - MAX_PENDING_EVENTS + 1);
       }
     }
 
-    // Inform the element that we've written sound data.
+    // Inform the element that we've written audio data.
     nsCOMPtr<nsIRunnable> event =
       new nsAudioAvailableEventRunner(mDecoder, mSignalBuffer.forget(),
                                       mSignalBufferLength, time);
     mPendingEvents.AppendElement(event);
 
     // Reset the buffer
     mSignalBufferLength = currentBufferSize;
     mSignalBuffer = new float[currentBufferSize];
@@ -189,17 +189,17 @@ void nsAudioAvailableEventManager::Queue
   NS_ASSERTION(mSignalBufferPosition + audioDataLength < mSignalBufferLength,
                "Intermediate signal buffer must fit at least one more item.");
 
   if (audioDataLength > 0) {
     // Add data to the signalBuffer.
     PRUint32 i;
     float *signalBuffer = mSignalBuffer.get() + mSignalBufferPosition;
     for (i = 0; i < audioDataLength; ++i) {
-      signalBuffer[i] = MOZ_CONVERT_SOUND_SAMPLE(audioData[i]);
+      signalBuffer[i] = MOZ_CONVERT_AUDIO_SAMPLE(audioData[i]);
     }
     mSignalBufferPosition += audioDataLength;
   }
 }
 
 void nsAudioAvailableEventManager::Clear()
 {
   ReentrantMonitorAutoEnter mon(mReentrantMonitor);
--- a/content/media/nsAudioAvailableEventManager.h
+++ b/content/media/nsAudioAvailableEventManager.h
@@ -58,17 +58,17 @@ public:
   void Init(PRUint32 aChannels, PRUint32 aRate);
 
   // Dispatch pending MozAudioAvailable events in the queue.  Called
   // from the state machine thread.
   void DispatchPendingEvents(PRUint64 aCurrentTime);
 
   // Queues audio sample data and re-packages it into equal sized
   // framebuffers.  Called from the audio thread.
-  void QueueWrittenAudioData(SoundDataValue* aAudioData,
+  void QueueWrittenAudioData(AudioDataValue* aAudioData,
                              PRUint32 aAudioDataLength,
                              PRUint64 aEndTimeSampleOffset);
 
   // Clears the queue of any existing events.  Called from both the state
   // machine and audio threads.
   void Clear();
 
   // Fires one last event for any extra samples that didn't fit in a whole
--- a/content/media/nsAudioStream.cpp
+++ b/content/media/nsAudioStream.cpp
@@ -85,17 +85,17 @@ class nsAudioStreamLocal : public nsAudi
  public:
   NS_DECL_ISUPPORTS
 
   ~nsAudioStreamLocal();
   nsAudioStreamLocal();
 
   nsresult Init(PRInt32 aNumChannels, PRInt32 aRate, SampleFormat aFormat);
   void Shutdown();
-  nsresult Write(const void* aBuf, PRUint32 aCount, PRBool aBlocking);
+  nsresult Write(const void* aBuf, PRUint32 aCount);
   PRUint32 Available();
   void SetVolume(double aVolume);
   void Drain();
   void Pause();
   void Resume();
   PRInt64 GetPosition();
   PRInt64 GetSampleOffset();
   PRBool IsPaused();
@@ -105,22 +105,16 @@ class nsAudioStreamLocal : public nsAudi
 
   double mVolume;
   void* mAudioHandle;
   int mRate;
   int mChannels;
 
   SampleFormat mFormat;
 
-  // When a Write() request is made, and the number of samples
-  // requested to be written exceeds the buffer size of the audio
-  // backend, the remaining samples are stored in this variable. They
-  // will be written on the next Write() request.
-  nsTArray<short> mBufferOverflow;
-
   // PR_TRUE if this audio stream is paused.
   PRPackedBool mPaused;
 
   // PR_TRUE if this stream has encountered an error.
   PRPackedBool mInError;
 
 };
 
@@ -129,17 +123,17 @@ class nsAudioStreamRemote : public nsAud
  public:
   NS_DECL_ISUPPORTS
 
   nsAudioStreamRemote();
   ~nsAudioStreamRemote();
 
   nsresult Init(PRInt32 aNumChannels, PRInt32 aRate, SampleFormat aFormat);
   void Shutdown();
-  nsresult Write(const void* aBuf, PRUint32 aCount, PRBool aBlocking);
+  nsresult Write(const void* aBuf, PRUint32 aCount);
   PRUint32 Available();
   void SetVolume(double aVolume);
   void Drain();
   void Pause();
   void Resume();
   PRInt64 GetPosition();
   PRInt64 GetSampleOffset();
   PRBool IsPaused();
@@ -447,90 +441,71 @@ void nsAudioStreamLocal::Shutdown()
   if (!mAudioHandle)
     return;
 
   sa_stream_destroy(static_cast<sa_stream_t*>(mAudioHandle));
   mAudioHandle = nsnull;
   mInError = PR_TRUE;
 }
 
-nsresult nsAudioStreamLocal::Write(const void* aBuf, PRUint32 aCount, PRBool aBlocking)
+nsresult nsAudioStreamLocal::Write(const void* aBuf, PRUint32 aCount)
 {
   NS_ABORT_IF_FALSE(aCount % mChannels == 0,
                     "Buffer size must be divisible by channel count");
   NS_ASSERTION(!mPaused, "Don't write audio when paused, you'll block");
 
   if (mInError)
     return NS_ERROR_FAILURE;
 
-  PRUint32 offset = mBufferOverflow.Length();
-  PRUint32 count = aCount + offset;
-
-  nsAutoArrayPtr<short> s_data(new short[count]);
+  nsAutoArrayPtr<short> s_data(new short[aCount]);
 
   if (s_data) {
-    for (PRUint32 i=0; i < offset; ++i) {
-      s_data[i] = mBufferOverflow.ElementAt(i);
-    }
-    mBufferOverflow.Clear();
-
     double scaled_volume = GetVolumeScale() * mVolume;
     switch (mFormat) {
       case FORMAT_U8: {
         const PRUint8* buf = static_cast<const PRUint8*>(aBuf);
         PRInt32 volume = PRInt32((1 << 16) * scaled_volume);
         for (PRUint32 i = 0; i < aCount; ++i) {
-          s_data[i + offset] = short(((PRInt32(buf[i]) - 128) * volume) >> 8);
+          s_data[i] = short(((PRInt32(buf[i]) - 128) * volume) >> 8);
         }
         break;
       }
       case FORMAT_S16_LE: {
         const short* buf = static_cast<const short*>(aBuf);
         PRInt32 volume = PRInt32((1 << 16) * scaled_volume);
         for (PRUint32 i = 0; i < aCount; ++i) {
           short s = buf[i];
 #if defined(IS_BIG_ENDIAN)
           s = ((s & 0x00ff) << 8) | ((s & 0xff00) >> 8);
 #endif
-          s_data[i + offset] = short((PRInt32(s) * volume) >> 16);
+          s_data[i] = short((PRInt32(s) * volume) >> 16);
         }
         break;
       }
       case FORMAT_FLOAT32: {
         const float* buf = static_cast<const float*>(aBuf);
         for (PRUint32 i = 0; i <  aCount; ++i) {
           float scaled_value = floorf(0.5 + 32768 * buf[i] * scaled_volume);
           if (buf[i] < 0.0) {
-            s_data[i + offset] = (scaled_value < -32768.0) ?
+            s_data[i] = (scaled_value < -32768.0) ?
               -32768 :
               short(scaled_value);
           } else {
-            s_data[i+offset] = (scaled_value > 32767.0) ?
+            s_data[i] = (scaled_value > 32767.0) ?
               32767 :
               short(scaled_value);
           }
         }
         break;
       }
     }
 
-    if (!aBlocking) {
-      // We're running in non-blocking mode, crop the data to the amount 
-      // which is available in the audio buffer, and save the rest for
-      // subsequent calls.
-      PRUint32 available = Available();
-      if (available < count) {
-        mBufferOverflow.AppendElements(s_data.get() + available, (count - available));
-        count = available;
-      }
-    }
-
     if (sa_stream_write(static_cast<sa_stream_t*>(mAudioHandle),
                         s_data.get(),
-                        count * sizeof(short)) != SA_SUCCESS)
+                        aCount * sizeof(short)) != SA_SUCCESS)
     {
       PR_LOG(gAudioStreamLog, PR_LOG_ERROR, ("nsAudioStreamLocal: sa_stream_write error"));
       mInError = PR_TRUE;
       return NS_ERROR_FAILURE;
     }
   }
   return NS_OK;
 }
@@ -564,26 +539,16 @@ void nsAudioStreamLocal::SetVolume(doubl
 
 void nsAudioStreamLocal::Drain()
 {
   NS_ASSERTION(!mPaused, "Don't drain audio when paused, it won't finish!");
 
   if (mInError)
     return;
 
-  // Write any remaining unwritten sound data in the overflow buffer
-  if (!mBufferOverflow.IsEmpty()) {
-    if (sa_stream_write(static_cast<sa_stream_t*>(mAudioHandle),
-                        mBufferOverflow.Elements(),
-                        mBufferOverflow.Length() * sizeof(short)) != SA_SUCCESS)
-      PR_LOG(gAudioStreamLog, PR_LOG_ERROR, ("nsAudioStreamLocal: sa_stream_write error"));
-      mInError = PR_TRUE;
-      return;
-  }
-
   int r = sa_stream_drain(static_cast<sa_stream_t*>(mAudioHandle));
   if (r != SA_SUCCESS && r != SA_ERROR_INVALID) {
     PR_LOG(gAudioStreamLog, PR_LOG_ERROR, ("nsAudioStreamLocal: sa_stream_drain error"));
     mInError = PR_TRUE;
   }
 }
 
 void nsAudioStreamLocal::Pause()
@@ -632,25 +597,25 @@ PRInt64 nsAudioStreamLocal::GetSampleOff
 
 PRBool nsAudioStreamLocal::IsPaused()
 {
   return mPaused;
 }
 
 PRInt32 nsAudioStreamLocal::GetMinWriteSamples()
 {
-  size_t samples;
+  size_t size;
   int r = sa_stream_get_min_write(static_cast<sa_stream_t*>(mAudioHandle),
-                                  &samples);
-  if (r == SA_ERROR_NOT_SUPPORTED)
+                                  &size);
+  if (r == SA_ERROR_NOT_SUPPORTED) {
     return 1;
-  else if (r != SA_SUCCESS || samples > PR_INT32_MAX)
+  } else if (r != SA_SUCCESS) {
     return -1;
-
-  return static_cast<PRInt32>(samples);
+  }
+  return static_cast<PRInt32>(size / mChannels / sizeof(short));
 }
 
 nsAudioStreamRemote::nsAudioStreamRemote()
  : mAudioChild(NULL),
    mFormat(FORMAT_S16_LE),
    mRate(0),
    mChannels(0),
    mBytesPerSample(1),
@@ -698,19 +663,17 @@ nsAudioStreamRemote::Shutdown()
   if (!mAudioChild)
     return;
   nsCOMPtr<nsIRunnable> event = new AudioShutdownEvent(mAudioChild);
   NS_DispatchToMainThread(event);
   mAudioChild = nsnull;
 }
 
 nsresult
-nsAudioStreamRemote::Write(const void* aBuf,
-                           PRUint32 aCount,
-                           PRBool aBlocking)
+nsAudioStreamRemote::Write(const void* aBuf, PRUint32 aCount)
 {
   if (!mAudioChild)
     return NS_ERROR_FAILURE;
   nsCOMPtr<nsIRunnable> event = new AudioWriteEvent(mAudioChild,
                                                     aBuf,
                                                     aCount,
                                                     mBytesPerSample);
   NS_DispatchToMainThread(event);
--- a/content/media/nsAudioStream.h
+++ b/content/media/nsAudioStream.h
@@ -69,34 +69,33 @@ public:
   nsIThread *GetThread();
 
   // AllocateStream will return either a local stream or a remoted stream
   // depending on where you call it from.  If you call this from a child process,
   // you may receive an implementation which forwards to a compositing process.
   static nsAudioStream* AllocateStream();
 
   // Initialize the audio stream. aNumChannels is the number of audio channels 
-  // (1 for mono, 2 for stereo, etc) and aRate is the frequency of the sound 
+  // (1 for mono, 2 for stereo, etc) and aRate is the frequency of the audio 
   // samples (22050, 44100, etc).
   // Unsafe to call with the decoder monitor held.
   virtual nsresult Init(PRInt32 aNumChannels, PRInt32 aRate, SampleFormat aFormat) = 0;
 
   // Closes the stream. All future use of the stream is an error.
   // Unsafe to call with the decoder monitor held.
   virtual void Shutdown() = 0;
 
-  // Write sound data to the audio hardware.  aBuf is an array of samples in
+  // Write audio data to the audio hardware.  aBuf is an array of samples in
   // the format specified by mFormat of length aCount.  aCount should be
-  // evenly divisible by the number of channels in this audio stream.
-  // When aBlocking is PR_TRUE, we'll block until the write has completed,
-  // otherwise we'll buffer any data we can't write immediately, and write
-  // it in a later call.
-  virtual nsresult Write(const void* aBuf, PRUint32 aCount, PRBool aBlocking) = 0;
+  // evenly divisible by the number of channels in this audio stream.  If
+  // aCount is larger than the result of Available(), the write will block
+  // until sufficient buffer space is available.
+  virtual nsresult Write(const void* aBuf, PRUint32 aCount) = 0;
 
-  // Return the number of sound samples that can be written to the audio device
+  // Return the number of audio samples that can be written to the audio device
   // without blocking.
   virtual PRUint32 Available() = 0;
 
   // Set the current volume of the audio playback. This is a value from
   // 0 (meaning muted) to 1 (meaning full volume).
   virtual void SetVolume(double aVolume) = 0;
 
   // Block until buffered audio data has been consumed.
--- a/content/media/nsBuiltinDecoderReader.cpp
+++ b/content/media/nsBuiltinDecoderReader.cpp
@@ -223,20 +223,20 @@ VideoData* nsBuiltinDecoderReader::FindS
   if (HasVideo()) {
     videoData = DecodeToFirstData(&nsBuiltinDecoderReader::DecodeVideoFrame,
                                   mVideoQueue);
     if (videoData) {
       videoStartTime = videoData->mTime;
     }
   }
   if (HasAudio()) {
-    SoundData* soundData = DecodeToFirstData(&nsBuiltinDecoderReader::DecodeAudioData,
+    AudioData* audioData = DecodeToFirstData(&nsBuiltinDecoderReader::DecodeAudioData,
                                              mAudioQueue);
-    if (soundData) {
-      audioStartTime = soundData->mTime;
+    if (audioData) {
+      audioStartTime = audioData->mTime;
     }
   }
 
   PRInt64 startTime = NS_MIN(videoStartTime, audioStartTime);
   if (startTime != PR_INT64_MAX) {
     aOutStartTime = startTime;
   }
 
@@ -316,25 +316,25 @@ nsresult nsBuiltinDecoderReader::DecodeT
         eof = !DecodeAudioData();
         {
           ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
           if (mDecoder->GetDecodeState() == nsBuiltinDecoderStateMachine::DECODER_STATE_SHUTDOWN) {
             return NS_ERROR_FAILURE;
           }
         }
       }
-      const SoundData* audio = mAudioQueue.PeekFront();
+      const AudioData* audio = mAudioQueue.PeekFront();
       if (!audio)
         break;
       PRInt64 startSample = 0;
       if (!UsecsToSamples(audio->mTime, mInfo.mAudioRate, startSample)) {
         return NS_ERROR_FAILURE;
       }
       if (startSample + audio->mSamples <= targetSample) {
-        // Our seek target lies after the samples in this SoundData. Pop it
+        // Our seek target lies after the samples in this AudioData. Pop it
         // off the queue, and keep decoding forwards.
         delete mAudioQueue.PopFront();
         audio = nsnull;
         continue;
       }
       if (startSample > targetSample) {
         // The seek target doesn't lie in the audio block just after the last
         // audio samples we've seen which were before the seek target. This
@@ -342,40 +342,40 @@ nsresult nsBuiltinDecoderReader::DecodeT
         // seek terminated after the seek target in the audio stream. Just
         // abort the audio decode-to-target, the state machine will play
         // silence to cover the gap. Typically this happens in poorly muxed
         // files.
         NS_WARNING("Audio not synced after seek, maybe a poorly muxed file?");
         break;
       }
 
-      // The seek target lies somewhere in this SoundData's samples, strip off
+      // The seek target lies somewhere in this AudioData's samples, strip off
       // any samples which lie before the seek target, so we'll begin playback
       // exactly at the seek target.
       NS_ASSERTION(targetSample >= startSample, "Target must at or be after data start.");
       NS_ASSERTION(targetSample < startSample + audio->mSamples, "Data must end after target.");
 
       PRInt64 samplesToPrune = targetSample - startSample;
       if (samplesToPrune > audio->mSamples) {
         // We've messed up somehow. Don't try to trim samples, the |samples|
         // variable below will overflow.
         NS_WARNING("Can't prune more samples that we have!");
         break;
       }
       PRUint32 samples = audio->mSamples - static_cast<PRUint32>(samplesToPrune);
       PRUint32 channels = audio->mChannels;
-      nsAutoArrayPtr<SoundDataValue> audioData(new SoundDataValue[samples * channels]);
+      nsAutoArrayPtr<AudioDataValue> audioData(new AudioDataValue[samples * channels]);
       memcpy(audioData.get(),
              audio->mAudioData.get() + (samplesToPrune * channels),
-             samples * channels * sizeof(SoundDataValue));
+             samples * channels * sizeof(AudioDataValue));
       PRInt64 duration;
       if (!SamplesToUsecs(samples, mInfo.mAudioRate, duration)) {
         return NS_ERROR_FAILURE;
       }
-      nsAutoPtr<SoundData> data(new SoundData(audio->mOffset,
+      nsAutoPtr<AudioData> data(new AudioData(audio->mOffset,
                                               aTarget,
                                               duration,
                                               samples,
                                               audioData.forget(),
                                               channels));
       delete mAudioQueue.PopFront();
       mAudioQueue.PushFront(data.forget());
       break;
--- a/content/media/nsBuiltinDecoderReader.h
+++ b/content/media/nsBuiltinDecoderReader.h
@@ -88,91 +88,91 @@ public:
 
   // PR_TRUE if we have an active video bitstream.
   PRPackedBool mHasVideo;
 };
 
 #ifdef MOZ_TREMOR
 #include <ogg/os_types.h>
 typedef ogg_int32_t VorbisPCMValue;
-typedef short SoundDataValue;
+typedef short AudioDataValue;
 
-#define MOZ_SOUND_DATA_FORMAT (nsAudioStream::FORMAT_S16_LE)
+#define MOZ_AUDIO_DATA_FORMAT (nsAudioStream::FORMAT_S16_LE)
 #define MOZ_CLIP_TO_15(x) ((x)<-32768?-32768:(x)<=32767?(x):32767)
-// Convert the output of vorbis_synthesis_pcmout to a SoundDataValue
+// Convert the output of vorbis_synthesis_pcmout to a AudioDataValue
 #define MOZ_CONVERT_VORBIS_SAMPLE(x) \
- (static_cast<SoundDataValue>(MOZ_CLIP_TO_15((x)>>9)))
-// Convert a SoundDataValue to a float for the Audio API
-#define MOZ_CONVERT_SOUND_SAMPLE(x) ((x)*(1.F/32768))
+ (static_cast<AudioDataValue>(MOZ_CLIP_TO_15((x)>>9)))
+// Convert a AudioDataValue to a float for the Audio API
+#define MOZ_CONVERT_AUDIO_SAMPLE(x) ((x)*(1.F/32768))
 #define MOZ_SAMPLE_TYPE_S16LE 1
 
 #else /*MOZ_VORBIS*/
 
 typedef float VorbisPCMValue;
-typedef float SoundDataValue;
+typedef float AudioDataValue;
 
-#define MOZ_SOUND_DATA_FORMAT (nsAudioStream::FORMAT_FLOAT32)
+#define MOZ_AUDIO_DATA_FORMAT (nsAudioStream::FORMAT_FLOAT32)
 #define MOZ_CONVERT_VORBIS_SAMPLE(x) (x)
-#define MOZ_CONVERT_SOUND_SAMPLE(x) (x)
+#define MOZ_CONVERT_AUDIO_SAMPLE(x) (x)
 #define MOZ_SAMPLE_TYPE_FLOAT32 1
 
 #endif
 
-// Holds chunk a decoded sound samples.
-class SoundData {
+// Holds chunk a decoded audio samples.
+class AudioData {
 public:
-  SoundData(PRInt64 aOffset,
+  AudioData(PRInt64 aOffset,
             PRInt64 aTime,
             PRInt64 aDuration,
             PRUint32 aSamples,
-            SoundDataValue* aData,
+            AudioDataValue* aData,
             PRUint32 aChannels)
   : mOffset(aOffset),
     mTime(aTime),
     mDuration(aDuration),
     mSamples(aSamples),
     mChannels(aChannels),
     mAudioData(aData)
   {
-    MOZ_COUNT_CTOR(SoundData);
+    MOZ_COUNT_CTOR(AudioData);
   }
 
-  SoundData(PRInt64 aOffset,
+  AudioData(PRInt64 aOffset,
             PRInt64 aDuration,
             PRUint32 aSamples,
-            SoundDataValue* aData,
+            AudioDataValue* aData,
             PRUint32 aChannels)
   : mOffset(aOffset),
     mTime(-1),
     mDuration(aDuration),
     mSamples(aSamples),
     mChannels(aChannels),
     mAudioData(aData)
   {
-    MOZ_COUNT_CTOR(SoundData);
+    MOZ_COUNT_CTOR(AudioData);
   }
 
-  ~SoundData()
+  ~AudioData()
   {
-    MOZ_COUNT_DTOR(SoundData);
+    MOZ_COUNT_DTOR(AudioData);
   }
 
   PRUint32 AudioDataLength() {
     return mChannels * mSamples;
   }
 
   // Approximate byte offset of the end of the page on which this sample
   // chunk ends.
   const PRInt64 mOffset;
 
   PRInt64 mTime; // Start time of samples in usecs.
   const PRInt64 mDuration; // In usecs.
   const PRUint32 mSamples;
   const PRUint32 mChannels;
-  nsAutoArrayPtr<SoundDataValue> mAudioData;
+  nsAutoArrayPtr<AudioDataValue> mAudioData;
 };
 
 // Holds a decoded video frame, in YCbCr format. These are queued in the reader.
 class VideoData {
 public:
   typedef mozilla::layers::ImageContainer ImageContainer;
   typedef mozilla::layers::Image Image;
 
@@ -452,17 +452,17 @@ public:
   // is the current playback position in microseconds.
   virtual nsresult Seek(PRInt64 aTime,
                         PRInt64 aStartTime,
                         PRInt64 aEndTime,
                         PRInt64 aCurrentTime) = 0;
 
   // Queue of audio samples. This queue is threadsafe, and is accessed from
   // the audio, decoder, state machine, and main threads.
-  MediaQueue<SoundData> mAudioQueue;
+  MediaQueue<AudioData> mAudioQueue;
 
   // Queue of video samples. This queue is threadsafe, and is accessed from
   // the decoder, state machine, and main threads.
   MediaQueue<VideoData> mVideoQueue;
 
   // Populates aBuffered with the time ranges which are buffered. aStartTime
   // must be the presentation time of the first sample/frame in the media, e.g.
   // the media time corresponding to playback time/position 0. This function
@@ -496,18 +496,18 @@ public:
     return functor.mResult;
   }
 
   class AudioQueueMemoryFunctor : public nsDequeFunctor {
   public:
     AudioQueueMemoryFunctor() : mResult(0) {}
 
     virtual void* operator()(void* anObject) {
-      const SoundData* soundData = static_cast<const SoundData*>(anObject);
-      mResult += soundData->mSamples * soundData->mChannels * sizeof(SoundDataValue);
+      const AudioData* audioData = static_cast<const AudioData*>(anObject);
+      mResult += audioData->mSamples * audioData->mChannels * sizeof(AudioDataValue);
       return nsnull;
     }
 
     PRInt64 mResult;
   };
 
   PRInt64 AudioQueueMemoryInUse() {
     AudioQueueMemoryFunctor functor;
--- a/content/media/nsBuiltinDecoderStateMachine.cpp
+++ b/content/media/nsBuiltinDecoderStateMachine.cpp
@@ -343,17 +343,17 @@ void nsBuiltinDecoderStateMachine::Decod
   PRInt64 lowAudioThreshold = LOW_AUDIO_USECS;
 
   // Our local ample audio threshold. If we increase lowAudioThreshold, we'll
   // also increase this too appropriately (we don't want lowAudioThreshold to
   // be greater than ampleAudioThreshold, else we'd stop decoding!).
   PRInt64 ampleAudioThreshold = AMPLE_AUDIO_USECS;
 
   MediaQueue<VideoData>& videoQueue = mReader->mVideoQueue;
-  MediaQueue<SoundData>& audioQueue = mReader->mAudioQueue;
+  MediaQueue<AudioData>& audioQueue = mReader->mAudioQueue;
 
   // Main decode loop.
   PRBool videoPlaying = HasVideo();
   PRBool audioPlaying = HasAudio();
   while ((mState == DECODER_STATE_DECODING || mState == DECODER_STATE_BUFFERING) &&
          !mStopDecodeThread &&
          (videoPlaying || audioPlaying))
   {
@@ -444,18 +444,18 @@ void nsBuiltinDecoderStateMachine::Decod
                            audioQueue.GetSize() > 0))
         &&
         (!videoPlaying ||
           static_cast<PRUint32>(videoQueue.GetSize()) >= AMPLE_VIDEO_FRAMES))
     {
       // All active bitstreams' decode is well ahead of the playback
       // position, we may as well wait for the playback to catch up. Note the
       // audio push thread acquires and notifies the decoder monitor every time
-      // it pops SoundData off the audio queue. So if the audio push thread pops
-      // the last SoundData off the audio queue right after that queue reported
+      // it pops AudioData off the audio queue. So if the audio push thread pops
+      // the last AudioData off the audio queue right after that queue reported
       // it was non-empty here, we'll receive a notification on the decoder
       // monitor which will wake us up shortly after we sleep, thus preventing
       // both the decode and audio push threads waiting at the same time.
       // See bug 620326.
       mDecodeThreadWaiting = PR_TRUE;
       if (mDecoder->GetState() != nsBuiltinDecoder::PLAY_STATE_PLAYING) {
         // We're not playing, and the decode is about to wait. This means
         // the decode thread may not be needed in future. Signal the state
@@ -511,17 +511,17 @@ void nsBuiltinDecoderStateMachine::Audio
   // monitor held, as on Android those methods do a synchronous dispatch to
   // the main thread. If the audio thread holds the decoder monitor while
   // it does a synchronous dispatch to the main thread, we can get deadlocks
   // if the main thread tries to acquire the decoder monitor before the
   // dispatched event has finished (or even started!) running. Methods which
   // are unsafe to call with the decoder monitor held are documented as such
   // in nsAudioStream.h.
   nsRefPtr<nsAudioStream> audioStream = nsAudioStream::AllocateStream();
-  audioStream->Init(channels, rate, MOZ_SOUND_DATA_FORMAT);
+  audioStream->Init(channels, rate, MOZ_AUDIO_DATA_FORMAT);
 
   {
     // We must hold the monitor while setting mAudioStream or whenever we query
     // the playback position off the audio thread. This ensures the audio stream
     // is always alive when we use it off the audio thread. Note that querying
     // the playback position does not do a synchronous dispatch to the main
     // thread, so it's safe to call with the decoder monitor held.
     ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
@@ -576,17 +576,17 @@ void nsBuiltinDecoderStateMachine::Audio
     }
     if (minWriteSamples == -1) {
       minWriteSamples = mAudioStream->GetMinWriteSamples();
     }
     NS_ASSERTION(mReader->mAudioQueue.GetSize() > 0,
                  "Should have data to play");
     // See if there's missing samples in the audio stream. If there is, push
     // silence into the audio hardware, so we can play across the gap.
-    const SoundData* s = mReader->mAudioQueue.PeekFront();
+    const AudioData* s = mReader->mAudioQueue.PeekFront();
 
     // Calculate the number of samples that have been pushed onto the audio
     // hardware.
     PRInt64 playedSamples = 0;
     if (!UsecsToSamples(audioStartTime, rate, playedSamples)) {
       NS_WARNING("Int overflow converting playedSamples");
       break;
     }
@@ -604,19 +604,19 @@ void nsBuiltinDecoderStateMachine::Audio
     }
     PRInt64 missingSamples = 0;
     if (!AddOverflow(sampleTime, -playedSamples, missingSamples)) {
       NS_WARNING("Int overflow adding missingSamples");
       break;
     }
 
     if (missingSamples > 0) {
-      // The next sound chunk begins some time after the end of the last chunk
-      // we pushed to the sound hardware. We must push silence into the audio
-      // hardware so that the next sound chunk begins playback at the correct
+      // The next audio chunk begins some time after the end of the last chunk
+      // we pushed to the audio hardware. We must push silence into the audio
+      // hardware so that the next audio chunk begins playback at the correct
       // time.
       missingSamples = NS_MIN(static_cast<PRInt64>(PR_UINT32_MAX), missingSamples);
       samplesWritten = PlaySilence(static_cast<PRUint32>(missingSamples),
                                    channels, playedSamples);
     } else {
       samplesWritten = PlayFromAudioQueue(sampleTime, channels);
     }
     audioDuration += samplesWritten;
@@ -664,19 +664,19 @@ void nsBuiltinDecoderStateMachine::Audio
         // We've not written minWriteSamples in the last write, the audio
         // may not start playing. Write silence to ensure we've got enough
         // samples written to start playback.
         PRInt64 samples = minWriteSamples - samplesWritten;
         if (samples < PR_UINT32_MAX / channels) {
           // Write silence manually rather than using PlaySilence(), so that
           // the AudioAPI doesn't get a copy of the samples.
           PRUint32 numValues = samples * channels;
-          nsAutoArrayPtr<SoundDataValue> buf(new SoundDataValue[numValues]);
-          memset(buf.get(), 0, sizeof(SoundDataValue) * numValues);
-          mAudioStream->Write(buf, numValues, PR_TRUE);
+          nsAutoArrayPtr<AudioDataValue> buf(new AudioDataValue[numValues]);
+          memset(buf.get(), 0, sizeof(AudioDataValue) * numValues);
+          mAudioStream->Write(buf, numValues);
         }
       }
 
       PRInt64 oldPosition = -1;
       PRInt64 position = GetMediaTime();
       while (oldPosition != position &&
              mAudioEndTime - position > 0 &&
              mState != DECODER_STATE_SEEKING &&
@@ -722,31 +722,31 @@ PRUint32 nsBuiltinDecoderStateMachine::P
                                                    PRUint64 aSampleOffset)
 
 {
   NS_ASSERTION(OnAudioThread(), "Only call on audio thread.");
   NS_ASSERTION(!mAudioStream->IsPaused(), "Don't play when paused");
   PRUint32 maxSamples = SILENCE_BYTES_CHUNK / aChannels;
   PRUint32 samples = NS_MIN(aSamples, maxSamples);
   PRUint32 numValues = samples * aChannels;
-  nsAutoArrayPtr<SoundDataValue> buf(new SoundDataValue[numValues]);
-  memset(buf.get(), 0, sizeof(SoundDataValue) * numValues);
-  mAudioStream->Write(buf, numValues, PR_TRUE);
+  nsAutoArrayPtr<AudioDataValue> buf(new AudioDataValue[numValues]);
+  memset(buf.get(), 0, sizeof(AudioDataValue) * numValues);
+  mAudioStream->Write(buf, numValues);
   // Dispatch events to the DOM for the audio just written.
   mEventManager.QueueWrittenAudioData(buf.get(), numValues,
                                       (aSampleOffset + samples) * aChannels);
   return samples;
 }
 
 PRUint32 nsBuiltinDecoderStateMachine::PlayFromAudioQueue(PRUint64 aSampleOffset,
                                                           PRUint32 aChannels)
 {
   NS_ASSERTION(OnAudioThread(), "Only call on audio thread.");
   NS_ASSERTION(!mAudioStream->IsPaused(), "Don't play when paused");
-  nsAutoPtr<SoundData> sound(mReader->mAudioQueue.PopFront());
+  nsAutoPtr<AudioData> audioData(mReader->mAudioQueue.PopFront());
   {
     ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
     NS_WARN_IF_FALSE(IsPlaying(), "Should be playing");
     // Awaken the decode loop if it's waiting for space to free up in the
     // audio queue.
     mDecoder->GetReentrantMonitor().NotifyAll();
   }
   PRInt64 offset = -1;
@@ -754,30 +754,29 @@ PRUint32 nsBuiltinDecoderStateMachine::P
   // The state machine could have paused since we've released the decoder
   // monitor and acquired the audio monitor. Rather than acquire both
   // monitors, the audio stream also maintains whether its paused or not.
   // This prevents us from doing a blocking write while holding the audio
   // monitor while paused; we would block, and the state machine won't be
   // able to acquire the audio monitor in order to resume or destroy the
   // audio stream.
   if (!mAudioStream->IsPaused()) {
-    mAudioStream->Write(sound->mAudioData,
-                        sound->AudioDataLength(),
-                        PR_TRUE);
+    mAudioStream->Write(audioData->mAudioData,
+                        audioData->AudioDataLength());
 
-    offset = sound->mOffset;
-    samples = sound->mSamples;
+    offset = audioData->mOffset;
+    samples = audioData->mSamples;
 
     // Dispatch events to the DOM for the audio just written.
-    mEventManager.QueueWrittenAudioData(sound->mAudioData.get(),
-                                        sound->AudioDataLength(),
+    mEventManager.QueueWrittenAudioData(audioData->mAudioData.get(),
+                                        audioData->AudioDataLength(),
                                         (aSampleOffset + samples) * aChannels);
   } else {
-    mReader->mAudioQueue.PushFront(sound);
-    sound.forget();
+    mReader->mAudioQueue.PushFront(audioData);
+    audioData.forget();
   }
   if (offset != -1) {
     mDecoder->UpdatePlaybackOffset(offset);
   }
   return samples;
 }
 
 nsresult nsBuiltinDecoderStateMachine::Init(nsDecoderStateMachine* aCloneDonor)
@@ -1308,17 +1307,17 @@ void nsBuiltinDecoderStateMachine::Decod
       // Now perform the seek. We must not hold the state machine monitor
       // while we seek, since the seek reads, which could block on I/O.
       res = mReader->Seek(seekTime,
                           mStartTime,
                           mEndTime,
                           mediaTime);
     }
     if (NS_SUCCEEDED(res)) {
-      SoundData* audio = HasAudio() ? mReader->mAudioQueue.PeekFront() : nsnull;
+      AudioData* audio = HasAudio() ? mReader->mAudioQueue.PeekFront() : nsnull;
       NS_ASSERTION(!audio || (audio->mTime <= seekTime &&
                               seekTime <= audio->mTime + audio->mDuration),
                     "Seek target should lie inside the first audio block after seek");
       PRInt64 startTime = (audio && audio->mTime < seekTime) ? audio->mTime : seekTime;
       mAudioStartTime = startTime;
       mPlayDuration = startTime - mStartTime;
       if (HasVideo()) {
         nsAutoPtr<VideoData> video(mReader->mVideoQueue.PeekFront());
@@ -1645,17 +1644,17 @@ void nsBuiltinDecoderStateMachine::Advan
     PRInt64 audio_time = GetAudioClock();
     if (HasAudio() && !mAudioCompleted && audio_time != -1) {
       clock_time = audio_time;
       // Resync against the audio clock, while we're trusting the
       // audio clock. This ensures no "drift", particularly on Linux.
       mPlayDuration = clock_time - mStartTime;
       mPlayStartTime = TimeStamp::Now();
     } else {
-      // Sound is disabled on this system. Sync to the system clock.
+      // Audio hardware is disabled on this system. Sync to the system clock.
       clock_time = DurationToUsecs(TimeStamp::Now() - mPlayStartTime) + mPlayDuration;
       // Ensure the clock can never go backwards.
       NS_ASSERTION(mCurrentFrameTime <= clock_time, "Clock should go forwards");
       clock_time = NS_MAX(mCurrentFrameTime, clock_time) + mStartTime;
     }
   }
 
   // Skip frames up to the frame at the playback position, and figure out
--- a/content/media/nsBuiltinDecoderStateMachine.h
+++ b/content/media/nsBuiltinDecoderStateMachine.h
@@ -81,33 +81,33 @@ Frame skipping is done in the following 
           will be decoding video data that won't be displayed due
           to the decode thread dropping the frame immediately.
 
 When hardware accelerated graphics is not available, YCbCr conversion
 is done on the decode thread when video frames are decoded.
 
 The decode thread pushes decoded audio and videos frames into two
 separate queues - one for audio and one for video. These are kept
-separate to make it easy to constantly feed audio data to the sound
+separate to make it easy to constantly feed audio data to the audio
 hardware while allowing frame skipping of video data. These queues are
 threadsafe, and neither the decode, audio, or state machine should
 be able to monopolize them, and cause starvation of the other threads.
 
 Both queues are bounded by a maximum size. When this size is reached
 the decode thread will no longer decode video or audio depending on the
 queue that has reached the threshold. If both queues are full, the decode
 thread will wait on the decoder monitor.
 
 When the decode queues are full (they've reaced their maximum size) and
 the decoder is not in PLAYING play state, the state machine may opt
 to shut down the decode thread in order to conserve resources.
 
 During playback the audio thread will be idle (via a Wait() on the
 monitor) if the audio queue is empty. Otherwise it constantly pops
-sound data off the queue and plays it with a blocking write to the audio
+audio data off the queue and plays it with a blocking write to the audio
 hardware (via nsAudioStream and libsydneyaudio).
 
 */
 #if !defined(nsBuiltinDecoderStateMachine_h__)
 #define nsBuiltinDecoderStateMachine_h__
 
 #include "prmem.h"
 #include "nsThreadUtils.h"
@@ -355,17 +355,17 @@ protected:
   // hardware. This ensures that the playback position advances smoothly, and
   // guarantees that we don't try to allocate an impossibly large chunk of
   // memory in order to play back silence. Called on the audio thread.
   PRUint32 PlaySilence(PRUint32 aSamples,
                        PRUint32 aChannels,
                        PRUint64 aSampleOffset);
 
   // Pops an audio chunk from the front of the audio queue, and pushes its
-  // sound data to the audio hardware. MozAudioAvailable sample data is also
+  // audio data to the audio hardware. MozAudioAvailable sample data is also
   // queued here. Called on the audio thread.
   PRUint32 PlayFromAudioQueue(PRUint64 aSampleOffset, PRUint32 aChannels);
 
   // Stops the decode thread. The decoder monitor must be held with exactly
   // one lock count. Called on the state machine thread.
   void StopDecodeThread();
 
   // Stops the audio thread. The decoder monitor must be held with exactly
--- a/content/media/ogg/nsOggReader.cpp
+++ b/content/media/ogg/nsOggReader.cpp
@@ -362,27 +362,27 @@ nsresult nsOggReader::DecodeVorbis(ogg_p
   }
 
   VorbisPCMValue** pcm = 0;
   PRInt32 samples = 0;
   PRUint32 channels = mVorbisState->mInfo.channels;
   ogg_int64_t endSample = aPacket->granulepos;
   while ((samples = vorbis_synthesis_pcmout(&mVorbisState->mDsp, &pcm)) > 0) {
     mVorbisState->ValidateVorbisPacketSamples(aPacket, samples);
-    nsAutoArrayPtr<SoundDataValue> buffer(new SoundDataValue[samples * channels]);
+    nsAutoArrayPtr<AudioDataValue> buffer(new AudioDataValue[samples * channels]);
     for (PRUint32 j = 0; j < channels; ++j) {
       VorbisPCMValue* channel = pcm[j];
       for (PRUint32 i = 0; i < PRUint32(samples); ++i) {
         buffer[i*channels + j] = MOZ_CONVERT_VORBIS_SAMPLE(channel[i]);
       }
     }
 
     PRInt64 duration = mVorbisState->Time((PRInt64)samples);
     PRInt64 startTime = mVorbisState->Time(endSample - samples);
-    mAudioQueue.Push(new SoundData(mPageOffset,
+    mAudioQueue.Push(new AudioData(mPageOffset,
                                    startTime,
                                    duration,
                                    samples,
                                    buffer.forget(),
                                    channels));
     endSample -= samples;
     if (vorbis_synthesis_read(&mVorbisState->mDsp, samples) != 0) {
       return NS_ERROR_FAILURE;
--- a/content/media/test/test_replay_metadata.html
+++ b/content/media/test/test_replay_metadata.html
@@ -60,17 +60,16 @@ function playbackEnded(evt) {
   ok(v.currentTime >= v.duration-0.1 && v.currentTime <= v.duration + 0.1,
      "CurrentTime (" + v.currentTime + ") should be around " + v.duration
       + " for " + v._name);
   if (!v._playedOnce) {
     v.currentTime = 0;
     ok(v.seeking, "seeking should be true for " + v._name);
     ok(!v.ended, "ended shouldn't be true once seeking has begun for " + v._name);
     v._playedOnce = true;
-    v.play();
   } else {
     ok(v._gotSeekEnded, "Should have received seekended for " + v._name);
     ok(v._gotSeekStarted, "Should have received seekstarted for " + v._name);
     is(v._loadedDataCount, 1, "Should have 1 onloadeddata event for " + v._name);
     is(v._loadedMetaDataCount, 1, "Should have 1 onloadedmetadata event for " + v._name);
     is(v._endCount, 2, "Should have received two ended events for " + v._name);
     ok(v._playingCount > 0, "Should have at least one playing event for " + v._name);
     v._finished = true;
--- a/content/media/wave/nsWaveReader.cpp
+++ b/content/media/wave/nsWaveReader.cpp
@@ -182,31 +182,31 @@ PRBool nsWaveReader::DecodeAudioData()
   PRInt64 len = GetDataLength();
   PRInt64 remaining = len - pos;
   NS_ASSERTION(remaining >= 0, "Current wave position is greater than wave file length");
 
   static const PRInt64 BLOCK_SIZE = 4096;
   PRInt64 readSize = NS_MIN(BLOCK_SIZE, remaining);
   PRInt64 samples = readSize / mSampleSize;
 
-  PR_STATIC_ASSERT(PRUint64(BLOCK_SIZE) < UINT_MAX / sizeof(SoundDataValue) / MAX_CHANNELS);
+  PR_STATIC_ASSERT(PRUint64(BLOCK_SIZE) < UINT_MAX / sizeof(AudioDataValue) / MAX_CHANNELS);
   const size_t bufferSize = static_cast<size_t>(samples * mChannels);
-  nsAutoArrayPtr<SoundDataValue> sampleBuffer(new SoundDataValue[bufferSize]);
+  nsAutoArrayPtr<AudioDataValue> sampleBuffer(new AudioDataValue[bufferSize]);
 
   PR_STATIC_ASSERT(PRUint64(BLOCK_SIZE) < UINT_MAX / sizeof(char));
   nsAutoArrayPtr<char> dataBuffer(new char[static_cast<size_t>(readSize)]);
 
   if (!ReadAll(dataBuffer, readSize)) {
     mAudioQueue.Finish();
     return PR_FALSE;
   }
 
   // convert data to samples
   const char* d = dataBuffer.get();
-  SoundDataValue* s = sampleBuffer.get();
+  AudioDataValue* s = sampleBuffer.get();
   for (int i = 0; i < samples; ++i) {
     for (unsigned int j = 0; j < mChannels; ++j) {
       if (mSampleFormat == nsAudioStream::FORMAT_U8) {
         PRUint8 v =  ReadUint8(&d);
 #if defined(MOZ_SAMPLE_TYPE_S16LE)
         *s++ = (v * (1.F/PR_UINT8_MAX)) * PR_UINT16_MAX + PR_INT16_MIN;
 #elif defined(MOZ_SAMPLE_TYPE_FLOAT32)
         *s++ = (v * (1.F/PR_UINT8_MAX)) * 2.F - 1.F;
@@ -224,17 +224,17 @@ PRBool nsWaveReader::DecodeAudioData()
   }
 
   double posTime = BytesToTime(pos);
   double readSizeTime = BytesToTime(readSize);
   NS_ASSERTION(posTime <= PR_INT64_MAX / USECS_PER_S, "posTime overflow");
   NS_ASSERTION(readSizeTime <= PR_INT64_MAX / USECS_PER_S, "readSizeTime overflow");
   NS_ASSERTION(samples < PR_INT32_MAX, "samples overflow");
 
-  mAudioQueue.Push(new SoundData(pos,
+  mAudioQueue.Push(new AudioData(pos,
                                  static_cast<PRInt64>(posTime * USECS_PER_S),
                                  static_cast<PRInt64>(readSizeTime * USECS_PER_S),
                                  static_cast<PRInt32>(samples),
                                  sampleBuffer.forget(),
                                  mChannels));
 
   return PR_TRUE;
 }
--- a/content/media/webm/nsWebMReader.cpp
+++ b/content/media/webm/nsWebMReader.cpp
@@ -426,18 +426,18 @@ PRBool nsWebMReader::DecodeAudioPacket(n
 
   const PRUint32 rate = mVorbisDsp.vi->rate;
   PRUint64 tstamp_usecs = tstamp / NS_PER_USEC;
   if (mAudioStartUsec == -1) {
     // This is the first audio chunk. Assume the start time of our decode
     // is the start of this chunk.
     mAudioStartUsec = tstamp_usecs;
   }
-  // If there's a gap between the start of this sound chunk and the end of
-  // the previous sound chunk, we need to increment the packet count so that
+  // If there's a gap between the start of this audio chunk and the end of
+  // the previous audio chunk, we need to increment the packet count so that
   // the vorbis decode doesn't use data from before the gap to help decode
   // from after the gap.
   PRInt64 tstamp_samples = 0;
   if (!UsecsToSamples(tstamp_usecs, rate, tstamp_samples)) {
     NS_WARNING("Int overflow converting WebM timestamp to samples");
     return PR_FALSE;
   }
   PRInt64 decoded_samples = 0;
@@ -479,17 +479,17 @@ PRBool nsWebMReader::DecodeAudioPacket(n
     if (vorbis_synthesis_blockin(&mVorbisDsp,
                                  &mVorbisBlock) != 0) {
       return PR_FALSE;
     }
 
     VorbisPCMValue** pcm = 0;
     PRInt32 samples = 0;
     while ((samples = vorbis_synthesis_pcmout(&mVorbisDsp, &pcm)) > 0) {
-      nsAutoArrayPtr<SoundDataValue> buffer(new SoundDataValue[samples * mChannels]);
+      nsAutoArrayPtr<AudioDataValue> buffer(new AudioDataValue[samples * mChannels]);
       for (PRUint32 j = 0; j < mChannels; ++j) {
         VorbisPCMValue* channel = pcm[j];
         for (PRUint32 i = 0; i < PRUint32(samples); ++i) {
           buffer[i*mChannels + j] = MOZ_CONVERT_VORBIS_SAMPLE(channel[i]);
         }
       }
 
       PRInt64 duration = 0;
@@ -500,17 +500,17 @@ PRBool nsWebMReader::DecodeAudioPacket(n
       PRInt64 total_duration = 0;
       if (!SamplesToUsecs(total_samples, rate, total_duration)) {
         NS_WARNING("Int overflow converting WebM audio total_duration");
         return PR_FALSE;
       }
       
       PRInt64 time = tstamp_usecs + total_duration;
       total_samples += samples;
-      mAudioQueue.Push(new SoundData(aOffset,
+      mAudioQueue.Push(new AudioData(aOffset,
                                      time,
                                      duration,
                                      samples,
                                      buffer.forget(),
                                      mChannels));
       mAudioSamples += samples;
       if (vorbis_synthesis_read(&mVorbisDsp, samples) != 0) {
         return PR_FALSE;
--- a/content/xul/content/public/nsIXULContextMenuBuilder.idl
+++ b/content/xul/content/public/nsIXULContextMenuBuilder.idl
@@ -38,36 +38,32 @@
 
 interface nsIDOMDocumentFragment;
 
 /**
  * An interface for initialization of XUL context menu builder
  * and for triggering of menuitem actions with assigned identifiers.
  */
 
-[scriptable, uuid(f0c35053-14cc-4e23-a9db-f9a68fae8375)]
+[scriptable, uuid(eb6b42c0-2f1c-4760-b5ca-bdc9b3ec77d4)]
 interface nsIXULContextMenuBuilder : nsISupports
 {
 
   /**
    * Initialize builder before building.
    *
    * @param aDocumentFragment the fragment that will be used to append top
    *        level elements
    *
-   * @param aGeneratedAttrName the name of the attribute that will be used
-   *        to mark elements as generated.
-   *
-   * @param aIdentAttrName the name of the attribute that will be used for
-   *        menuitem identification.
+   * @param aGeneratedItemIdAttrName the name of the attribute that will be
+   *        used to mark elements as generated and for menuitem identification
    */
   void init(in nsIDOMDocumentFragment aDocumentFragment,
-            in AString aGeneratedAttrName,
-            in AString aIdentAttrName);
+            in AString aGeneratedItemIdAttrName);
 
   /**
-   * Invoke the action of the menuitem with assigned identifier aIdent.
+   * Invoke the action of the menuitem with assigned id aGeneratedItemId.
    *
-   * @param aIdent the menuitem identifier
+   * @param aGeneratedItemId the menuitem id
    */
-  void click(in DOMString aIdent);
+  void click(in DOMString aGeneratedItemId);
 
 };
--- a/content/xul/content/src/nsXULContextMenuBuilder.cpp
+++ b/content/xul/content/src/nsXULContextMenuBuilder.cpp
@@ -36,17 +36,17 @@
 
 #include "nsContentCreatorFunctions.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMHTMLMenuItemElement.h"
 #include "nsXULContextMenuBuilder.h"
 
 
 nsXULContextMenuBuilder::nsXULContextMenuBuilder()
-  : mCurrentIdent(0)
+  : mCurrentGeneratedItemId(0)
 {
 }
 
 nsXULContextMenuBuilder::~nsXULContextMenuBuilder()
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULContextMenuBuilder)
@@ -80,23 +80,24 @@ nsXULContextMenuBuilder::OpenContainer(c
   if (!mFragment) {
     return NS_ERROR_NOT_INITIALIZED;
   }
 
   if (!mCurrentNode) {
     mCurrentNode = mFragment;
   } else {
     nsCOMPtr<nsIContent> menu;
-    nsresult rv = CreateElement(nsGkAtoms::menu, getter_AddRefs(menu));
+    nsresult rv = CreateElement(nsGkAtoms::menu, nsnull, getter_AddRefs(menu));
     NS_ENSURE_SUCCESS(rv, rv);
 
     menu->SetAttr(kNameSpaceID_None, nsGkAtoms::label, aLabel, PR_FALSE);
 
     nsCOMPtr<nsIContent> menuPopup;
-    rv = CreateElement(nsGkAtoms::menupopup, getter_AddRefs(menuPopup));
+    rv = CreateElement(nsGkAtoms::menupopup, nsnull,
+                       getter_AddRefs(menuPopup));
     NS_ENSURE_SUCCESS(rv, rv);
         
     rv = menu->AppendChildTo(menuPopup, PR_FALSE);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = mCurrentNode->AppendChildTo(menu, PR_FALSE);
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -110,17 +111,18 @@ NS_IMETHODIMP
 nsXULContextMenuBuilder::AddItemFor(nsIDOMHTMLMenuItemElement* aElement,
                                     PRBool aCanLoadIcon)
 {
   if (!mFragment) {
     return NS_ERROR_NOT_INITIALIZED;
   }
 
   nsCOMPtr<nsIContent> menuitem;
-  nsresult rv = CreateElement(nsGkAtoms::menuitem, getter_AddRefs(menuitem));
+  nsresult rv = CreateElement(nsGkAtoms::menuitem, aElement,
+                              getter_AddRefs(menuitem));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString type;
   aElement->GetType(type);
   if (type.EqualsLiteral("checkbox") || type.EqualsLiteral("radio")) {
     // The menu is only temporary, so we don't need to handle
     // the radio type precisely.
     menuitem->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
@@ -149,38 +151,28 @@ nsXULContextMenuBuilder::AddItemFor(nsID
 
   PRBool disabled;
   aElement->GetDisabled(&disabled);
   if (disabled) {
     menuitem->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled,
                       NS_LITERAL_STRING("true"), PR_FALSE);
   }
 
-  nsAutoString ident;
-  ident.AppendInt(mCurrentIdent++);
-
-  menuitem->SetAttr(kNameSpaceID_None, mIdentAttr, ident, PR_FALSE);
-
-  rv = mCurrentNode->AppendChildTo(menuitem, PR_FALSE);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  mElements.AppendObject(aElement);
-
-  return NS_OK;
+  return mCurrentNode->AppendChildTo(menuitem, PR_FALSE);
 }
 
 NS_IMETHODIMP
 nsXULContextMenuBuilder::AddSeparator()
 {
   if (!mFragment) {
     return NS_ERROR_NOT_INITIALIZED;
   }
 
   nsCOMPtr<nsIContent> menuseparator;
-  nsresult rv = CreateElement(nsGkAtoms::menuseparator,
+  nsresult rv = CreateElement(nsGkAtoms::menuseparator, nsnull,
                               getter_AddRefs(menuseparator));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return mCurrentNode->AppendChildTo(menuseparator, PR_FALSE);
 }
 
 NS_IMETHODIMP
 nsXULContextMenuBuilder::UndoAddSeparator()
@@ -213,56 +205,63 @@ nsXULContextMenuBuilder::CloseContainer(
   }
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsXULContextMenuBuilder::Init(nsIDOMDocumentFragment* aDocumentFragment,
-                              const nsAString& aGeneratedAttrName,
-                              const nsAString& aIdentAttrName)
+                              const nsAString& aGeneratedItemIdAttrName)
 {
   NS_ENSURE_ARG_POINTER(aDocumentFragment);
 
   mFragment = do_QueryInterface(aDocumentFragment);
   mDocument = mFragment->GetOwnerDocument();
-  mGeneratedAttr = do_GetAtom(aGeneratedAttrName);
-  mIdentAttr = do_GetAtom(aIdentAttrName);
+  mGeneratedItemIdAttr = do_GetAtom(aGeneratedItemIdAttrName);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULContextMenuBuilder::Click(const nsAString& aIdent)
+nsXULContextMenuBuilder::Click(const nsAString& aGeneratedItemId)
 {
   PRInt32 rv;
-  PRInt32 idx = nsString(aIdent).ToInteger(&rv);
+  PRInt32 idx = nsString(aGeneratedItemId).ToInteger(&rv);
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsIDOMHTMLElement> element = mElements.SafeObjectAt(idx);
     if (element) {
       element->Click();
     }
   }
 
   return NS_OK;
 }
 
 nsresult
-nsXULContextMenuBuilder::CreateElement(nsIAtom* aTag, nsIContent** aResult)
+nsXULContextMenuBuilder::CreateElement(nsIAtom* aTag,
+                                       nsIDOMHTMLElement* aHTMLElement,
+                                       nsIContent** aResult)
 {
   *aResult = nsnull;
 
   nsCOMPtr<nsINodeInfo> nodeInfo = mDocument->NodeInfoManager()->GetNodeInfo(
     aTag, nsnull, kNameSpaceID_XUL, nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   nsresult rv = NS_NewElement(aResult, kNameSpaceID_XUL, nodeInfo.forget(),
                               mozilla::dom::NOT_FROM_PARSER);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  (*aResult)->SetAttr(kNameSpaceID_None, mGeneratedAttr, EmptyString(),
+  nsAutoString generateditemid;
+
+  if (aHTMLElement) {
+    mElements.AppendObject(aHTMLElement);
+    generateditemid.AppendInt(mCurrentGeneratedItemId++);
+  }
+
+  (*aResult)->SetAttr(kNameSpaceID_None, mGeneratedItemIdAttr, generateditemid,
                       PR_FALSE);
 
   return NS_OK;
 }
--- a/content/xul/content/src/nsXULContextMenuBuilder.h
+++ b/content/xul/content/src/nsXULContextMenuBuilder.h
@@ -52,20 +52,21 @@ public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULContextMenuBuilder,
                                            nsIMenuBuilder)
   NS_DECL_NSIMENUBUILDER
 
   NS_DECL_NSIXULCONTEXTMENUBUILDER
 
 protected:
-  nsresult CreateElement(nsIAtom* aTag, nsIContent** aResult);
+  nsresult CreateElement(nsIAtom* aTag,
+                         nsIDOMHTMLElement* aHTMLElement,
+                         nsIContent** aResult);
 
   nsCOMPtr<nsIContent>          mFragment;
   nsCOMPtr<nsIDocument>         mDocument;
-  nsCOMPtr<nsIAtom>             mGeneratedAttr;
-  nsCOMPtr<nsIAtom>             mIdentAttr;
+  nsCOMPtr<nsIAtom>             mGeneratedItemIdAttr;
 
   nsCOMPtr<nsIContent>          mCurrentNode;
-  PRInt32                       mCurrentIdent;
+  PRInt32                       mCurrentGeneratedItemId;
 
   nsCOMArray<nsIDOMHTMLElement> mElements;
 };
--- a/dom/ipc/AudioParent.cpp
+++ b/dom/ipc/AudioParent.cpp
@@ -52,17 +52,17 @@ class AudioWriteEvent : public nsRunnabl
   {
     mOwner = owner;
     mData  = data;
     mCount = count;
   }
 
   NS_IMETHOD Run()
   {
-    mOwner->Write(mData.get(), mCount, true);
+    mOwner->Write(mData.get(), mCount);
     return NS_OK;
   }
 
  private:
     nsRefPtr<nsAudioStream> mOwner;
     nsCString mData;
     PRUint32  mCount;
 };
--- a/editor/composer/src/nsComposerCommands.cpp
+++ b/editor/composer/src/nsComposerCommands.cpp
@@ -99,17 +99,20 @@ nsBaseStateUpdatingCommand::~nsBaseState
 NS_IMPL_ISUPPORTS_INHERITED0(nsBaseStateUpdatingCommand, nsBaseComposerCommand)
 
 NS_IMETHODIMP
 nsBaseStateUpdatingCommand::IsCommandEnabled(const char *aCommandName,
                                              nsISupports *refCon,
                                              PRBool *outCmdEnabled)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
-  *outCmdEnabled = editor ? PR_TRUE : PR_FALSE;
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsBaseStateUpdatingCommand::DoCommand(const char *aCommandName,
                                       nsISupports *refCon)
 {
@@ -422,29 +425,34 @@ nsListItemCommand::ToggleState(nsIEditor
 NS_IMETHODIMP
 nsRemoveListCommand::IsCommandEnabled(const char * aCommandName,
                                       nsISupports *refCon,
                                       PRBool *outCmdEnabled)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   if (editor)
   {
-    // It is enabled if we are in any list type
-    PRBool bMixed;
-    PRUnichar *tagStr;
-    nsresult rv = GetListState(editor, &bMixed, &tagStr);
-    NS_ENSURE_SUCCESS(rv, rv);
+    PRBool isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+    {
+      // It is enabled if we are in any list type
+      PRBool bMixed;
+      PRUnichar *tagStr;
+      nsresult rv = GetListState(editor, &bMixed, &tagStr);
+      NS_ENSURE_SUCCESS(rv, rv);
 
-    *outCmdEnabled = bMixed ? PR_TRUE : (tagStr && *tagStr);
-    
-    if (tagStr) NS_Free(tagStr);
+      *outCmdEnabled = bMixed ? PR_TRUE : (tagStr && *tagStr);
+      
+      if (tagStr) NS_Free(tagStr);
+      return NS_OK;
+    }
   }
-  else
-    *outCmdEnabled = PR_FALSE;
 
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsRemoveListCommand::DoCommand(const char *aCommandName, nsISupports *refCon)
 {
   nsCOMPtr<nsIHTMLEditor> editor = do_QueryInterface(refCon);
@@ -476,18 +484,21 @@ nsRemoveListCommand::GetCommandStatePara
   IsCommandEnabled(aCommandName, refCon, &outCmdEnabled);
   return aParams->SetBooleanValue(STATE_ENABLED,outCmdEnabled);
 }
 
 NS_IMETHODIMP
 nsIndentCommand::IsCommandEnabled(const char * aCommandName,
                                   nsISupports *refCon, PRBool *outCmdEnabled)
 {
-  nsCOMPtr<nsIHTMLEditor> editor = do_QueryInterface(refCon);
-  *outCmdEnabled = editor ? PR_TRUE : PR_FALSE;
+  nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsIndentCommand::DoCommand(const char *aCommandName, nsISupports *refCon)
 {
   nsCOMPtr<nsIHTMLEditor> editor = do_QueryInterface(refCon);
@@ -522,26 +533,27 @@ nsIndentCommand::GetCommandStateParams(c
 
 //OUTDENT
 
 NS_IMETHODIMP
 nsOutdentCommand::IsCommandEnabled(const char * aCommandName,
                                    nsISupports *refCon,
                                    PRBool *outCmdEnabled)
 {
+  nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(refCon);
-  if (htmlEditor)
+  if (editor && htmlEditor)
   {
-    PRBool canIndent, canOutdent;
-    htmlEditor->GetIndentState(&canIndent, &canOutdent);
-    *outCmdEnabled = canOutdent;
+    PRBool canIndent, isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+      return htmlEditor->GetIndentState(&canIndent, outCmdEnabled);
   }
-  else
-    *outCmdEnabled = PR_FALSE;
 
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsOutdentCommand::DoCommand(const char *aCommandName, nsISupports *refCon)
 {
   nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(refCon);
@@ -582,17 +594,20 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsMultiStat
 
 NS_IMETHODIMP
 nsMultiStateCommand::IsCommandEnabled(const char * aCommandName,
                                       nsISupports *refCon,
                                       PRBool *outCmdEnabled)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   // should be disabled sometimes, like if the current selection is an image
-  *outCmdEnabled = editor ? PR_TRUE : PR_FALSE;
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK; 
 }
 
 
 NS_IMETHODIMP
 nsMultiStateCommand::DoCommand(const char *aCommandName, nsISupports *refCon)
 {
 #ifdef DEBUG
@@ -912,18 +927,21 @@ nsHighlightColorStateCommand::SetState(n
   return rv;
 }
 
 NS_IMETHODIMP
 nsHighlightColorStateCommand::IsCommandEnabled(const char * aCommandName,
                                                nsISupports *refCon,
                                                PRBool *outCmdEnabled)
 {
-  nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(refCon);
-  *outCmdEnabled = htmlEditor ? PR_TRUE : PR_FALSE;
+  nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 nsBackgroundColorStateCommand::nsBackgroundColorStateCommand()
 : nsMultiStateCommand()
 {
 }
@@ -1021,24 +1039,29 @@ nsAlignCommand::SetState(nsIEditor *aEdi
 nsAbsolutePositioningCommand::nsAbsolutePositioningCommand()
 : nsBaseStateUpdatingCommand("")
 {
 }
 
 NS_IMETHODIMP
 nsAbsolutePositioningCommand::IsCommandEnabled(const char * aCommandName,
                                                nsISupports *aCommandRefCon,
-                                               PRBool *_retval)
+                                               PRBool *outCmdEnabled)
 {
-  NS_ASSERTION(aCommandRefCon, "Need an editor here");
-  
+  nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   nsCOMPtr<nsIHTMLAbsPosEditor> htmlEditor = do_QueryInterface(aCommandRefCon);
-  NS_ENSURE_TRUE(htmlEditor, NS_ERROR_FAILURE);
+  if (htmlEditor)
+  {
+    PRBool isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+      return htmlEditor->GetAbsolutePositioningEnabled(outCmdEnabled);
+  }
 
-  htmlEditor->GetAbsolutePositioningEnabled(_retval);
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 nsresult
 nsAbsolutePositioningCommand::GetCurrentState(nsIEditor *aEditor, const char* aTagName, nsICommandParams *aParams)
 {
   NS_ASSERTION(aEditor, "Need an editor here");
   
@@ -1199,17 +1222,20 @@ nsIncreaseZIndexCommand::GetCommandState
 
 NS_IMETHODIMP
 nsRemoveStylesCommand::IsCommandEnabled(const char * aCommandName,
                                         nsISupports *refCon,
                                         PRBool *outCmdEnabled)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   // test if we have any styles?
-  *outCmdEnabled = editor ? PR_TRUE : PR_FALSE;
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 
 NS_IMETHODIMP
 nsRemoveStylesCommand::DoCommand(const char *aCommandName,
                                  nsISupports *refCon)
@@ -1244,18 +1270,21 @@ nsRemoveStylesCommand::GetCommandStatePa
 }
 
 NS_IMETHODIMP
 nsIncreaseFontSizeCommand::IsCommandEnabled(const char * aCommandName,
                                             nsISupports *refCon,
                                             PRBool *outCmdEnabled)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
-  // test if we have any styles?
-  *outCmdEnabled = editor ? PR_TRUE : PR_FALSE;
+  // test if we are at max size?
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsIncreaseFontSizeCommand::DoCommand(const char *aCommandName,
                                      nsISupports *refCon)
 {
@@ -1290,17 +1319,20 @@ nsIncreaseFontSizeCommand::GetCommandSta
 
 NS_IMETHODIMP
 nsDecreaseFontSizeCommand::IsCommandEnabled(const char * aCommandName,
                                             nsISupports *refCon,
                                             PRBool *outCmdEnabled)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   // test if we are at min size?
-  *outCmdEnabled = editor ? PR_TRUE : PR_FALSE;
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsDecreaseFontSizeCommand::DoCommand(const char *aCommandName,
                                      nsISupports *refCon)
 {
@@ -1334,18 +1366,21 @@ nsDecreaseFontSizeCommand::GetCommandSta
 }
 
 NS_IMETHODIMP
 nsInsertHTMLCommand::IsCommandEnabled(const char * aCommandName,
                                       nsISupports *refCon,
                                       PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
-  nsCOMPtr<nsIHTMLEditor> editor = do_QueryInterface(refCon);
-  *outCmdEnabled = editor ? PR_TRUE : PR_FALSE;
+  nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsInsertHTMLCommand::DoCommand(const char *aCommandName, nsISupports *refCon)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
@@ -1399,18 +1434,21 @@ nsInsertTagCommand::~nsInsertTagCommand(
 }
 
 NS_IMETHODIMP
 nsInsertTagCommand::IsCommandEnabled(const char * aCommandName,
                                      nsISupports *refCon,
                                      PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
-  nsCOMPtr<nsIHTMLEditor> editor = do_QueryInterface(refCon);
-  *outCmdEnabled = editor ? PR_TRUE : PR_FALSE;
+  nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 // corresponding STATE_ATTRIBUTE is: src (img) and href (a) 
 NS_IMETHODIMP
 nsInsertTagCommand::DoCommand(const char *aCmdName, nsISupports *refCon)
 {
--- a/editor/composer/src/nsComposerDocumentCommands.cpp
+++ b/editor/composer/src/nsComposerDocumentCommands.cpp
@@ -87,18 +87,21 @@ GetPresContextFromEditor(nsIEditor *aEdi
 }
 
 NS_IMETHODIMP
 nsSetDocumentOptionsCommand::IsCommandEnabled(const char * aCommandName,
                                               nsISupports *refCon,
                                               PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
-  nsCOMPtr<nsIHTMLEditor> editor = do_QueryInterface(refCon);
-  *outCmdEnabled = (editor != nsnull);
+  nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSetDocumentOptionsCommand::DoCommand(const char *aCommandName,
                                        nsISupports *refCon)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
@@ -213,17 +216,20 @@ nsSetDocumentOptionsCommand::GetCommandS
 
 NS_IMETHODIMP
 nsSetDocumentStateCommand::IsCommandEnabled(const char * aCommandName,
                                             nsISupports *refCon,
                                             PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
-  *outCmdEnabled = (editor != nsnull);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSetDocumentStateCommand::DoCommand(const char *aCommandName,
                                      nsISupports *refCon)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
--- a/editor/idl/nsIEditor.idl
+++ b/editor/idl/nsIEditor.idl
@@ -50,17 +50,17 @@ interface nsIDocumentStateListener;
 interface nsIOutputStream;
 interface nsITransactionManager;
 interface nsITransaction;
 interface nsIEditorObserver;
 interface nsIEditActionListener;
 interface nsIInlineSpellChecker;
 interface nsITransferable;
 
-[scriptable, uuid(bd5d93f0-6451-11e0-ae3e-0800200c9a66)]
+[scriptable, uuid(20ee0b70-c528-11e0-9572-0800200c9a66)]
 
 interface nsIEditor  : nsISupports
 {
 %{C++
   typedef short EDirection;
 %}
   const short eNone = 0;
   const short eNext = 1;
@@ -117,16 +117,19 @@ interface nsIEditor  : nsISupports
   /**
    * the MimeType of the document
    */
   attribute string contentsMIMEType;
 
   /** Returns true if we have a document that is not marked read-only */
   readonly attribute boolean isDocumentEditable;
 
+  /** Returns true if the current selection anchor is editable */
+  readonly attribute boolean isSelectionEditable;
+
   /**
    * the DOM Document this editor is associated with, refcounted.
    */
   readonly attribute nsIDOMDocument document;
 
   /** the body element, i.e. the root of the editable document.
    */
   readonly attribute  nsIDOMElement rootElement;
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -481,16 +481,36 @@ nsEditor::SetFlags(PRUint32 aFlags)
       nsIMEStateManager::UpdateIMEState(newState, focusedContent);
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsEditor::GetIsSelectionEditable(PRBool *aIsSelectionEditable)
+{
+  NS_ENSURE_ARG_POINTER(aIsSelectionEditable);
+
+  // get current selection
+  nsCOMPtr<nsISelection> selection;
+  nsresult res = GetSelection(getter_AddRefs(selection));
+  NS_ENSURE_SUCCESS(res, res);
+  NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
+
+  // XXX we just check that the anchor node is editable at the moment
+  //     we should check that all nodes in the selection are editable
+  nsCOMPtr<nsIDOMNode> anchorNode;
+  selection->GetAnchorNode(getter_AddRefs(anchorNode));
+  *aIsSelectionEditable = anchorNode && IsEditable(anchorNode);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsEditor::GetIsDocumentEditable(PRBool *aIsDocumentEditable)
 {
   NS_ENSURE_ARG_POINTER(aIsDocumentEditable);
   nsCOMPtr<nsIDOMDocument> doc;
   GetDocument(getter_AddRefs(doc));
   *aIsDocumentEditable = doc ? PR_TRUE : PR_FALSE;
 
   return NS_OK;
@@ -750,17 +770,16 @@ nsEditor::Undo(PRUint32 aCount)
       if (NS_SUCCEEDED(result))
         result = DoAfterUndoTransaction();
           
       if (NS_FAILED(result))
         break;
     }
   }
 
-  NotifyEditorObservers();  
   return result;
 }
 
 
 NS_IMETHODIMP nsEditor::CanUndo(PRBool *aIsEnabled, PRBool *aCanUndo)
 {
   NS_ENSURE_TRUE(aIsEnabled && aCanUndo, NS_ERROR_NULL_POINTER);
   *aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr.get()));
@@ -802,17 +821,16 @@ nsEditor::Redo(PRUint32 aCount)
       if (NS_SUCCEEDED(result))
         result = DoAfterRedoTransaction();
 
       if (NS_FAILED(result))
         break;
     }
   }
 
-  NotifyEditorObservers();  
   return result;
 }
 
 
 NS_IMETHODIMP nsEditor::CanRedo(PRBool *aIsEnabled, PRBool *aCanRedo)
 {
   NS_ENSURE_TRUE(aIsEnabled && aCanRedo, NS_ERROR_NULL_POINTER);
 
--- a/editor/libeditor/base/nsEditorCommands.cpp
+++ b/editor/libeditor/base/nsEditorCommands.cpp
@@ -65,18 +65,20 @@ NS_IMETHODIMP
 nsUndoCommand::IsCommandEnabled(const char * aCommandName, 
                                 nsISupports *aCommandRefCon, 
                                 PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
   {
-    PRBool isEnabled;
-    return editor->CanUndo(&isEnabled, outCmdEnabled);
+    PRBool isEnabled, isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+      return editor->CanUndo(&isEnabled, outCmdEnabled);
   }
 
   *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
@@ -111,18 +113,20 @@ NS_IMETHODIMP
 nsRedoCommand::IsCommandEnabled(const char * aCommandName,
                                 nsISupports *aCommandRefCon,
                                 PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
   {
-    PRBool isEnabled;
-    return editor->CanRedo(&isEnabled, outCmdEnabled);
+    PRBool isEnabled, isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+      return editor->CanRedo(&isEnabled, outCmdEnabled);
   }
 
   *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
@@ -153,19 +157,21 @@ nsRedoCommand::GetCommandStateParams(con
   return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
 }
 
 NS_IMETHODIMP
 nsClearUndoCommand::IsCommandEnabled(const char * aCommandName,
                                      nsISupports *refCon, PRBool *outCmdEnabled)
 { 
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
-  
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
-  *outCmdEnabled = (editor != nsnull);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
   
 
 NS_IMETHODIMP
 nsClearUndoCommand::DoCommand(const char *aCommandName, nsISupports *refCon)
 { 
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
@@ -202,17 +208,22 @@ nsClearUndoCommand::GetCommandStateParam
 NS_IMETHODIMP
 nsCutCommand::IsCommandEnabled(const char * aCommandName,
                                nsISupports *aCommandRefCon,
                                PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
-    return editor->CanCut(outCmdEnabled);
+  {
+    PRBool isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+      return editor->CanCut(outCmdEnabled);
+  }
 
   *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsCutCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
@@ -245,17 +256,20 @@ nsCutCommand::GetCommandStateParams(cons
 
 NS_IMETHODIMP
 nsCutOrDeleteCommand::IsCommandEnabled(const char * aCommandName,
                                        nsISupports *aCommandRefCon,
                                        PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  *outCmdEnabled = (editor != nsnull);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsCutOrDeleteCommand::DoCommand(const char *aCommandName,
                                 nsISupports *aCommandRefCon)
 {
@@ -298,17 +312,22 @@ nsCutOrDeleteCommand::GetCommandStatePar
 NS_IMETHODIMP
 nsCopyCommand::IsCommandEnabled(const char * aCommandName,
                                 nsISupports *aCommandRefCon,
                                 PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
-    return editor->CanCopy(outCmdEnabled);
+  {
+    PRBool isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+      return editor->CanCopy(outCmdEnabled);
+  }
 
   *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsCopyCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
@@ -340,17 +359,20 @@ nsCopyCommand::GetCommandStateParams(con
 
 NS_IMETHODIMP
 nsCopyOrDeleteCommand::IsCommandEnabled(const char * aCommandName,
                                         nsISupports *aCommandRefCon,
                                         PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  *outCmdEnabled = (editor != nsnull);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
+
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsCopyOrDeleteCommand::DoCommand(const char *aCommandName,
                                  nsISupports *aCommandRefCon)
 {
@@ -393,17 +415,22 @@ nsCopyOrDeleteCommand::GetCommandStatePa
 NS_IMETHODIMP
 nsPasteCommand::IsCommandEnabled(const char *aCommandName,
                                  nsISupports *aCommandRefCon,
                                  PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
-    return editor->CanPaste(nsIClipboard::kGlobalClipboard, outCmdEnabled);
+  {
+    PRBool isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+      return editor->CanPaste(nsIClipboard::kGlobalClipboard, outCmdEnabled);
+  }
 
   *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsPasteCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
@@ -435,17 +462,22 @@ nsPasteCommand::GetCommandStateParams(co
 NS_IMETHODIMP
 nsPasteTransferableCommand::IsCommandEnabled(const char *aCommandName,
                                              nsISupports *aCommandRefCon,
                                              PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
-    return editor->CanPasteTransferable(nsnull, outCmdEnabled);
+  {
+    PRBool isEditable = PR_FALSE;
+    NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+    if (isEditable)
+      return editor->CanPasteTransferable(nsnull, outCmdEnabled);
+  }
 
   *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPasteTransferableCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
 {
@@ -496,18 +528,20 @@ nsPasteTransferableCommand::GetCommandSt
 
 NS_IMETHODIMP
 nsSwitchTextDirectionCommand::IsCommandEnabled(const char *aCommandName,
                                  nsISupports *aCommandRefCon,
                                  PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  *outCmdEnabled = (editor != nsnull);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
 
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSwitchTextDirectionCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
@@ -536,20 +570,26 @@ nsSwitchTextDirectionCommand::GetCommand
 NS_IMETHODIMP
 nsDeleteCommand::IsCommandEnabled(const char * aCommandName,
                                   nsISupports *aCommandRefCon,
                                   PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   *outCmdEnabled = PR_FALSE;
+
   // we can delete when we can cut
   NS_ENSURE_TRUE(editor, NS_OK);
     
-  if (!nsCRT::strcmp(aCommandName,"cmd_delete"))
+  PRBool isEditable = PR_FALSE;
+  NS_SUCCEEDED(editor->GetIsSelectionEditable(&isEditable));
+
+  if (!isEditable)
+    return NS_OK;
+  else if (!nsCRT::strcmp(aCommandName,"cmd_delete"))
     return editor->CanCut(outCmdEnabled);
   else if (!nsCRT::strcmp(aCommandName,"cmd_deleteCharBackward"))
     *outCmdEnabled = PR_TRUE;
   else if (!nsCRT::strcmp(aCommandName,"cmd_deleteCharForward"))
     *outCmdEnabled = PR_TRUE;
   else if (!nsCRT::strcmp(aCommandName,"cmd_deleteWordBackward"))
     *outCmdEnabled = PR_TRUE;
   else if (!nsCRT::strcmp(aCommandName,"cmd_deleteWordForward"))
@@ -612,18 +652,20 @@ nsSelectAllCommand::IsCommandEnabled(con
                                      nsISupports *aCommandRefCon,
                                      PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
 
   // you can select all if there is an editor (and potentially no contents)
   // some day we may want to change this
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  *outCmdEnabled = (editor != nsnull);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
 
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsSelectAllCommand::DoCommand(const char *aCommandName,
                               nsISupports *aCommandRefCon)
 {
@@ -655,19 +697,20 @@ nsSelectAllCommand::GetCommandStateParam
 
 NS_IMETHODIMP
 nsSelectionMoveCommands::IsCommandEnabled(const char * aCommandName,
                                           nsISupports *aCommandRefCon,
                                           PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  *outCmdEnabled = (editor != nsnull);
-  NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
+  if (editor)
+    return editor->GetIsSelectionEditable(outCmdEnabled);
 
+  *outCmdEnabled = PR_FALSE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSelectionMoveCommands::DoCommand(const char *aCommandName,
                                    nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
@@ -790,17 +833,17 @@ nsSelectionMoveCommands::GetCommandState
 NS_IMETHODIMP
 nsInsertPlaintextCommand::IsCommandEnabled(const char * aCommandName,
                                            nsISupports *refCon, 
                                            PRBool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   if (editor)
-    return editor->GetIsDocumentEditable(outCmdEnabled);
+    return editor->GetIsSelectionEditable(outCmdEnabled);
 
   *outCmdEnabled = PR_FALSE;
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 
 NS_IMETHODIMP
 nsInsertPlaintextCommand::DoCommand(const char *aCommandName,
--- a/editor/libeditor/html/nsHTMLEditRules.cpp
+++ b/editor/libeditor/html/nsHTMLEditRules.cpp
@@ -9256,9 +9256,12 @@ nsHTMLEditRules::DocumentModifiedWorker(
   // empty any more.
   if (mBogusNode) {
     mEditor->DeleteNode(mBogusNode);
     mBogusNode = nsnull;
   }
 
   // Try to recreate the bogus node if needed.
   CreateBogusNodeIfNeeded(selection);
-}
+
+  // Reset the spell checker
+  mEditor->SyncRealTimeSpell();
+}
--- a/editor/libeditor/html/tests/Makefile.in
+++ b/editor/libeditor/html/tests/Makefile.in
@@ -80,16 +80,17 @@ include $(topsrcdir)/config/rules.mk
 		test_bug611182.html \
 		test_bug612447.html \
 		test_bug620906.html \
 		test_bug622371.html \
 		test_bug629845.html \
 		test_bug640321.html \
 		test_bug668599.html \
 		test_bug674861.html \
+		test_bug676401.html \
 		test_CF_HTML_clipboard.html \
 		test_contenteditable_focus.html \
 		test_htmleditor_keyevent_handling.html \
 		test_select_all_without_body.html \
 		file_select_all_without_body.html \
 		test_root_element_replacement.html \
 		$(NULL)
 
--- a/editor/libeditor/html/tests/browserscope/lib/richtext2/currentStatus.js
+++ b/editor/libeditor/html/tests/browserscope/lib/richtext2/currentStatus.js
@@ -1,14 +1,13 @@
 /**
  * The current status of the test suite.
  *
  * See README.Mozilla for details on how to generate this.
  */
-
 const TEST_RESULTS = {
   "S": {
     "Proposed": {
       "SELALL_TEXT-1_SI": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
@@ -498,43 +497,43 @@ const TEST_RESULTS = {
         }
       },
       "SM:m.f.c_CHAR-3_SC-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>",
-          "bodyInnerHTML": "`foö^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>",
-          "bodyInnerHTML": "`foö^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö^barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>CAN<br>ARY</body>"
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>",
+          "bodyInnerHTML": "`foö^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>",
+          "bodyInnerHTML": "`foö^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö^barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.f.c_CHAR-4_SC-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
@@ -568,183 +567,183 @@ const TEST_RESULTS = {
         }
       },
       "SM:m.f.c_CHAR-5_SC-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>",
-          "bodyInnerHTML": "`foö̤^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>",
-          "bodyInnerHTML": "`foö̤^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤^barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>CAN<br>ARY</body>"
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>",
+          "bodyInnerHTML": "`foö̤^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>",
+          "bodyInnerHTML": "`foö̤^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤^barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.f.c_CHAR-5_SI-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>",
-          "bodyInnerHTML": "`foö̤^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>",
-          "bodyInnerHTML": "`foö̤^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤^barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>CAN<br>ARY</body>"
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>",
+          "bodyInnerHTML": "`foö̤^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>",
+          "bodyInnerHTML": "`foö̤^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤^barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.f.c_CHAR-5_SI-2": {
         "dM": {
           "valscore": 1,
           "selscore": 0,
           "valresult": 8,
           "selresult": 2,
-          "output": "`foö̤b^arbaz´",
-          "innerHTML": "`foö̤b^arbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤b^arbaz´</body>",
-          "bodyInnerHTML": "`foö̤b^arbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤b^arbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 0,
-          "valresult": 8,
-          "selresult": 2,
-          "output": "`foö̤b^arbaz´",
-          "innerHTML": "`foö̤b^arbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤b^arbaz´</body>",
-          "bodyInnerHTML": "`foö̤b^arbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤b^arbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 0,
-          "valresult": 8,
-          "selresult": 2,
-          "output": "`foö̤b^arbaz´",
-          "innerHTML": "`foö̤b^arbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤b^arbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤b^arbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤b^arbaz´</div>CAN<br>ARY</body>"
+          "output": "`foö̤b^arbaz´",
+          "innerHTML": "`foö̤b^arbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤b^arbaz´</body>",
+          "bodyInnerHTML": "`foö̤b^arbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤b^arbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 2,
+          "output": "`foö̤b^arbaz´",
+          "innerHTML": "`foö̤b^arbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤b^arbaz´</body>",
+          "bodyInnerHTML": "`foö̤b^arbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤b^arbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 2,
+          "output": "`foö̤b^arbaz´",
+          "innerHTML": "`foö̤b^arbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤b^arbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤b^arbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤b^arbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.f.c_CHAR-5_SL": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>",
-          "bodyInnerHTML": "`foö̤^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>",
-          "bodyInnerHTML": "`foö̤^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`foö̤^barbaz´",
-          "innerHTML": "`foö̤^barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤^barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>CAN<br>ARY</body>"
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>",
+          "bodyInnerHTML": "`foö̤^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤^barbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>",
+          "bodyInnerHTML": "`foö̤^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤^barbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`foö̤^barbaz´",
+          "innerHTML": "`foö̤^barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤^barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤^barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.f.c_CHAR-5_SR": {
         "dM": {
           "valscore": 1,
           "selscore": 0,
           "valresult": 8,
           "selresult": 2,
-          "output": "`foö̤barb^az´",
-          "innerHTML": "`foö̤barb^az´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤barb^az´</body>",
-          "bodyInnerHTML": "`foö̤barb^az´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤barb^az´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 0,
-          "valresult": 8,
-          "selresult": 2,
-          "output": "`foö̤barb^az´",
-          "innerHTML": "`foö̤barb^az´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤barb^az´</body>",
-          "bodyInnerHTML": "`foö̤barb^az´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤barb^az´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 0,
-          "valresult": 8,
-          "selresult": 2,
-          "output": "`foö̤barb^az´",
-          "innerHTML": "`foö̤barb^az´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤barb^az´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤barb^az´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤barb^az´</div>CAN<br>ARY</body>"
+          "output": "`foö̤barb^az´",
+          "innerHTML": "`foö̤barb^az´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤barb^az´</body>",
+          "bodyInnerHTML": "`foö̤barb^az´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤barb^az´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 2,
+          "output": "`foö̤barb^az´",
+          "innerHTML": "`foö̤barb^az´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤barb^az´</body>",
+          "bodyInnerHTML": "`foö̤barb^az´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤barb^az´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 2,
+          "output": "`foö̤barb^az´",
+          "innerHTML": "`foö̤barb^az´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤barb^az´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤barb^az´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤barb^az´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.f.c_CHAR-6_SC-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
@@ -848,43 +847,43 @@ const TEST_RESULTS = {
         }
       },
       "SM:m.b.c_CHAR-3_SC-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`fo^öbarbaz´",
-          "innerHTML": "`fo^öbarbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^öbarbaz´</body>",
-          "bodyInnerHTML": "`fo^öbarbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^öbarbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^öbarbaz´",
-          "innerHTML": "`fo^öbarbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^öbarbaz´</body>",
-          "bodyInnerHTML": "`fo^öbarbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^öbarbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^öbarbaz´",
-          "innerHTML": "`fo^öbarbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^öbarbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^öbarbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^öbarbaz´</div>CAN<br>ARY</body>"
+          "output": "`fo^öbarbaz´",
+          "innerHTML": "`fo^öbarbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^öbarbaz´</body>",
+          "bodyInnerHTML": "`fo^öbarbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^öbarbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^öbarbaz´",
+          "innerHTML": "`fo^öbarbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^öbarbaz´</body>",
+          "bodyInnerHTML": "`fo^öbarbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^öbarbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^öbarbaz´",
+          "innerHTML": "`fo^öbarbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^öbarbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^öbarbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^öbarbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.b.c_CHAR-4_SC-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
@@ -918,183 +917,183 @@ const TEST_RESULTS = {
         }
       },
       "SM:m.b.c_CHAR-5_SC-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.b.c_CHAR-5_SI-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.b.c_CHAR-5_SI-2": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.b.c_CHAR-5_SL": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.b.c_CHAR-5_SR": {
         "dM": {
           "valscore": 1,
           "selscore": 0,
           "valresult": 8,
           "selresult": 2,
-          "output": "`foö̤ba^rbaz´",
-          "innerHTML": "`foö̤ba^rbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤ba^rbaz´</body>",
-          "bodyInnerHTML": "`foö̤ba^rbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤ba^rbaz´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 0,
-          "valresult": 8,
-          "selresult": 2,
-          "output": "`foö̤ba^rbaz´",
-          "innerHTML": "`foö̤ba^rbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤ba^rbaz´</body>",
-          "bodyInnerHTML": "`foö̤ba^rbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤ba^rbaz´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 0,
-          "valresult": 8,
-          "selresult": 2,
-          "output": "`foö̤ba^rbaz´",
-          "innerHTML": "`foö̤ba^rbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤ba^rbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤ba^rbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤ba^rbaz´</div>CAN<br>ARY</body>"
+          "output": "`foö̤ba^rbaz´",
+          "innerHTML": "`foö̤ba^rbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤ba^rbaz´</body>",
+          "bodyInnerHTML": "`foö̤ba^rbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö̤ba^rbaz´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 2,
+          "output": "`foö̤ba^rbaz´",
+          "innerHTML": "`foö̤ba^rbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤ba^rbaz´</body>",
+          "bodyInnerHTML": "`foö̤ba^rbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö̤ba^rbaz´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 2,
+          "output": "`foö̤ba^rbaz´",
+          "innerHTML": "`foö̤ba^rbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö̤ba^rbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö̤ba^rbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö̤ba^rbaz´</div>CAN<br>ARY</body>"
         }
       },
       "SM:m.b.c_CHAR-6_SC-1": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
@@ -4530,21 +4529,21 @@ const TEST_RESULTS = {
           "bodyInnerHTML": "`foo[bar]baz´",
           "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"blue\" onload=\"setDesignMode()\">`foo[bar]baz´</body>"
         },
         "body": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"blue\">`foo[bar]baz´</body>",
-          "innerHTML": "`foo[bar]baz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"blue\">`foo[bar]baz´</body>",
-          "bodyInnerHTML": "`foo[bar]baz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"blue\">`foo[bar]baz´</body>"
+          "output": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"blue\" contenteditable=\"true\">`foo[bar]baz´</body>",
+          "innerHTML": "`foo[bar]baz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"blue\" contenteditable=\"true\">`foo[bar]baz´</body>",
+          "bodyInnerHTML": "`foo[bar]baz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"blue\" contenteditable=\"true\">`foo[bar]baz´</body>"
         },
         "div": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
           "output": "`foo[bar]baz´",
           "innerHTML": "`foo[bar]baz´",
@@ -4887,21 +4886,21 @@ const TEST_RESULTS = {
           "bodyInnerHTML": "<div align=\"center\">`foo^bar´</div>",
           "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\"><div align=\"center\">`foo^bar´</div></body>"
         },
         "div": {
           "valscore": 0,
           "selscore": 1,
           "valresult": 7,
           "selresult": 5,
-          "output": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" align=\"center\" id=\"editor-div\">`foo^bar´</div>",
+          "output": "<div xmlns=\"http://www.w3.org/1999/xhtml\" align=\"center\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>",
           "innerHTML": "`foo^bar´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" align=\"center\" id=\"editor-div\">`foo^bar´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" align=\"center\" contenteditable=\"true\">`foo^bar´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" align=\"center\" id=\"editor-div\">`foo^bar´</div>CAN<br>ARY</body>"
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" align=\"center\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\" align=\"center\">`foo^bar´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div align=\"center\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>CAN<br>ARY</body>"
         }
       },
       "JF_TEXT-1_SC": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
@@ -4922,21 +4921,21 @@ const TEST_RESULTS = {
           "bodyInnerHTML": "<div align=\"justify\">`foo^bar´</div>",
           "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\"><div align=\"justify\">`foo^bar´</div></body>"
         },
         "div": {
           "valscore": 0,
           "selscore": 1,
           "valresult": 7,
           "selresult": 5,
-          "output": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" align=\"justify\" id=\"editor-div\">`foo^bar´</div>",
+          "output": "<div xmlns=\"http://www.w3.org/1999/xhtml\" align=\"justify\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>",
           "innerHTML": "`foo^bar´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" align=\"justify\" id=\"editor-div\">`foo^bar´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" align=\"justify\" contenteditable=\"true\">`foo^bar´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" align=\"justify\" id=\"editor-div\">`foo^bar´</div>CAN<br>ARY</body>"
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" align=\"justify\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\" align=\"justify\">`foo^bar´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div align=\"justify\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>CAN<br>ARY</body>"
         }
       },
       "JL_TEXT-1_SC": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
@@ -4957,21 +4956,21 @@ const TEST_RESULTS = {
           "bodyInnerHTML": "<div align=\"left\">`foo^bar´</div>",
           "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\"><div align=\"left\">`foo^bar´</div></body>"
         },
         "div": {
           "valscore": 0,
           "selscore": 1,
           "valresult": 7,
           "selresult": 5,
-          "output": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" align=\"left\" id=\"editor-div\">`foo^bar´</div>",
+          "output": "<div xmlns=\"http://www.w3.org/1999/xhtml\" align=\"left\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>",
           "innerHTML": "`foo^bar´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" align=\"left\" id=\"editor-div\">`foo^bar´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" align=\"left\" contenteditable=\"true\">`foo^bar´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" align=\"left\" id=\"editor-div\">`foo^bar´</div>CAN<br>ARY</body>"
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" align=\"left\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\" align=\"left\">`foo^bar´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div align=\"left\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>CAN<br>ARY</body>"
         }
       },
       "JR_TEXT-1_SC": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
@@ -4992,21 +4991,21 @@ const TEST_RESULTS = {
           "bodyInnerHTML": "<div align=\"right\">`foo^bar´</div>",
           "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\"><div align=\"right\">`foo^bar´</div></body>"
         },
         "div": {
           "valscore": 0,
           "selscore": 1,
           "valresult": 7,
           "selresult": 5,
-          "output": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" align=\"right\" id=\"editor-div\">`foo^bar´</div>",
+          "output": "<div xmlns=\"http://www.w3.org/1999/xhtml\" align=\"right\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>",
           "innerHTML": "`foo^bar´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" align=\"right\" id=\"editor-div\">`foo^bar´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" align=\"right\" contenteditable=\"true\">`foo^bar´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" align=\"right\" id=\"editor-div\">`foo^bar´</div>CAN<br>ARY</body>"
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" align=\"right\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\" align=\"right\">`foo^bar´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div align=\"right\" contenteditable=\"true\" id=\"editor-div\">`foo^bar´</div>CAN<br>ARY</body>"
         }
       },
       "H:H1_TEXT-1_SC": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
@@ -5899,21 +5898,21 @@ const TEST_RESULTS = {
           "bodyInnerHTML": "<font style=\"background-color: #ffccaa\">`[foobarbaz]´</font>",
           "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#884422\" onload=\"setDesignMode()\"><font style=\"background-color: #ffccaa\">`[foobarbaz]´</font></body>"
         },
         "body": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#884422\"><font style=\"background-color: #ffccaa\">`[foobarbaz]´</font></body>",
+          "output": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#884422\" contenteditable=\"true\"><font style=\"background-color: #ffccaa\">`[foobarbaz]´</font></body>",
           "innerHTML": "<font style=\"background-color: #ffccaa\">`[foobarbaz]´</font>",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#884422\"><font style=\"background-color: #ffccaa\">`[foobarbaz]´</font></body>",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#884422\" contenteditable=\"true\"><font style=\"background-color: #ffccaa\">`[foobarbaz]´</font></body>",
           "bodyInnerHTML": "<font style=\"background-color: #ffccaa\">`[foobarbaz]´</font>",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#884422\"><font style=\"background-color: #ffccaa\">`[foobarbaz]´</font></body>"
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#884422\" contenteditable=\"true\"><font style=\"background-color: #ffccaa\">`[foobarbaz]´</font></body>"
         },
         "div": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
           "output": "<font style=\"background-color: #ffccaa\">`[foobarbaz]´</font>",
           "innerHTML": "<font style=\"background-color: #ffccaa\">`[foobarbaz]´</font>",
@@ -5934,21 +5933,21 @@ const TEST_RESULTS = {
           "bodyInnerHTML": "<span style=\"background-color: #ff0000\">`[foobarbaz]´</span>",
           "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#0000ff\" onload=\"setDesignMode()\"><span style=\"background-color: #ff0000\">`[foobarbaz]´</span></body>"
         },
         "body": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#0000ff\"><span style=\"background-color: #ff0000\">`[foobarbaz]´</span></body>",
+          "output": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#0000ff\" contenteditable=\"true\"><span style=\"background-color: #ff0000\">`[foobarbaz]´</span></body>",
           "innerHTML": "<span style=\"background-color: #ff0000\">`[foobarbaz]´</span>",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#0000ff\"><span style=\"background-color: #ff0000\">`[foobarbaz]´</span></body>",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#0000ff\" contenteditable=\"true\"><span style=\"background-color: #ff0000\">`[foobarbaz]´</span></body>",
           "bodyInnerHTML": "<span style=\"background-color: #ff0000\">`[foobarbaz]´</span>",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#0000ff\"><span style=\"background-color: #ff0000\">`[foobarbaz]´</span></body>"
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#0000ff\" contenteditable=\"true\"><span style=\"background-color: #ff0000\">`[foobarbaz]´</span></body>"
         },
         "div": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
           "output": "<span style=\"background-color: #ff0000\">`[foobarbaz]´</span>",
           "innerHTML": "<span style=\"background-color: #ff0000\">`[foobarbaz]´</span>",
@@ -5969,21 +5968,21 @@ const TEST_RESULTS = {
           "bodyInnerHTML": "<span class=\"Apple-style-span\" style=\"background-color: rgb(255, 0, 0)\">`[foobarbaz]´</span>",
           "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#aaccee\" onload=\"setDesignMode()\"><span style=\"background-color: rgb(255, 0, 0)\" class=\"Apple-style-span\">`[foobarbaz]´</span></body>"
         },
         "body": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#aaccee\"><span style=\"background-color: rgb(255, 0, 0)\" class=\"Apple-style-span\">`[foobarbaz]´</span></body>",
+          "output": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#aaccee\" contenteditable=\"true\"><span style=\"background-color: rgb(255, 0, 0)\" class=\"Apple-style-span\">`[foobarbaz]´</span></body>",
           "innerHTML": "<span class=\"Apple-style-span\" style=\"background-color: rgb(255, 0, 0)\">`[foobarbaz]´</span>",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#aaccee\"><span style=\"background-color: rgb(255, 0, 0)\" class=\"Apple-style-span\">`[foobarbaz]´</span></body>",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#aaccee\" contenteditable=\"true\"><span style=\"background-color: rgb(255, 0, 0)\" class=\"Apple-style-span\">`[foobarbaz]´</span></body>",
           "bodyInnerHTML": "<span class=\"Apple-style-span\" style=\"background-color: rgb(255, 0, 0)\">`[foobarbaz]´</span>",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" bgcolor=\"#aaccee\"><span style=\"background-color: rgb(255, 0, 0)\" class=\"Apple-style-span\">`[foobarbaz]´</span></body>"
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" bgcolor=\"#aaccee\" contenteditable=\"true\"><span style=\"background-color: rgb(255, 0, 0)\" class=\"Apple-style-span\">`[foobarbaz]´</span></body>"
         },
         "div": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
           "output": "<span class=\"Apple-style-span\" style=\"background-color: rgb(255, 0, 0)\">`[foobarbaz]´</span>",
           "innerHTML": "<span class=\"Apple-style-span\" style=\"background-color: rgb(255, 0, 0)\">`[foobarbaz]´</span>",
@@ -10238,43 +10237,43 @@ const TEST_RESULTS = {
         }
       },
       "UNLINK_A-IMG-1_SO": {
         "dM": {
           "valscore": 1,
           "selscore": 1,
           "valresult": 8,
           "selresult": 5,
-          "output": "{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´",
-          "innerHTML": "{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">{<img width=\"200\" height=\"140\" align=\"right\" src=\"pic.jpg\">`abc]´</body>",
-          "bodyInnerHTML": "{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">{<img width=\"200\" height=\"140\" align=\"right\" src=\"pic.jpg\">`abc]´</body>"
-        },
-        "body": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´",
-          "innerHTML": "{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">{<img width=\"200\" height=\"140\" align=\"right\" src=\"pic.jpg\">`abc]´</body>",
-          "bodyInnerHTML": "{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">{<img width=\"200\" height=\"140\" align=\"right\" src=\"pic.jpg\">`abc]´</body>"
-        },
-        "div": {
-          "valscore": 1,
-          "selscore": 1,
-          "valresult": 8,
-          "selresult": 5,
-          "output": "{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´",
-          "innerHTML": "{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">{<img width=\"200\" height=\"140\" align=\"right\" src=\"pic.jpg\">`abc]´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">{<img src=\"pic.jpg\" align=\"right\" height=\"140\" width=\"200\">`abc]´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">{<img width=\"200\" height=\"140\" align=\"right\" src=\"pic.jpg\">`abc]´</div>CAN<br>ARY</body>"
+          "output": "{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´",
+          "innerHTML": "{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">{<img width=\"200\" align=\"right\" height=\"140\" src=\"pic.jpg\">`abc]´</body>",
+          "bodyInnerHTML": "{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">{<img width=\"200\" align=\"right\" height=\"140\" src=\"pic.jpg\">`abc]´</body>"
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´",
+          "innerHTML": "{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">{<img width=\"200\" align=\"right\" height=\"140\" src=\"pic.jpg\">`abc]´</body>",
+          "bodyInnerHTML": "{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">{<img width=\"200\" align=\"right\" height=\"140\" src=\"pic.jpg\">`abc]´</body>"
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 1,
+          "valresult": 8,
+          "selresult": 5,
+          "output": "{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´",
+          "innerHTML": "{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">{<img width=\"200\" align=\"right\" height=\"140\" src=\"pic.jpg\">`abc]´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">{<img src=\"pic.jpg\" height=\"140\" align=\"right\" width=\"200\">`abc]´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">{<img width=\"200\" align=\"right\" height=\"140\" src=\"pic.jpg\">`abc]´</div>CAN<br>ARY</body>"
         }
       },
       "OUTDENT_BQ-1_SW": {
         "dM": {
           "valscore": 0,
           "selscore": 1,
           "valresult": 7,
           "selresult": 5,
@@ -12346,43 +12345,43 @@ const TEST_RESULTS = {
         }
       },
       "CHAR-5_SC": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>",
-          "bodyInnerHTML": "`foö^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>",
-          "bodyInnerHTML": "`foö^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö^barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>CAN<br>ARY</body>"
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>",
+          "bodyInnerHTML": "`foö^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>"
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>",
+          "bodyInnerHTML": "`foö^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>"
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö^barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "CHAR-5_SI-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
@@ -12416,78 +12415,78 @@ const TEST_RESULTS = {
         }
       },
       "CHAR-5_SI-2": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>",
-          "bodyInnerHTML": "`foö^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>",
-          "bodyInnerHTML": "`foö^barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`foö^barbaz´",
-          "innerHTML": "`foö^barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö^barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>CAN<br>ARY</body>"
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>",
+          "bodyInnerHTML": "`foö^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^barbaz´</body>"
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>",
+          "bodyInnerHTML": "`foö^barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^barbaz´</body>"
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`foö^barbaz´",
+          "innerHTML": "`foö^barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö^barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö^barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "CHAR-5_SR": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "`foö^baz´",
-          "innerHTML": "`foö^baz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^baz´</body>",
-          "bodyInnerHTML": "`foö^baz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^baz´</body>"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`foö^baz´",
-          "innerHTML": "`foö^baz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^baz´</body>",
-          "bodyInnerHTML": "`foö^baz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^baz´</body>"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`foö^baz´",
-          "innerHTML": "`foö^baz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö^baz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö^baz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö^baz´</div>CAN<br>ARY</body>"
+          "output": "`foö^baz´",
+          "innerHTML": "`foö^baz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^baz´</body>",
+          "bodyInnerHTML": "`foö^baz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`foö^baz´</body>"
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`foö^baz´",
+          "innerHTML": "`foö^baz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^baz´</body>",
+          "bodyInnerHTML": "`foö^baz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`foö^baz´</body>"
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`foö^baz´",
+          "innerHTML": "`foö^baz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`foö^baz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`foö^baz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`foö^baz´</div>CAN<br>ARY</body>"
         }
       },
       "CHAR-6_SC": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
@@ -14092,43 +14091,43 @@ const TEST_RESULTS = {
         }
       },
       "CHAR-3_SC": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "`fo^öbarbaz´",
-          "innerHTML": "`fo^öbarbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^öbarbaz´</body>",
-          "bodyInnerHTML": "`fo^öbarbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^öbarbaz´</body>"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`fo^öbarbaz´",
-          "innerHTML": "`fo^öbarbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^öbarbaz´</body>",
-          "bodyInnerHTML": "`fo^öbarbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^öbarbaz´</body>"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`fo^öbarbaz´",
-          "innerHTML": "`fo^öbarbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^öbarbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^öbarbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^öbarbaz´</div>CAN<br>ARY</body>"
+          "output": "`fo^öbarbaz´",
+          "innerHTML": "`fo^öbarbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^öbarbaz´</body>",
+          "bodyInnerHTML": "`fo^öbarbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^öbarbaz´</body>"
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`fo^öbarbaz´",
+          "innerHTML": "`fo^öbarbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^öbarbaz´</body>",
+          "bodyInnerHTML": "`fo^öbarbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^öbarbaz´</body>"
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`fo^öbarbaz´",
+          "innerHTML": "`fo^öbarbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^öbarbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^öbarbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^öbarbaz´</div>CAN<br>ARY</body>"
         }
       },
       "CHAR-4_SC": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
@@ -14162,43 +14161,43 @@ const TEST_RESULTS = {
         }
       },
       "CHAR-5_SC": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
-          "bodyInnerHTML": "`fo^ö̤barbaz´",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 6,
-          "selresult": 3,
-          "output": "`fo^ö̤barbaz´",
-          "innerHTML": "`fo^ö̤barbaz´",
-          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
-          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
-          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" onload=\"setDesignMode()\">`fo^ö̤barbaz´</body>"
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>",
+          "bodyInnerHTML": "`fo^ö̤barbaz´",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\">`fo^ö̤barbaz´</body>"
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": "`fo^ö̤barbaz´",
+          "innerHTML": "`fo^ö̤barbaz´",
+          "outerHTML": "<div xmlns=\"http://www.w3.org/1999/xhtml\" contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>",
+          "bodyInnerHTML": "CAN<br>ARY<div id=\"editor-div\" contenteditable=\"true\">`fo^ö̤barbaz´</div>CAN<br>ARY",
+          "bodyOuterHTML": "<body xmlns=\"http://www.w3.org/1999/xhtml\">CAN<br>ARY<div contenteditable=\"true\" id=\"editor-div\">`fo^ö̤barbaz´</div>CAN<br>ARY</body>"
         }
       },
       "CHAR-6_SC": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
@@ -17012,1116 +17011,1116 @@ const TEST_RESULTS = {
         }
       }
     }
   },
   "Q": {
     "Proposed": {
       "SELECTALL_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "UNSELECT_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "UNDO_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "REDO_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "BOLD_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "BOLD_B": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "ITALIC_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "ITALIC_I": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "UNDERLINE_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "STRIKETHROUGH_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "SUBSCRIPT_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "SUPERSCRIPT_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "FORMATBLOCK_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "CREATELINK_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "UNLINK_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INSERTHTML_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INSERTHORIZONTALRULE_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INSERTIMAGE_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INSERTLINEBREAK_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "INSERTPARAGRAPH_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INSERTORDEREDLIST_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INSERTUNORDEREDLIST_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INSERTTEXT_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "DELETE_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "FORWARDDELETE_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "STYLEWITHCSS_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "CONTENTREADONLY_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "BACKCOLOR_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "FORECOLOR_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "HILITECOLOR_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "FONTNAME_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "FONTSIZE_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INCREASEFONTSIZE_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "DECREASEFONTSIZE_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "HEADING_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "INDENT_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "OUTDENT_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "CREATEBOOKMARK_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "UNBOOKMARK_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "JUSTIFYCENTER_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "JUSTIFYFULL_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "JUSTIFYLEFT_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "JUSTIFYRIGHT_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "REMOVEFORMAT_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "COPY_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "CUT_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "PASTE_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": true
         }
       },
       "garbage-1_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandSupported]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 148\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": false
         }
       }
     }
   },
   "QE": {
     "Proposed": {
       "SELECTALL_TEXT-1": {
         "dM": {
@@ -18145,33 +18144,33 @@ const TEST_RESULTS = {
           "selresult": 3,
           "output": true
         }
       },
       "UNSELECT_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "UNDO_TEXT-1": {
         "dM": {
           "valscore": 1,
           "selscore": 0,
           "valresult": 8,
           "selresult": 3,
@@ -18490,33 +18489,33 @@ const TEST_RESULTS = {
           "selresult": 3,
           "output": true
         }
       },
       "INSERTLINEBREAK_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "INSERTPARAGRAPH_TEXT-1": {
         "dM": {
           "valscore": 1,
           "selscore": 0,
           "valresult": 8,
           "selresult": 3,
@@ -18582,33 +18581,33 @@ const TEST_RESULTS = {
           "selresult": 3,
           "output": true
         }
       },
       "INSERTTEXT_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "DELETE_TEXT-1": {
         "dM": {
           "valscore": 1,
           "selscore": 0,
           "valresult": 8,
           "selresult": 3,
@@ -18628,33 +18627,33 @@ const TEST_RESULTS = {
           "selresult": 3,
           "output": true
         }
       },
       "FORWARDDELETE_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "STYLEWITHCSS_TEXT-1": {
         "dM": {
           "valscore": 1,
           "selscore": 0,
           "valresult": 8,
           "selresult": 3,
@@ -18927,56 +18926,56 @@ const TEST_RESULTS = {
           "selresult": 3,
           "output": false
         }
       },
       "CREATEBOOKMARK_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "UNBOOKMARK_TEXT-1": {
         "dM": {
           "valscore": 0,
           "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 0,
+          "selscore": 0,
+          "valresult": 6,
+          "selresult": 3,
+          "output": false
         }
       },
       "JUSTIFYCENTER_TEXT-1": {
         "dM": {
           "valscore": 1,
           "selscore": 0,
           "valresult": 8,
           "selresult": 3,
@@ -19155,35 +19154,35 @@ const TEST_RESULTS = {
           "selscore": 0,
           "valresult": 8,
           "selresult": 3,
           "output": true
         }
       },
       "garbage-1_TEXT-1": {
         "dM": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "body": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
-        },
-        "div": {
-          "valscore": 0,
-          "selscore": 0,
-          "valresult": 2,
-          "selresult": 3,
-          "output": "EXECUTION EXCEPTION: [Exception... \"Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMHTMLDocument.queryCommandEnabled]\"  nsresult: \"0x80004001 (NS_ERROR_NOT_IMPLEMENTED)\"  location: \"JS frame :: http://mochi.test:8888/tests/editor/libeditor/html/tests/browserscope/lib/richtext2/richtext2/static/js/run.js :: runSingleTest :: line 150\"  data: no]"
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": false
+        },
+        "body": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": false
+        },
+        "div": {
+          "valscore": 1,
+          "selscore": 0,
+          "valresult": 8,
+          "selresult": 3,
+          "output": false
         }
       }
     }
   },
   "QI": {
     "Proposed": {
       "SELECTALL_TEXT-1": {
         "dM": {
@@ -23813,9 +23812,10 @@ const TEST_RESULTS = {
           "selscore": 0,
           "valresult": 6,
           "selresult": 3,
           "output": "transparent"
         }
       }
     }
   }
-};
+}
+
--- a/editor/libeditor/html/tests/browserscope/test_richtext2.html
+++ b/editor/libeditor/html/tests/browserscope/test_richtext2.html
@@ -49,16 +49,32 @@ http://code.google.com/p/browserscope/so
   <script type="text/javascript" src="lib/richtext2/currentStatus.js"></script>
 
   <!-- Do something -->
   <script type="text/javascript">
     // Set this constant to true in order to get the current status of the test suite.
     // This is useful for updating the currentStatus.js file when an editor bug is fixed.
     const UPDATE_TEST_RESULTS = false;
 
+    // some tests (at least RTE2-QE_PASTE_TEXT-1) require clipboard data
+    function startTest() {
+      SimpleTest.waitForClipboard("foo",
+        function() {
+          Components.classes["@mozilla.org/widget/clipboardhelper;1"]
+                    .getService(Components.interfaces.nsIClipboardHelper)
+                    .copyString("foo");
+        },
+        runTest,
+        function() {
+          ok(false, "Failed to copy a string to the clipboard");
+          SimpleTest.finish();
+        }
+      );
+    }
+
     function runTest() {
       initVariables();
       initEditorDocs();
 
       const tests = [
         SELECTION_TESTS,
         APPLY_TESTS,
         APPLY_TESTS_CSS,
@@ -248,15 +264,15 @@ http://code.google.com/p/browserscope/so
     }
 
     SimpleTest.waitForExplicitFinish();
     // Running all of the tests can take a long time, try to account for it
     SimpleTest.requestLongerTimeout(5);
   </script>
 </head>
 
-<body onload="runTest()">
+<body onload="startTest()">
   <iframe name="iframe-dM" id="iframe-dM" src="lib/richtext2/richtext2/static/editable-dM.html"></iframe>
   <iframe name="iframe-body" id="iframe-body" src="lib/richtext2/richtext2/static/editable-body.html"></iframe>
   <iframe name="iframe-div" id="iframe-div" src="lib/richtext2/richtext2/static/editable-div.html"></iframe>
   <pre id="results" style="display: none"></pre>
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/html/tests/test_bug676401.html
@@ -0,0 +1,111 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=676401
+-->
+<head>
+  <title>Test for Bug 676401</title>
+  <script type="application/javascript" src="/MochiKit/packed.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=676401">Mozilla Bug 676401</a>
+<p id="display"></p>
+<div id="content">
+  <!-- we need a blockquote to test the "outdent" command -->
+  <section>
+    <blockquote> not editable </blockquote>
+  </section>
+  <section contenteditable>
+    <blockquote> editable </blockquote>
+  </section>
+</div>
+
+<pre id="test">
+<script type="application/javascript">
+
+/** Test for Bug 676401 **/
+SimpleTest.waitForExplicitFinish();
+SimpleTest.waitForFocus(runTests);
+
+var gBlock1, gBlock2;
+
+function IsCommandEnabled(command) {
+  var enabled;
+
+  // non-editable div: should return false
+  window.getSelection().selectAllChildren(gBlock1);
+  enabled = document.queryCommandEnabled(command);
+  is(enabled, false, "'" + command + "' should not be enabled on a non-editable block.");
+
+  // editable div: should return true
+  window.getSelection().selectAllChildren(gBlock2);
+  enabled = document.queryCommandEnabled(command);
+  is(enabled, true, "'" + command + "' should be enabled on an editable block.");
+}
+
+function runTests() {
+  var i, commands;
+  gBlock1 = document.querySelector("#content section blockquote");
+  gBlock2 = document.querySelector("#content [contenteditable] blockquote");
+
+  // common commands: test with and without "styleWithCSS"
+  commands = [
+    "bold", "italic", "underline", "strikeThrough", 
+    "subscript", "superscript", "foreColor", "backColor", "hiliteColor",
+    "fontName", "fontSize",
+    "justifyLeft", "justifyCenter", "justifyRight", "justifyFull",
+    "indent", "outdent",
+    "insertOrderedList", "insertUnorderedList", "insertParagraph",
+    "heading", "formatBlock",
+    "contentReadOnly", "createLink",
+    "decreaseFontSize", "increaseFontSize",
+    "insertHTML", "insertHorizontalRule", "insertImage",
+    "removeFormat", "selectAll", "styleWithCSS"
+  ];
+  document.execCommand("styleWithCSS", false, false);
+  for (i = 0; i < commands.length; i++)
+    IsCommandEnabled(commands[i]);
+  document.execCommand("styleWithCSS", false, true);
+  for (i = 0; i < commands.length; i++)
+    IsCommandEnabled(commands[i]);
+
+  // Mozilla-specific stuff
+  commands = ["enableInlineTableEditing", "enableObjectResizing", "insertBrOnReturn"];
+  for (i = 0; i < commands.length; i++)
+    IsCommandEnabled(commands[i]);
+
+  // cut/copy/paste -- SpecialPowers required
+  SpecialPowers.setCharPref("capability.policy.policynames",                      "allowclipboard");
+  SpecialPowers.setCharPref("capability.policy.allowclipboard.sites",             "http://mochi.test:8888");
+  SpecialPowers.setCharPref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
+  SpecialPowers.setCharPref("capability.policy.allowclipboard.Clipboard.paste",   "allAccess");
+  commands = ["cut", "paste", "copy"];
+  for (i = 0; i < commands.length; i++) {
+    IsCommandEnabled(commands[i]);
+    document.execCommand(commands[i], false, false);
+  }
+  SpecialPowers.clearUserPref("capability.policy.policynames");
+  SpecialPowers.clearUserPref("capability.policy.allowclipboard.sites");
+  SpecialPowers.clearUserPref("capability.policy.allowclipboard.Clipboard.cutcopy");
+  SpecialPowers.clearUserPref("capability.policy.allowclipboard.Clipboard.paste");
+
+  // delete/undo/redo -- we have to execute this commands because:
+  //  * there's nothing to undo if we haven't modified the selection first
+  //  * there's nothing to redo if we haven't undone something first
+  commands = ["delete", "undo", "redo"];
+  for (i = 0; i < commands.length; i++) {
+    IsCommandEnabled(commands[i]);
+    document.execCommand(commands[i], false, false);
+  }
+
+  // done
+  SimpleTest.finish();
+}
+
+</script>
+</pre>
+</body>
+</html>
--- a/editor/libeditor/text/nsPlaintextEditor.cpp
+++ b/editor/libeditor/text/nsPlaintextEditor.cpp
@@ -1208,16 +1208,17 @@ nsPlaintextEditor::Undo(PRUint32 aCount)
   nsresult result = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
   
   if (!cancel && NS_SUCCEEDED(result))
   {
     result = nsEditor::Undo(aCount);
     result = mRules->DidDoAction(selection, &ruleInfo, result);
   } 
    
+  NotifyEditorObservers();
   return result;
 }
 
 NS_IMETHODIMP 
 nsPlaintextEditor::Redo(PRUint32 aCount)
 {
   // Protect the edit rules object from dying
   nsCOMPtr<nsIEditRules> kungFuDeathGrip(mRules);
@@ -1237,16 +1238,17 @@ nsPlaintextEditor::Redo(PRUint32 aCount)
   nsresult result = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
   
   if (!cancel && NS_SUCCEEDED(result))
   {
     result = nsEditor::Redo(aCount);
     result = mRules->DidDoAction(selection, &ruleInfo, result);
   } 
    
+  NotifyEditorObservers();
   return result;
 }
 
 PRBool
 nsPlaintextEditor::CanCutOrCopy()
 {
   nsCOMPtr<nsISelection> selection;
   if (NS_FAILED(GetSelection(getter_AddRefs(selection))))
--- a/editor/libeditor/text/nsTextEditRules.cpp
+++ b/editor/libeditor/text/nsTextEditRules.cpp
@@ -938,17 +938,17 @@ nsTextEditRules::WillUndo(nsISelection *
 }
 
 /* the idea here is to see if the magic empty node has suddenly reappeared as the result of the undo.
  * if it has, set our state so we remember it.
  * There is a tradeoff between doing here and at redo, or doing it everywhere else that might care.
  * Since undo and redo are relatively rare, it makes sense to take the (small) performance hit here.
  */
 nsresult
-nsTextEditRules:: DidUndo(nsISelection *aSelection, nsresult aResult)
+nsTextEditRules::DidUndo(nsISelection *aSelection, nsresult aResult)
 {
   nsresult res = aResult;  // if aResult is an error, we return it.
   if (!aSelection) { return NS_ERROR_NULL_POINTER; }
   if (NS_SUCCEEDED(res)) 
   {
     if (mBogusNode) {
       mBogusNode = nsnull;
     }
--- a/editor/libeditor/text/tests/Makefile.in
+++ b/editor/libeditor/text/tests/Makefile.in
@@ -40,16 +40,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir  = editor/libeditor/text/tests
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES = \
+		test_bug318065.html \
 		test_bug471722.html \
 		test_bug527935.html \
 		test_bug569988.html \
 		test_bug590554.html \
 		test_bug596001.html \
 		test_bug596333.html \
 		test_bug596506.html \
 		test_bug597331.html \
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/text/tests/test_bug318065.html
@@ -0,0 +1,115 @@
+<!DOCTYPE HTML>
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is Plaintext Editor Test code
+   -
+   - The Initial Developer of the Original Code is
+   - Graeme McCutcheon <graememcc_firefox@graeme-online.co.uk>.
+   - Portions created by the Initial Developer are Copyright (C) 2011
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the GPL or the LGPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=318065
+-->
+
+<head>
+  <title>Test for Bug 318065</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>  
+</head>
+
+<body>
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=318065">Mozilla Bug 318065</a>
+  <p id="display"></p>
+  <div id="content" style="display: none">
+  </div>
+
+  <pre id="test">
+    <script type="application/javascript">
+
+      /** Test for Bug 318065 **/
+      SimpleTest.waitForExplicitFinish();
+      SimpleTest.waitForFocus(function() {
+        var expectedValues = ["A", "", "A", "", "A", "", "A"];
+        var messages = ["Initial text inserted",
+                        "Initial text deleted",
+                        "Undo of deletion",
+                        "Redo of deletion",
+                        "Initial text typed",
+                        "Undo of typing",
+                        "Redo of typing"];
+        var step = 0;
+
+        function onInput() {
+          is(this.value, expectedValues[step], messages[step]);
+          step++;
+          if (step == expectedValues.length) {
+            this.removeEventListener("input", onInput, false); 
+            SimpleTest.finish();
+          }
+        }
+
+        var input = document.getElementById("t1");
+        input.addEventListener("input", onInput, false);
+        var input2 = document.getElementById("t2");
+        input2.addEventListener("input", onInput, false);
+
+        input.focus();
+
+        // Tests 0 + 1: Input letter and delete it again
+        synthesizeKey("A", {});
+        synthesizeKey("VK_BACK_SPACE", {});
+
+        // Test 2: Undo deletion. Value of input should be "A"
+        synthesizeKey("Z", {accelKey: true});
+
+        // Test 3: Redo deletion. Value of input should be ""
+        synthesizeKey("Z", {accelKey: true, shiftKey: true});
+
+        input2.focus();
+
+        // Test 4: Input letter
+        synthesizeKey("A", {});
+
+        // Test 5: Undo typing. Value of input should be ""
+        synthesizeKey("Z", {accelKey: true});
+
+        // Test 6: Redo typing. Value of input should be "A"
+        synthesizeKey("Z", {accelKey: true, shiftKey: true});
+      });
+   </script>
+  </pre>
+
+  <input type="text" value="" id="t1" />
+  <input type="text" value="" id="t2" />
+</body>
+</html>
--- a/embedding/android/GeckoAppShell.java
+++ b/embedding/android/GeckoAppShell.java
@@ -553,16 +553,19 @@ public class GeckoAppShell
             return;
 
         InputMethodManager imm = (InputMethodManager)
             GeckoApp.surfaceView.getContext().getSystemService(
                 Context.INPUT_METHOD_SERVICE);
         if (imm == null)
             return;
 
+        // Log.d("GeckoAppJava", String.format("IME: notifyIMEChange: t=%s s=%d ne=%d oe=%d",
+        //                                      text, start, newEnd, end));
+
         if (newEnd < 0)
             GeckoApp.surfaceView.inputConnection.notifySelectionChange(
                 imm, start, end);
         else
             GeckoApp.surfaceView.inputConnection.notifyTextChange(
                 imm, text, start, end, newEnd);
     }
 
--- a/embedding/android/GeckoInputConnection.java
+++ b/embedding/android/GeckoInputConnection.java
@@ -504,19 +504,24 @@ public class GeckoInputConnection
         }
 
         commitText(null, 1);
         return true;
     }
 
     public void notifyTextChange(InputMethodManager imm, String text,
                                  int start, int oldEnd, int newEnd) {
-        //Log.d("GeckoAppJava", "IME: notifyTextChange");
+        // Log.d("GeckoAppShell", String.format("IME: notifyTextChange: text=%s s=%d ne=%d oe=%d",
+        //                                      text, start, newEnd, oldEnd));
 
-        if (!text.contentEquals(GeckoApp.surfaceView.mEditable))
+        mNumPendingChanges = Math.max(mNumPendingChanges - 1, 0);
+
+        // If there are pending changes, that means this text is not the most up-to-date version
+        // and we'll step on ourselves if we change the editable right now.
+        if (mNumPendingChanges == 0 && !text.contentEquals(GeckoApp.surfaceView.mEditable))
             GeckoApp.surfaceView.setEditable(text);
 
         if (mUpdateRequest == null)
             return;
 
         mUpdateExtract.flags = 0;
 
         // We update from (0, oldEnd) to (0, newEnd) because some Android IMEs
@@ -532,42 +537,52 @@ public class GeckoInputConnection
         mUpdateExtract.startOffset = 0;
 
         imm.updateExtractedText(GeckoApp.surfaceView,
             mUpdateRequest.token, mUpdateExtract);
     }
 
     public void notifySelectionChange(InputMethodManager imm,
                                       int start, int end) {
-        //Log.d("GeckoAppJava", "IME: notifySelectionChange");
+        // Log.d("GeckoAppJava", String.format("IME: notifySelectionChange: s=%d e=%d", start, end));
 
         if (mComposing)
             imm.updateSelection(GeckoApp.surfaceView,
                 mCompositionStart + mCompositionSelStart,
                 mCompositionStart + mCompositionSelStart + mCompositionSelLen,
                 mCompositionStart,
                 mCompositionStart + mComposingText.length());
         else
             imm.updateSelection(GeckoApp.surfaceView, start, end, -1, -1);
 
+        // We only change the selection if we are relatively sure that the text we have is
+        // up-to-date.  Bail out if we are stil expecting changes.
+        if (mNumPendingChanges > 0)
+            return;
+
         int maxLen = GeckoApp.surfaceView.mEditable.length();
         Selection.setSelection(GeckoApp.surfaceView.mEditable, 
                                Math.min(start, maxLen),
                                Math.min(end, maxLen));
     }
 
     public void reset() {
         mComposing = false;
         mComposingText = "";
         mUpdateRequest = null;
+        mNumPendingChanges = 0;
     }
 
     // TextWatcher
     public void onTextChanged(CharSequence s, int start, int before, int count)
     {
+        // Log.d("GeckoAppShell", String.format("IME: onTextChanged: t=%s s=%d b=%d l=%d",
+        //                                      s, start, before, count));
+
+        mNumPendingChanges++;
         GeckoAppShell.sendEventToGecko(
             new GeckoEvent(GeckoEvent.IME_SET_SELECTION, start, before));
 
         if (count == 0) {
             GeckoAppShell.sendEventToGecko(
                 new GeckoEvent(GeckoEvent.IME_DELETE_TEXT, 0, 0));
         } else {
             // Start and stop composition to force UI updates.
@@ -606,16 +621,18 @@ public class GeckoInputConnection
     // Start index of the composition within the text body
     int mCompositionStart;
     /* During a composition, we should not alter the real selection,
         therefore we keep our own offsets to emulate selection */
     // Start of fake selection, relative to start of composition
     int mCompositionSelStart;
     // Length of fake selection
     int mCompositionSelLen;
+    // Number of in flight changes
+    int mNumPendingChanges;
 
     ExtractedTextRequest mUpdateRequest;
     final ExtractedText mUpdateExtract = new ExtractedText();
 
     int mSelectionStart, mSelectionLength;
     SynchronousQueue<String> mQueryResult;
 }
 
--- a/gfx/cairo/cairo/src/cairo-d2d-surface.cpp
+++ b/gfx/cairo/cairo/src/cairo-d2d-surface.cpp
@@ -2505,21 +2505,38 @@ static cairo_status_t
     // We need to release the device after calling the constructor, since the
     // device destruction may release the D3D/D2D libraries.
     cairo_device_t *device = &d2dsurf->device->base;
     d2dsurf->~cairo_d2d_surface_t();
     cairo_release_device(device);
     return CAIRO_STATUS_SUCCESS;
 }
 
+/* The input types for src and dst don't match because in our particular use case, copying from a texture,
+ * those types don't match. */
+static void
+_copy_data_to_different_stride(unsigned char *dst, int dst_stride, void *src, UINT src_stride, int height)
+{
+
+    unsigned char *src_p = (unsigned char *)src;
+    int min_stride = MIN(dst_stride, src_stride);
+    while (height) {
+        memcpy(dst, src_p, min_stride);
+        height--;
+        dst += dst_stride;
+        src_p += src_stride;
+    }
+}
+
 static cairo_status_t
 _cairo_d2d_acquire_source_image(void                    *abstract_surface,
-				cairo_image_surface_t  **image_out,
+				cairo_image_surface_t  **image_out_ret,
 				void                   **image_extra)
 {
+    cairo_surface_t *image_out;
     cairo_d2d_surface_t *d2dsurf = static_cast<cairo_d2d_surface_t*>(abstract_surface);
     _cairo_d2d_flush(d2dsurf);
 
     HRESULT hr;
     D2D1_SIZE_U size = d2dsurf->rt->GetPixelSize();
 
     RefPtr<ID3D10Texture2D> softTexture;
 
@@ -2547,34 +2564,46 @@ static cairo_status_t
 
     d2dsurf->device->mD3D10Device->CopyResource(softTexture, d2dsurf->surface);
 
     D3D10_MAPPED_TEXTURE2D data;
     hr = softTexture->Map(0, D3D10_MAP_READ_WRITE, 0, &data);
     if (FAILED(hr)) {
 	return _cairo_error(CAIRO_STATUS_NO_DEVICE);
     }
-    *image_out = 
-	(cairo_image_surface_t*)cairo_image_surface_create_for_data((unsigned char*)data.pData,
-										  d2dsurf->format,
-										  size.width,
-										  size.height,
-										  data.RowPitch);
-
-    if (cairo_surface_status(&((*image_out)->base))) {
-	volatile cairo_status_t flambo[10];
-	for (int i=0; i<10; i++) {
-	    flambo[i] = cairo_surface_status(&((*image_out)->base));
-	}
-	volatile int p = 0;
-	p = 5/p;
+
+    if (_cairo_valid_stride_alignment(data.RowPitch)) {
+	image_out = cairo_image_surface_create_for_data((unsigned char*)data.pData,
+						  d2dsurf->format,
+						  size.width,
+						  size.height,
+						  data.RowPitch);
+    } else {
+	/* Slow path used when the stride doesn't match our requirements.
+	 * This is possible on at least the Intel driver 8.15.10.2302.
+	 *
+	 * Create a new image surface and copy our data into it */
+	image_out = cairo_image_surface_create(d2dsurf->format,
+					 size.width,
+					 size.height);
+	_copy_data_to_different_stride(cairo_image_surface_get_data(image_out),
+				       cairo_image_surface_get_stride(image_out),
+				       data.pData,
+				       data.RowPitch,
+				       size.height);
+
     }
+    /* these are the only surface statuses we expect */
+    assert(cairo_surface_status(image_out) == CAIRO_STATUS_SUCCESS ||
+	   cairo_surface_status(image_out) == CAIRO_STATUS_NO_MEMORY);
+
     *image_extra = softTexture.forget();
-
-    return CAIRO_STATUS_SUCCESS;
+    *image_out_ret = (cairo_image_surface_t*)image_out;
+
+    return cairo_surface_status(image_out);
 }
 
 static void
 _cairo_d2d_release_source_image(void                   *abstract_surface,
 				cairo_image_surface_t  *image,
 				void                   *image_extra)
 {
     if (((cairo_surface_t*)abstract_surface)->type != CAIRO_SURFACE_TYPE_D2D) {
--- a/gfx/cairo/cairo/src/cairoint.h
+++ b/gfx/cairo/cairo/src/cairoint.h
@@ -1903,16 +1903,22 @@ cairo_private void
    ((((bpp)*(w)+7)/8 + CAIRO_STRIDE_ALIGNMENT-1) & -CAIRO_STRIDE_ALIGNMENT)
 
 #define CAIRO_CONTENT_VALID(content) ((content) && 			         \
 				      (((content) & ~(CAIRO_CONTENT_COLOR |      \
 						      CAIRO_CONTENT_ALPHA |      \
 						      CAIRO_CONTENT_COLOR_ALPHA))\
 				       == 0))
 
+static inline cairo_bool_t
+_cairo_valid_stride_alignment(int stride)
+{
+    return !(stride & (CAIRO_STRIDE_ALIGNMENT-1));
+}
+
 cairo_private int
 _cairo_format_bits_per_pixel (cairo_format_t format) cairo_const;
 
 cairo_private cairo_format_t
 _cairo_format_from_content (cairo_content_t content) cairo_const;
 
 cairo_private cairo_format_t
 _cairo_format_from_pixman_format (pixman_format_code_t pixman_format);
--- a/gfx/layers/ThebesLayerBuffer.h
+++ b/gfx/layers/ThebesLayerBuffer.h
@@ -107,16 +107,20 @@ public:
    * mRegionToDraw must be drawn. mRegionToInvalidate has been invalidated
    * by ThebesLayerBuffer and must be redrawn on the screen.
    * mRegionToInvalidate is set when the buffer has changed from
    * opaque to transparent or vice versa, since the details of rendering can
    * depend on the buffer type.  mDidSelfCopy is true if we kept our buffer
    * but used MovePixels() to shift its content.
    */
   struct PaintState {
+    PaintState()
+      : mDidSelfCopy(PR_FALSE)
+    {}
+
     nsRefPtr<gfxContext> mContext;
     nsIntRegion mRegionToDraw;
     nsIntRegion mRegionToInvalidate;
     PRPackedBool mDidSelfCopy;
   };
 
   enum {
     PAINT_WILL_RESAMPLE = 0x01
--- a/gfx/src/Makefile.in
+++ b/gfx/src/Makefile.in
@@ -50,18 +50,16 @@ GRE_MODULE     = 1
 LIBXUL_LIBRARY = 1
 IS_COMPONENT   = 1
 # This library is used by other shared libs in a static build
 FORCE_USE_PIC  = 1
 
 XPIDLSRCS = \
 	nsIFontEnumerator.idl \
 	nsIScriptableRegion.idl \
-	gfxIFormats.idl \
-	gfxidltypes.idl \
 	$(NULL)
         
 EXPORTS	= \
 	gfxCore.h \
 	gfxCrashReporterUtils.h \
 	nsColor.h \
 	nsColorNames.h \
 	nsColorNameList.h \
deleted file mode 100644
--- a/gfx/src/gfxIFormats.idl
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Stuart Parmenter <pavlov@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * gfx image formats.
- * @file gfxIFormats.idl
- */
-
-#include "gfxidltypes.idl"
-
-/**
- * gfxIFormats interface
- *
- * @author Tim Rowley <tor@cs.brown.edu>
- * @author Stuart Parmenter <pavlov@netscape.com>
- * @version 0.0
- * @see gfx_format
- */
-[scriptable, uuid(96d086e6-1dd1-11b2-b6b2-b77b59390247)]
-interface gfxIFormats
-{
-  /**
-   * RGB    - duh...
-   */
-  const gfx_format RGB    = 0;
-
-  /**
-   * BGR    - same as RGB except byteswaped
-   */
-  const gfx_format BGR    = 1;
-
-
-  /**
-   * RGB_A1 - RGB image and 1-bit alpha mask
-   */
-  const gfx_format RGB_A1 = 2;
-
-  /**
-   * BGR_A1 - same as RGB_A1 except byteswaped
-   */
-  const gfx_format BGR_A1 = 3;
-
-
-  /**
-   * RGB_A8 - RGB image and 8-bit alpha image
-   */
-  const gfx_format RGB_A8 = 4;
-
-  /**
-   * BGR_A8 - same as RGB_A8 except byteswaped
-   */
-  const gfx_format BGR_A8 = 5;
-
-
-  /**
-   * RGBA   - packed RGBA image
-   */
-  const gfx_format RGBA   = 6;
-
-  /**
-   * BGRA   - packed RGBA image
-   */
-  const gfx_format BGRA   = 7;
-
-  /**
-   * PAL    - Palette based image data, all opaque colors
-   *		  PRUint32 colormap[256];
-   *		  PRUint8 pixels[width*height];
-   */
-  const gfx_format PAL    = 8;
-
-  /**
-   * PAL_A1 - Palette based image data, with transparency
-   *		  PRUint32 colormap[256];
-   *		  PRUint8 pixels[width*height];
-   */
-  const gfx_format PAL_A1 = 9;
-};
deleted file mode 100644
--- a/gfx/src/gfxidltypes.idl
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Stuart Parmenter <pavlov@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * gfx idl declarations to be used by all gfx interfaces.
- * @file gfxidltypes.idl
- */
-
-#include "nsrootidl.idl"
-
-/**
- * A color is a 32 bit unsigned integer with
- * four components: R, G, B and A.
- *
- * @var typedef PRUint32 gfx_color
- */
-typedef PRUint32            gfx_color;
-
-/**
- * typedef that should be used for bit depths
- * @var typedef unsigned short gfx_depth
- */
-typedef unsigned short      gfx_depth; // is short ok?
-
-/**
- * typedef that should be used for image formats
- * @var typedef long gfx_format
- * @see gfxIFormats
- */
-typedef long                gfx_format;
-
-[ptr] native nsIntRect(nsIntRect);
deleted file mode 100644
--- a/gfx/src/mozilla-decoder.cpp
+++ /dev/null
@@ -1,375 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim:expandtab:shiftwidth=4:tabstop=4:
- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is Christopher Blizzard
- * <blizzard@mozilla.org>.  Portions created by the Initial Developer
- * are Copyright (C) 2004 the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#define PANGO_ENABLE_BACKEND
-#define PANGO_ENABLE_ENGINE
-
-#include "mozilla-decoder.h"
-#include <pango/pangoxft.h>
-#include <pango/pangofc-fontmap.h>
-#include <pango/pangofc-font.h>
-#include <gdk/gdkx.h>
-
-#include "nsString.h"
-#include "nsIPersistentProperties2.h"
-#include "nsNetUtil.h"
-#include "nsReadableUtils.h"
-#include "nsICharsetConverterManager.h"
-#include "nsICharRepresentable.h"
-#include "nsCompressedCharMap.h"
-
-#undef DEBUG_CUSTOM_ENCODER
-
-G_DEFINE_TYPE (MozillaDecoder, mozilla_decoder, PANGO_TYPE_FC_DECODER)
-
-MozillaDecoder *mozilla_decoder_new      (void);
-
-static FcCharSet  *mozilla_decoder_get_charset (PangoFcDecoder *decoder,
-                                                PangoFcFont    *fcfont);
-static PangoGlyph  mozilla_decoder_get_glyph   (PangoFcDecoder *decoder,
-                                                PangoFcFont    *fcfont,
-                                                guint32         wc);
-
-static PangoFcDecoder *mozilla_find_decoder    (FcPattern *pattern,
-                                                gpointer   user_data);
-
-typedef struct _MozillaDecoderPrivate MozillaDecoderPrivate;
-
-#define MOZILLA_DECODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MOZILLA_TYPE_DECODER, MozillaDecoderPrivate))
-
-struct _MozillaDecoderPrivate {
-    char *family;
-    char *encoder;
-    char *cmap;
-    gboolean is_wide;
-    FcCharSet *charset;
-    nsCOMPtr<nsIUnicodeEncoder> uEncoder;
-};
-
-static nsICharsetConverterManager *gCharsetManager = NULL;
-
-static NS_DEFINE_CID(kCharsetConverterManagerCID,
-                     NS_ICHARSETCONVERTERMANAGER_CID);
-
-// Hash tables that hold the custom encodings and custom cmaps used in
-// various fonts.
-GHashTable *encoder_hash = NULL;
-GHashTable *cmap_hash = NULL;
-GHashTable *wide_hash = NULL;
-
-void
-mozilla_decoder_init (MozillaDecoder *decoder)
-{
-}
-
-void
-mozilla_decoder_class_init (MozillaDecoderClass *klass)
-{
-    GObjectClass *object_class = G_OBJECT_CLASS(klass);
-    PangoFcDecoderClass *parent_class = PANGO_FC_DECODER_CLASS (klass);
-
-    /*   object_class->finalize = test_finalize; */
-
-    parent_class->get_charset = mozilla_decoder_get_charset;
-    parent_class->get_glyph = mozilla_decoder_get_glyph;
-
-    g_type_class_add_private (object_class, sizeof (MozillaDecoderPrivate));
-}
-
-MozillaDecoder *
-mozilla_decoder_new(void)
-{
-    return (MozillaDecoder *)g_object_new(MOZILLA_TYPE_DECODER, NULL);
-}
-
-#ifdef DEBUG_CUSTOM_ENCODER
-void
-dump_hash(char *key, char *val, void *arg)
-{
-    printf("%s -> %s\n", key, val);
-}
-#endif
-
-/**
- * mozilla_decoders_init:
- *
- * #mozilla_decoders_init:
- *
- * This initializes all of the application-specific custom decoders
- * that Mozilla uses.  This should only be called once during the
- * lifetime of the application.
- *
- * Return value: zero on success, not zero on failure.
- *
- **/
-
-int
-mozilla_decoders_init(void)
-{
-    static PRBool initialized = PR_FALSE;
-    if (initialized)
-        return 0;
-
-    encoder_hash = g_hash_table_new(g_str_hash, g_str_equal);
-    cmap_hash = g_hash_table_new(g_str_hash, g_str_equal);
-    wide_hash = g_hash_table_new(g_str_hash, g_str_equal);
-
-    PRBool dumb = PR_FALSE;
-    nsCOMPtr<nsIPersistentProperties> props;
-    nsCOMPtr<nsISimpleEnumerator> encodeEnum;
-
-    NS_LoadPersistentPropertiesFromURISpec(getter_AddRefs(props),
-        NS_LITERAL_CSTRING("resource://gre/res/fonts/pangoFontEncoding.properties"));
-
-    if (!props)
-        goto loser;
-
-    // Enumerate the properties in this file and figure out all of the
-    // fonts for which we have custom encodings.
-    props->Enumerate(getter_AddRefs(encodeEnum));
-    if (!encodeEnum)
-        goto loser;
-
-    while (encodeEnum->HasMoreElements(&dumb), dumb) {
-        nsCOMPtr<nsIPropertyElement> prop;
-        encodeEnum->GetNext(getter_AddRefs(prop));
-        if (!prop)
-            goto loser;
-
-        nsCAutoString name;
-        prop->GetKey(name);
-        nsAutoString value;
-        prop->GetValue(value);
-
-        if (!StringBeginsWith(name, NS_LITERAL_CSTRING("encoding."))) {
-            printf("string doesn't begin with encoding?\n");
-            continue;
-        }
-
-        name = Substring(name, 9);
-
-        if (StringEndsWith(name, NS_LITERAL_CSTRING(".ttf"))) {
-            name = Substring(name, 0, name.Length() - 4);
-
-            // Strip off a .wide if it's there.
-            if (StringEndsWith(value, NS_LITERAL_STRING(".wide"))) {
-                g_hash_table_insert(wide_hash, g_strdup(name.get()),
-                                    g_strdup("wide"));
-                value = Substring(value, 0, name.Length() - 5);
-            }
-
-            g_hash_table_insert(encoder_hash,
-                                g_strdup(name.get()),
-                                g_strdup(NS_ConvertUTF16toUTF8(value).get()));
-        }
-        else if (StringEndsWith(name, NS_LITERAL_CSTRING(".ftcmap"))) {
-            name = Substring(name, 0, name.Length() - 7);
-            g_hash_table_insert(cmap_hash,
-                                g_strdup(name.get()),
-                                g_strdup(NS_ConvertUTF16toUTF8(value).get()));
-        }
-        else {
-            printf("unknown suffix used for mapping\n");
-        }
-    }
-
-    pango_fc_font_map_add_decoder_find_func(PANGO_FC_FONT_MAP(pango_xft_get_font_map(GDK_DISPLAY(),gdk_x11_get_default_screen())),
-                                            mozilla_find_decoder,
-                                            NULL,
-                                            NULL);
-
-    initialized = PR_TRUE;
-
-#ifdef DEBUG_CUSTOM_ENCODER
-    printf("*** encoders\n");
-    g_hash_table_foreach(encoder_hash, (GHFunc)dump_hash, NULL);
-
-    printf("*** cmaps\n");
-    g_hash_table_foreach(cmap_hash, (GHFunc)dump_hash, NULL);
-#endif
-
-    return 0;
-
- loser:
-    return -1;
-}
-
-FcCharSet *
-mozilla_decoder_get_charset (PangoFcDecoder *decoder,
-                             PangoFcFont    *fcfont)
-{
-    MozillaDecoderPrivate *priv = MOZILLA_DECODER_GET_PRIVATE(decoder);
-
-    if (priv->charset)
-        return priv->charset;
-
-    // First time this has been accessed.  Populate the charset.
-    priv->charset = FcCharSetCreate();
-
-    if (!gCharsetManager) {
-        CallGetService(kCharsetConverterManagerCID, &gCharsetManager);
-    }
-
-    nsCOMPtr<nsIUnicodeEncoder> encoder;
-    nsCOMPtr<nsICharRepresentable> represent;
-
-    if (!gCharsetManager)
-        goto end;
-
-    gCharsetManager->GetUnicodeEncoderRaw(priv->encoder, getter_AddRefs(encoder));
-    if (!encoder)
-        goto end;
-    
-    encoder->SetOutputErrorBehavior(encoder->kOnError_Replace, nsnull, '?');
-
-    priv->uEncoder = encoder;
-
-    represent = do_QueryInterface(encoder);
-    if (!represent)
-        goto end;
-
-    PRUint32 map[UCS2_MAP_LEN];
-    memset(map, 0, sizeof(map));
-
-    represent->FillInfo(map);
-
-    for (int i = 0; i < NUM_UNICODE_CHARS; i++) {
-        if (IS_REPRESENTABLE(map, i))
-            FcCharSetAddChar(priv->charset, i);
-    }
-
- end:
-    return priv->charset;
-}
-
-PangoGlyph
-mozilla_decoder_get_glyph   (PangoFcDecoder *decoder,
-                             PangoFcFont    *fcfont,
-                             guint32         wc)
-{
-    MozillaDecoderPrivate *priv = MOZILLA_DECODER_GET_PRIVATE(decoder);
-
-    PangoGlyph retval = 0;
-    PRUnichar inchar = wc;
-    PRInt32 inlen = 1;
-    char outchar[2] = {0,0};
-    PRInt32 outlen = 2;
-
-    priv->uEncoder->Convert(&inchar, &inlen, outchar, &outlen);
-    if (outlen != 1) {
-        printf("Warning: mozilla_decoder_get_glyph doesn't support more than one character conversions.\n");
-        return 0;
-    }
-
-    FT_Face face = pango_fc_font_lock_face(fcfont);
-
-#ifdef DEBUG_CUSTOM_ENCODER
-    char *filename;
-    FcPatternGetString(fcfont->font_pattern, FC_FILE, 0, (FcChar8 **)&filename);
-    printf("filename is %s\n", filename);
-#endif
-
-    // Make sure to set the right charmap before trying to get the
-    // glyph
-    if (priv->cmap) {
-        if (!strcmp(priv->cmap, "mac_roman")) {
-            FT_Select_Charmap(face, ft_encoding_apple_roman);
-        }
-        else if (!strcmp(priv->cmap, "unicode")) {
-            FT_Select_Charmap(face, ft_encoding_unicode);
-        }
-        else {
-            printf("Warning: Invalid charmap entry for family %s\n",
-                   priv->family);
-        }
-    }
-
-    // Standard 8 bit to glyph translation
-    if (!priv->is_wide) {
-        FcChar32 blah = PRUint8(outchar[0]);
-        retval = FT_Get_Char_Index(face, blah);
-#ifdef DEBUG_CUSTOM_ENCODER
-        printf("wc 0x%x outchar[0] 0x%x index 0x%x retval 0x%x face %p\n",
-               wc, outchar[0], blah, retval, (void *)face);
-#endif
-    }
-    else {
-        printf("Warning: We don't support .wide fonts!\n");
-        retval = 0;
-    }
-
-    pango_fc_font_unlock_face(fcfont);
-
-    return retval;
-}
-
-PangoFcDecoder *
-mozilla_find_decoder (FcPattern *pattern, gpointer user_data)
-{
-    // Compare the family name of the font that's been opened to see
-    // if we have a custom decoder.
-    const char *orig = NULL;
-    FcPatternGetString(pattern, FC_FAMILY, 0, (FcChar8 **)&orig);
-
-    nsCAutoString family;
-    family.Assign(orig);
-
-    family.StripWhitespace();
-    ToLowerCase(family);
-
-    char *encoder = (char *)g_hash_table_lookup(encoder_hash, family.get());
-    if (!encoder)
-        return NULL;
-
-    MozillaDecoder *decoder = mozilla_decoder_new();
-
-    MozillaDecoderPrivate *priv = MOZILLA_DECODER_GET_PRIVATE(decoder);
-
-    priv->family = g_strdup(family.get());
-    priv->encoder = g_strdup(encoder);
-
-    char *cmap = (char *)g_hash_table_lookup(cmap_hash, family.get());
-    if (cmap)
-        priv->cmap = g_strdup(cmap);
-
-    char *wide = (char *)g_hash_table_lookup(wide_hash, family.get());
-    if (wide)
-        priv->is_wide = TRUE;
-
-    return PANGO_FC_DECODER(decoder);
-}
deleted file mode 100644
--- a/gfx/src/mozilla-decoder.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim:expandtab:shiftwidth=4:tabstop=4:
- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is Christopher Blizzard
- * <blizzard@mozilla.org>.  Portions created by the Initial Developer
- * are Copyright (C) 2004 the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef _MOZILLA_DECODER_H
-#define _MOZILLA_DECODER_H
-
-#include <pango/pangofc-decoder.h>
-
-G_BEGIN_DECLS
-
-#define MOZILLA_TYPE_DECODER (mozilla_decoder_get_type())
-#define MOZILLA_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOZILLA_TYPE_DECODER, MozillaDecoder))
-#define MOZILLA_IS_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOZILLA_TYPE_DECODER))
-
-typedef struct _MozillaDecoder      MozillaDecoder;
-typedef struct _MozillaDecoderClass MozillaDecoderClass;
-
-#define MOZILLA_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOZILLA_TYPE_DECODER, MozillaDecoderClass))
-#define MOZILLA_IS_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOZILLA_TYPE_DECODER))
-#define MOZILLA_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOZILLA_TYPE_DECODER, MozillaDecoderClass))
-
-struct _MozillaDecoder
-{
-  PangoFcDecoder parent_instance;
-};
-
-struct _MozillaDecoderClass
-{
-  PangoFcDecoderClass parent_class;
-};
-
-GType           mozilla_decoder_get_type (void);
-int             mozilla_decoders_init    (void);
-
-G_END_DECLS
-
-#endif /*_MOZILLA_DECODER_H */
--- a/gfx/src/nsCoord.h
+++ b/gfx/src/nsCoord.h
@@ -51,18 +51,17 @@
  *
  * Normally all coordinates are maintained in an app unit coordinate
  * space. An app unit is 1/60th of a CSS device pixel, which is, in turn
  * an integer number of device pixels, such at the CSS DPI is as close to
  * 96dpi as possible.
  */
 
 // This controls whether we're using integers or floats for coordinates. We
-// want to eventually use floats. If you change this, you need to manually
-// change the definition of nscoord in gfx/src/gfxidltypes.idl.
+// want to eventually use floats.
 //#define NS_COORD_IS_FLOAT
 
 inline float NS_IEEEPositiveInfinity() {
   union { PRUint32 mPRUint32; float mFloat; } pun;
   pun.mPRUint32 = 0x7F800000;
   return pun.mFloat;
 }
 inline PRBool NS_IEEEIsNan(float aF) {
--- a/gfx/src/nsGfxCIID.h
+++ b/gfx/src/nsGfxCIID.h
@@ -37,20 +37,16 @@
 
 #ifndef nsGfxCIID_h__
 #define nsGfxCIID_h__
 
 #define NS_FONT_ENUMERATOR_CID \
 { 0xa6cf9115, 0x15b3, 0x11d2, \
 { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } }
 
-#define NS_REGION_CID \
-{ 0xe12752f0, 0xee9a, 0x11d1, \
-{ 0xa8, 0x2a, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } }
-
 #define NS_SCRIPTABLE_REGION_CID \
 { 0xda5b130a, 0x1dd1, 0x11b2, \
 { 0xad, 0x47, 0xf4, 0x55, 0xb1, 0x81, 0x4a, 0x78 } }
 
 #define NS_GFX_INITIALIZATION_CID \
 { 0x67c41576, 0x9664, 0x4ed5, \
 { 0x90, 0xc1, 0xf6, 0x68, 0x3f, 0xd5, 0x2c, 0x8f } }
 
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -180,22 +180,22 @@ CPPSRCS		= \
 		jsutil.cpp \
 		jswatchpoint.cpp \
 		jsweakmap.cpp \
 		jswrapper.cpp \
 		jsxdrapi.cpp \
 		jsxml.cpp \
 		prmjtime.cpp \
 		sharkctl.cpp \
-		Debugger.cpp \
-		GlobalObject.cpp \
-		Stack.cpp \
-		String.cpp \
-		ParseMaps.cpp \
-		Unicode.cpp \
+		vm/Debugger.cpp \
+		vm/GlobalObject.cpp \
+		vm/Stack.cpp \
+		vm/String.cpp \
+		frontend/ParseMaps.cpp \
+		vm/Unicode.cpp \
 		$(NULL)
 
 # Changes to internal header files, used externally, massively slow down
 # browser builds.  Don't add new files here unless you know what you're
 # doing!
 INSTALLED_HEADERS = \
 		js-config.h \
 		jsautocfg.h \
@@ -261,161 +261,151 @@ INSTALLED_HEADERS = \
 		jsval.h \
 		jsvalue.h \
 		prmjtime.h \
 		$(NULL)
 
 ######################################################
 # BEGIN include sources for the engine subdirectories
 #
-VPATH		+= \
-		$(srcdir)/vm \
-		$(srcdir)/frontend \
-		$(NULL)
 
 EXPORTS_NAMESPACES = vm
 
 EXPORTS_vm = \
-		ArgumentsObject.h \
-		GlobalObject.h \
-		Stack.h \
-		String.h \
-		StringObject.h \
-		Unicode.h  \
-		$(NULL)
+  vm/ArgumentsObject.h \
+  vm/GlobalObject.h \
+  vm/Stack.h \
+  vm/String.h \
+  vm/StringObject.h \
+  vm/Unicode.h  \
+  $(NULL)
 
 ###############################################
 # BEGIN include sources for low-level code shared with Gecko
 #
-VPATH		+= \
-		$(srcdir)/../../mfbt \
-		$(NULL)
+MFBT_DIR = $(srcdir)/../../mfbt
 
 EXPORTS_NAMESPACES += mozilla
 
 EXPORTS_mozilla = \
-		RangedPtr.h \
-		RefPtr.h	\
-		Types.h		\
-		Util.h          \
-		$(NULL)
+  $(MFBT_DIR)/RangedPtr.h \
+  $(MFBT_DIR)/RefPtr.h \
+  $(MFBT_DIR)/Types.h \
+  $(MFBT_DIR)/Util.h \
+  $(NULL)
 
 ifdef ENABLE_TRACEJIT
-VPATH		+= \
-		$(srcdir)/tracejit \
-		$(srcdir)/nanojit \
 
 INSTALLED_HEADERS += \
-		jsbuiltins.h    \
-		Assembler.h     \
-		Allocator.h     \
-		CodeAlloc.h     \
-		Containers.h    \
-		LIR.h		\
-		LIRopcode.tbl \
-		avmplus.h	\
-		Fragmento.h	\
-		Native.h	\
-		NativeCommon.h	\
-		Native$(NANOJIT_ARCH).h \
-		njconfig.h      \
-		njcpudetect.h   \
-		RegAlloc.h	\
-		nanojit.h	\
-		VMPI.h		\
-		Writer.h	\
-		$(NULL)
+  jsbuiltins.h \
+  nanojit/Assembler.h \
+  nanojit/Allocator.h \
+  nanojit/CodeAlloc.h \
+  nanojit/Containers.h \
+  nanojit/LIR.h \
+  nanojit/LIRopcode.tbl \
+  nanojit/avmplus.h \
+  nanojit/Fragmento.h \
+  nanojit/Native.h \
+  nanojit/NativeCommon.h \
+  nanojit/Native$(NANOJIT_ARCH).h \
+  nanojit/njconfig.h \
+  nanojit/njcpudetect.h \
+  nanojit/RegAlloc.h \
+  nanojit/nanojit.h \
+  nanojit/VMPI.h \
+  tracejit/Writer.h \
+  $(NULL)
 
 CPPSRCS += \
-		jstracer.cpp \
-		Assembler.cpp  \
-		Allocator.cpp  \
-		CodeAlloc.cpp  \
-		Containers.cpp \
-		Fragmento.cpp  \
-		LIR.cpp        \
-		njconfig.cpp   \
-		RegAlloc.cpp   \
-		avmplus.cpp    \
-		Native$(NANOJIT_ARCH).cpp \
-		jsbuiltins.cpp \
-		VMPI.cpp       \
-		Writer.cpp     \
-		$(NULL)
+  jstracer.cpp \
+  nanojit/Assembler.cpp  \
+  nanojit/Allocator.cpp  \
+  nanojit/CodeAlloc.cpp  \
+  nanojit/Containers.cpp \
+  nanojit/Fragmento.cpp  \
+  nanojit/LIR.cpp        \
+  nanojit/njconfig.cpp   \
+  nanojit/RegAlloc.cpp   \
+  nanojit/avmplus.cpp    \
+  nanojit/Native$(NANOJIT_ARCH).cpp \
+  jsbuiltins.cpp \
+  nanojit/VMPI.cpp \
+  tracejit/Writer.cpp \
+  $(NULL)
 
 endif # ENABLE_TRACEJIT
 ifdef ENABLE_METHODJIT
 
 ###############################################
 # BEGIN include sources for the method JIT
 #
-VPATH += 	$(srcdir)/methodjit
 
-CPPSRCS += 	MethodJIT.cpp \
-		StubCalls.cpp \
-		Compiler.cpp \
-		FrameState.cpp \
-		FastArithmetic.cpp \
-		FastOps.cpp \
-		StubCompiler.cpp \
-		MonoIC.cpp \
-		PolyIC.cpp \
-		ImmutableSync.cpp \
-		InvokeHelpers.cpp \
-		Retcon.cpp \
-		TrampolineCompiler.cpp \
-		$(NULL)
+CPPSRCS += \
+  methodjit/MethodJIT.cpp \
+  methodjit/StubCalls.cpp \
+  methodjit/Compiler.cpp \
+  methodjit/FrameState.cpp \
+  methodjit/FastArithmetic.cpp \
+  methodjit/FastOps.cpp \
+  methodjit/StubCompiler.cpp \
+  methodjit/MonoIC.cpp \
+  methodjit/PolyIC.cpp \
+  methodjit/ImmutableSync.cpp \
+  methodjit/InvokeHelpers.cpp \
+  methodjit/Retcon.cpp \
+  methodjit/TrampolineCompiler.cpp \
+  $(NULL)
 
 ifeq (86, $(findstring 86,$(TARGET_CPU)))
 ifeq (x86_64, $(TARGET_CPU))
 ifdef _MSC_VER
-ASFILES +=	TrampolineMasmX64.asm
+ASFILES +=	methodjit/TrampolineMasmX64.asm
 endif
 ifeq ($(OS_ARCH),WINNT)
 ifdef GNU_CC
-ASFILES +=	TrampolineMingwX64.s
+ASFILES +=	methodjit/TrampolineMingwX64.s
 endif
 endif
 ifdef SOLARIS_SUNPRO_CXX
-ASFILES +=	TrampolineSUNWX64.s
+ASFILES +=	methodjit/TrampolineSUNWX64.s
 endif
 #CPPSRCS		+= only_on_x86_64.cpp
 else
 #CPPSRCS		+= only_on_x86.cpp
 ifdef SOLARIS_SUNPRO_CXX
-ASFILES +=	TrampolineSUNWX86.s
+ASFILES +=	methodjit/TrampolineSUNWX86.s
 endif
 endif
 endif
 ifeq (arm, $(TARGET_CPU))
 #CPPSRCS		+= only_on_arm.cpp
 endif
 ifeq (sparc, $(findstring sparc,$(TARGET_CPU)))
-ASFILES +=	TrampolineSparc.s
+ASFILES +=	methodjit/TrampolineSparc.s
 endif
 #
 # END enclude sources for the method JIT
 #############################################
 
 endif
 
 ###############################################
 # BEGIN include sources for V8 dtoa
 #
-VPATH += 	$(srcdir)/v8-dtoa \
-		$(NONE)
 
-CPPSRCS += 	checks.cc \
-		conversions.cc \
-		diy-fp.cc \
-		v8-dtoa.cc \
-		fast-dtoa.cc \
-		platform.cc \
-		utils.cc \
-		$(NONE)
+CPPSRCS += \
+  v8-dtoa/checks.cc \
+  v8-dtoa/conversions.cc \
+  v8-dtoa/diy-fp.cc \
+  v8-dtoa/v8-dtoa.cc \
+  v8-dtoa/fast-dtoa.cc \
+  v8-dtoa/platform.cc \
+  v8-dtoa/utils.cc \
+  $(NULL)
 
 #
 # END enclude sources for V8 dtoa
 #############################################
 
 ifeq (,$(filter arm% sparc %86 x86_64,$(TARGET_CPU)))
 
 VPATH +=	$(srcdir)/assembler \
@@ -477,21 +467,20 @@ ifeq (arm, $(TARGET_CPU))
 endif
 #
 # END enclude sources for the Nitro assembler
 #############################################
 
 endif
 
 ifdef JS_HAS_CTYPES
-VPATH += $(srcdir)/ctypes
 
 CPPSRCS += \
-    CTypes.cpp \
-    Library.cpp \
+    ctypes/CTypes.cpp \
+    ctypes/Library.cpp \
     $(NULL)
 
 ifdef MOZ_NATIVE_FFI
 LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS)
 else
 LOCAL_INCLUDES = -Ictypes/libffi/include
 endif
 
@@ -521,23 +510,22 @@ INSTALLED_HEADERS += \
 		$(CURDIR)/javascript-trace.h \
 		$(NULL)
 endif
 
 # PerfMeasurement is available regardless of low-level support for it;
 # it just doesn't necessarily do anything useful.  There is one
 # implementation source file per supported operating system, plus a stub
 # for unsupported OSes, plus the Javascript wrapper.
-VPATH += $(srcdir)/perf
-INSTALLED_HEADERS += jsperf.h
-CPPSRCS += jsperf.cpp
+INSTALLED_HEADERS += perf/jsperf.h
+CPPSRCS += perf/jsperf.cpp
 ifdef HAVE_LINUX_PERF_EVENT_H
-CPPSRCS += pm_linux.cpp
+CPPSRCS += perf/pm_linux.cpp
 else
-CPPSRCS += pm_stub.cpp
+CPPSRCS += perf/pm_stub.cpp
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 INSTALLED_HEADERS += jscpucfg.h
 endif
 
 EXPORTS = $(INSTALLED_HEADERS)
 
@@ -740,16 +728,24 @@ DIST_GARBAGE = config.cache config.log c
 
 distclean::
 	cat unallmakefiles | $(XARGS) rm -f
 	$(RM) $(DIST_GARBAGE)
 
 # our build system doesn't handle subdir srcs very gracefully today
 export::
 	$(MKDIR) -p nanojit
+	$(MKDIR) -p vm
+	$(MKDIR) -p frontend
+	$(MKDIR) -p tracejit
+	$(MKDIR) -p methodjit
+	$(MKDIR) -p v8-dtoa
+	$(MKDIR) -p perf
+
+GARBAGE_DIRS += nanojit vm frontend tracejit methodjit v8-dtoa perf
 
 DEFINES		+= -DEXPORT_JS_API
 
 # mfbt is always packed with us, so if we're building a shared object,
 # we need to declare "exported" mfbt symbols on its behalf when we use
 # its headers.
 DEFINES		+= -DIMPL_MFBT
 
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -428,17 +428,17 @@ ifdef MOZ_UPDATE_XTERM
 # Its good not to have a newline at the end of the titlebar string because it
 # makes the make -s output easier to read.  Echo -n does not work on all
 # platforms, but we can trick sed into doing it.
 UPDATE_TITLE = sed -e "s!Y!$(1) in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2)!" $(MOZILLA_DIR)/config/xterm.str;
 endif
 
 define SUBMAKE # $(call SUBMAKE,target,directory)
 +@$(UPDATE_TITLE)
-+@$(MAKE) $(if $(2),-C $(2)) $(1)
++$(MAKE) $(if $(2),-C $(2)) $(1)
 
 endef # The extra line is important here! don't delete it
 
 ifneq (,$(strip $(DIRS)))
 LOOP_OVER_DIRS = \
   $(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
 endif
 
@@ -893,18 +893,21 @@ ifdef PROGRAM
 	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/$(MOZ_APP_NAME)
 endif
 ifdef SHARED_LIBRARY
 	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(SHARED_LIBRARY_NAME) $(DIST)/$(MOZ_APP_NAME)
 endif
 endif # SHARED_LIBRARY || PROGRAM
+else  # ! WINNT_
+# Force rebuilding all objects on the second pass
+$(OBJS): FORCE
 endif # WINNT_
-endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
+endif # MOZ_PROFILE_USE
 ifdef MOZ_PROFILE_GENERATE
 # Clean up profiling data during PROFILE_GENERATE phase
 export::
 ifeq ($(OS_ARCH)_$(GNU_CC), WINNT_)
 	-$(RM) *.pgd
 else
 ifdef GNU_CC
 	-$(RM) *.gcda
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -5342,18 +5342,16 @@ CClosure::ClosureStub(ffi_cif* cif, void
   JSObject* thisObj = cinfo->thisObj;
   JSObject* jsfnObj = cinfo->jsfnObj;
 
   ScopedContextThread scopedThread(cx);
 
   // Assert that we're on the thread we were created from.
   JS_ASSERT(cinfo->cxThread == JS_GetContextThread(cx));
 
-  JS_AbortIfWrongThread(JS_GetRuntime(cx));
-
   JSAutoRequest ar(cx);
 
   JSAutoEnterCompartment ac;
   if (!ac.enter(cx, jsfnObj))
     return;
 
   // Assert that our CIFs agree.
   FunctionInfo* fninfo = FunctionType::GetFunctionInfo(cx, typeObj);
--- a/js/src/jsapi-tests/Makefile.in
+++ b/js/src/jsapi-tests/Makefile.in
@@ -78,16 +78,18 @@ CPPSRCS = \
   testPropCache.cpp \
   testRegExp.cpp \
   testResolveRecursion.cpp \
   testSameValue.cpp \
   testScriptInfo.cpp \
   testScriptObject.cpp \
   testSetProperty.cpp \
   testStringBuffer.cpp \
+  testThreadGC.cpp \
+  testThreads.cpp \
   testTrap.cpp \
   testUTF8.cpp \
   testVersion.cpp \
   testXDR.cpp \
   $(NULL)
 
 # Disabled: an entirely unrelated test seems to cause this to fail.  Moreover,
 # given the test's dependence on interactions between the compiler, the GC, and
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/testThreadGC.cpp
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99:
+ */
+
+#ifdef JS_THREADSAFE
+
+#include "tests.h"
+#include "prthread.h"
+
+#include "jscntxt.h"
+
+/*
+ * We test that if a GC callback cancels the GC on a child thread the GC can
+ * still proceed on the main thread even if the child thread continue to
+ * run uninterrupted.
+ */
+
+struct SharedData {
+    enum ChildState {
+        CHILD_STARTING,
+        CHILD_RUNNING,
+        CHILD_DONE,
+        CHILD_ERROR
+    };
+
+    JSRuntime   *const runtime;
+    PRThread    *const mainThread;
+    PRLock      *const lock;
+    PRCondVar   *const signal;
+    ChildState  childState;
+    bool        childShouldStop;
+    JSContext   *childContext;
+
+    SharedData(JSRuntime *rt, bool *ok)
+      : runtime(rt),
+        mainThread(PR_GetCurrentThread()),
+        lock(PR_NewLock()),
+        signal(lock ? PR_NewCondVar(lock) : NULL),
+        childState(CHILD_STARTING),
+        childShouldStop(false),
+        childContext(NULL)
+    {
+        JS_ASSERT(!*ok);
+        *ok = !!signal;
+    }
+
+    ~SharedData() {
+        if (signal)
+            PR_DestroyCondVar(signal);
+        if (lock)
+            PR_DestroyLock(lock);
+    }
+};
+
+static SharedData *shared;
+
+static JSBool
+CancelNonMainThreadGCCallback(JSContext *cx, JSGCStatus status)
+{
+    return status != JSGC_BEGIN || PR_GetCurrentThread() == shared->mainThread;
+}
+
+static JSBool
+StopChildOperationCallback(JSContext *cx)
+{
+    bool shouldStop;
+    PR_Lock(shared->lock);
+    shouldStop = shared->childShouldStop;
+    PR_Unlock(shared->lock);
+    return !shouldStop;
+}
+
+static JSBool
+NotifyMainThreadAboutBusyLoop(JSContext *cx, uintN argc, jsval *vp)
+{
+    PR_Lock(shared->lock);
+    JS_ASSERT(shared->childState == SharedData::CHILD_STARTING);
+    shared->childState = SharedData::CHILD_RUNNING;
+    shared->childContext = cx;
+    PR_NotifyCondVar(shared->signal);
+    PR_Unlock(shared->lock);
+
+    return true;
+}
+
+static void
+ChildThreadMain(void *arg)
+{
+    JS_ASSERT(!arg);
+    bool error = true;
+    JSContext *cx = JS_NewContext(shared->runtime, 8192);
+    if (cx) {
+        JS_SetOperationCallback(cx, StopChildOperationCallback);
+        JSAutoRequest ar(cx);
+        JSObject *global = JS_NewCompartmentAndGlobalObject(cx, JSAPITest::basicGlobalClass(),
+                                                            NULL);
+        if (global) {
+            JS_SetGlobalObject(cx, global);
+            if (JS_InitStandardClasses(cx, global) &&
+                JS_DefineFunction(cx, global, "notify", NotifyMainThreadAboutBusyLoop, 0, 0)) {
+
+                jsval rval;
+                static const char code[] = "var i = 0; notify(); for (var i = 0; ; ++i);";
+                JSBool ok = JS_EvaluateScript(cx, global, code, strlen(code),
+                                              __FILE__, __LINE__, &rval);
+                if (!ok && !JS_IsExceptionPending(cx)) {
+                    /* Evaluate should only return via the callback cancellation. */
+                    error = false;
+                }
+            }
+        }
+    }
+
+    PR_Lock(shared->lock);
+    shared->childState = error ? SharedData::CHILD_DONE : SharedData::CHILD_ERROR;
+    shared->childContext = NULL;
+    PR_NotifyCondVar(shared->signal);
+    PR_Unlock(shared->lock);
+
+    if (cx)
+        JS_DestroyContextNoGC(cx);
+}
+
+BEGIN_TEST(testThreadGC_bug590533)
+    {
+        /*
+         * Test the child thread busy running while the current thread calls
+         * the GC both with JSRuntime->gcIsNeeded set and unset.
+         */
+        bool ok = TestChildThread(true);
+        CHECK(ok);
+        ok = TestChildThread(false);
+        CHECK(ok);
+        return ok;
+    }
+
+    bool TestChildThread(bool setGCIsNeeded)
+    {
+        bool ok = false;
+        shared = new SharedData(rt, &ok);
+        CHECK(ok);
+
+        JSGCCallback oldGCCallback = JS_SetGCCallback(cx, CancelNonMainThreadGCCallback);
+
+        PRThread *thread =
+            PR_CreateThread(PR_USER_THREAD, ChildThreadMain, NULL,
+                            PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, PR_JOINABLE_THREAD, 0);
+        if (!thread)
+            return false;
+
+        PR_Lock(shared->lock);
+        while (shared->childState == SharedData::CHILD_STARTING)
+            PR_WaitCondVar(shared->signal, PR_INTERVAL_NO_TIMEOUT);
+        JS_ASSERT(shared->childState != SharedData::CHILD_DONE);
+        ok = (shared->childState == SharedData::CHILD_RUNNING);
+        PR_Unlock(shared->lock);
+
+        CHECK(ok);
+
+        if (setGCIsNeeded) {
+            /*
+             * Use JS internal API to set the GC trigger flag after we know
+             * that the child is in a request and is about to run an infinite
+             * loop. Then run the GC with JSRuntime->gcIsNeeded flag set.
+             */
+            js::AutoLockGC lock(rt);
+            js::TriggerGC(rt);
+        }
+
+        JS_GC(cx);
+
+        PR_Lock(shared->lock);
+        shared->childShouldStop = true;
+        while (shared->childState == SharedData::CHILD_RUNNING) {
+            JS_TriggerOperationCallback(shared->childContext);
+            PR_WaitCondVar(shared->signal, PR_INTERVAL_NO_TIMEOUT);
+        }
+        JS_ASSERT(shared->childState != SharedData::CHILD_STARTING);
+        ok = (shared->childState == SharedData::CHILD_DONE);
+        PR_Unlock(shared->lock);
+
+        JS_SetGCCallback(cx, oldGCCallback);
+
+        PR_JoinThread(thread);
+
+        delete shared;
+        shared = NULL;
+
+        return true;
+    }
+
+
+END_TEST(testThreadGC_bug590533)
+
+#endif
new file mode 100644
--- /dev/null
+++ b/js/src/jsapi-tests/testThreads.cpp
@@ -0,0 +1,174 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sw=4 et tw=99:
+ */
+
+#ifdef JS_THREADSAFE
+
+#include "tests.h"
+#include "prthread.h"
+
+struct ThreadData {
+    JSRuntime *rt;
+    JSObject *obj;
+    const char *code;
+    bool ok;
+};
+
+BEGIN_TEST(testThreads_bug561444)
+    {
+        const char *code = "<a><b/></a>.b.@c = '';";
+        EXEC(code);
+
+        jsrefcount rc = JS_SuspendRequest(cx);
+        {
+            ThreadData data = {rt, global, code, false};
+            PRThread *thread = 
+                PR_CreateThread(PR_USER_THREAD, threadMain, &data,
+                                PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, PR_JOINABLE_THREAD, 0);
+            CHECK(thread);
+            PR_JoinThread(thread);
+            CHECK(data.ok);
+        }
+        JS_ResumeRequest(cx, rc);
+        return true;
+    }
+
+    static void threadMain(void *arg) {
+        ThreadData *d = (ThreadData *) arg;
+
+        JSContext *cx = JS_NewContext(d->rt, 8192);
+        if (!cx)
+            return;
+        JS_BeginRequest(cx);
+        {
+            JSAutoEnterCompartment ac;
+            jsval v;
+            d->ok = ac.enter(cx, d->obj) &&
+                    JS_EvaluateScript(cx, d->obj, d->code, strlen(d->code), __FILE__, __LINE__,
+                                      &v);
+        }
+        JS_DestroyContext(cx);
+    }
+END_TEST(testThreads_bug561444)
+
+const PRUint32 NATIVE_STACK_SIZE = 64 * 1024;
+const PRUint32 NATIVE_STACK_HEADROOM = 8 * 1024;
+
+template <class T>
+class Repeat {
+    size_t n;
+    const T &t;
+
+  public:
+    Repeat(size_t n, const T &t) : n(n), t(t) {}
+
+    bool operator()() const {
+	for (size_t i = 0; i < n; i++)
+	    if (!t())
+		return false;
+	return true;
+    }
+};
+
+template <class T> Repeat<T> repeat(size_t n, const T &t) { return Repeat<T>(n, t); }
+
+/* Class of callable that does something in n parallel threads. */
+template <class T>
+class Parallel {
+    size_t n;
+    const T &t;
+
+    struct pair { const Parallel *self; bool ok; };
+
+    static void threadMain(void *arg) {
+	pair *p = (pair *) arg;
+	if (!p->self->t())
+	    p->ok = false;
+    }
+
+  public:
+    Parallel(size_t n, const T &t) : n(n), t(t) {}
+
+    bool operator()() const {
+	pair p = {this, true};
+
+        PRThread **thread = new PRThread *[n];
+	if (!thread)
+	    return false;
+
+        size_t i;
+        for (i = 0; i < n; i++) {
+            thread[i] = PR_CreateThread(PR_USER_THREAD, threadMain, &p, PR_PRIORITY_NORMAL,
+                                        PR_LOCAL_THREAD, PR_JOINABLE_THREAD, NATIVE_STACK_SIZE);
+            if (thread[i] == NULL) {
+                p.ok = false;
+                break;
+            }
+        }
+        while (i--)
+            PR_JoinThread(thread[i]);
+
+	delete[] thread;
+        return p.ok;
+    }
+};
+
+template <class T> Parallel<T> parallel(size_t n, const T &t) { return Parallel<T>(n, t); }
+
+/* Class of callable that creates a compartment and runs some code in it. */
+class eval {
+    JSRuntime *rt;
+    const char *code;
+
+  public:
+    eval(JSRuntime *rt, const char *code) : rt(rt), code(code) {}
+
+    bool operator()() const {
+        JSContext *cx = JS_NewContext(rt, 8192);
+	if (!cx)
+	    return false;
+
+        JS_SetNativeStackQuota(cx, NATIVE_STACK_SIZE - NATIVE_STACK_HEADROOM);
+        bool ok = false;
+	{
+	    JSAutoRequest ar(cx);
+	    JSObject *global =
+		JS_NewCompartmentAndGlobalObject(cx, JSAPITest::basicGlobalClass(), NULL);
+	    if (global) {
+		JS_SetGlobalObject(cx, global);
+		jsval rval;
+		ok = JS_InitStandardClasses(cx, global) &&
+		    JS_EvaluateScript(cx, global, code, strlen(code), "", 0, &rval);
+	    }
+	}
+	JS_DestroyContextMaybeGC(cx);
+        return ok;
+    }
+};
+
+BEGIN_TEST(testThreads_bug604782)
+{
+    jsrefcount rc = JS_SuspendRequest(cx);
+    bool ok = repeat(20, parallel(3, eval(rt, "for(i=0;i<1000;i++);")))();
+    JS_ResumeRequest(cx, rc);
+    CHECK(ok);
+    return true;
+}
+END_TEST(testThreads_bug604782)
+
+BEGIN_TEST(testThreads_bug609103)
+{
+    const char *code = 
+        "var x = {};\n"
+        "for (var i = 0; i < 10000; i++)\n"
+        "    x = {next: x};\n";
+
+    jsrefcount rc = JS_SuspendRequest(cx);
+    bool ok = parallel(2, eval(rt, code))();
+    JS_ResumeRequest(cx, rc);
+    CHECK(ok);
+    return true;
+}
+END_TEST(testThreads_bug609103)
+
+#endif
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -591,33 +591,30 @@ JS_GetTypeName(JSContext *cx, JSType typ
     if ((uintN)type >= (uintN)JSTYPE_LIMIT)
         return NULL;
     return JS_TYPE_STR(type);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal)
 {
-    CHECK_REQUEST(cx);
     assertSameCompartment(cx, v1, v2);
     return StrictlyEqual(cx, Valueify(v1), Valueify(v2), equal);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal)
 {
-    CHECK_REQUEST(cx);
     assertSameCompartment(cx, v1, v2);
     return LooselyEqual(cx, Valueify(v1), Valueify(v2), equal);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same)
 {
-    CHECK_REQUEST(cx);
     assertSameCompartment(cx, v1, v2);
     return SameValue(cx, Valueify(v1), Valueify(v2), same);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_IsBuiltinEvalFunction(JSFunction *fun)
 {
     return IsAnyBuiltinEval(fun);
@@ -645,20 +642,16 @@ JSRuntime::JSRuntime()
     /* Initialize infallibly first, so we can goto bad and JS_DestroyRuntime. */
     JS_INIT_CLIST(&contextList);
     JS_INIT_CLIST(&debuggerList);
 }
 
 bool
 JSRuntime::init(uint32 maxbytes)
 {
-#ifdef JS_THREADSAFE
-    ownerThread_ = js_CurrentThreadId();
-#endif
-
 #ifdef JS_METHODJIT_SPEW
     JMCheckLogging();
 #endif
 
 #ifdef JS_TRACER
     InitJIT();
 #endif
 
@@ -738,38 +731,16 @@ JSRuntime::~JSRuntime()
         JS_DESTROY_CONDVAR(requestDone);
     if (rtLock)
         JS_DESTROY_LOCK(rtLock);
     if (stateChange)
         JS_DESTROY_CONDVAR(stateChange);
 #endif
 }
 
-#ifdef JS_THREADSAFE
-void
-JSRuntime::setOwnerThread()
-{
-    JS_ASSERT(ownerThread_ == (void *)-1);
-    ownerThread_ = js_CurrentThreadId();
-}
-
-void
-JSRuntime::clearOwnerThread()
-{
-    JS_ASSERT(onOwnerThread());
-    ownerThread_ = (void *)-1;
-}
-
-JS_FRIEND_API(bool)
-JSRuntime::onOwnerThread() const
-{
-    return ownerThread_ == js_CurrentThreadId();
-}
-#endif
-
 JS_PUBLIC_API(JSRuntime *)
 JS_NewRuntime(uint32 maxbytes)
 {
     if (!js_NewRuntimeWasCalled) {
 #ifdef DEBUG
         /*
          * This code asserts that the numbers associated with the error names
          * in jsmsg.def are monotonically increasing.  It uses values for the
@@ -2016,24 +1987,22 @@ JS_ComputeThis(JSContext *cx, jsval *vp)
     if (!BoxNonStrictThis(cx, call))
         return JSVAL_NULL;
     return Jsvalify(call.thisv());
 }
 
 JS_PUBLIC_API(void *)
 JS_malloc(JSContext *cx, size_t nbytes)
 {
-    CHECK_REQUEST(cx);
     return cx->malloc_(nbytes);
 }
 
 JS_PUBLIC_API(void *)
 JS_realloc(JSContext *cx, void *p, size_t nbytes)
 {
-    CHECK_REQUEST(cx);
     return cx->realloc_(p, nbytes);
 }
 
 JS_PUBLIC_API(void)
 JS_free(JSContext *cx, void *p)
 {
     return cx->free_(p);
 }
@@ -5362,26 +5331,22 @@ extern JS_PUBLIC_API(const jschar *)
 JS_GetFlatStringChars(JSFlatString *str)
 {
     return str->chars();
 }
 
 JS_PUBLIC_API(JSBool)
 JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32 *result)
 {
-    CHECK_REQUEST(cx);
-
     return CompareStrings(cx, str1, str2, result);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match)
 {
-    CHECK_REQUEST(cx);
-
     JSLinearString *linearStr = str->ensureLinear(cx);
     if (!linearStr)
         return false;
     *match = StringEqualsAscii(linearStr, asciiBytes);
     return true;
 }
 
 JS_PUBLIC_API(JSBool)
@@ -5557,36 +5522,32 @@ JS_ParseJSONWithReviver(JSContext *cx, c
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ReadStructuredClone(JSContext *cx, const uint64 *buf, size_t nbytes,
                        uint32 version, jsval *vp,
                        const JSStructuredCloneCallbacks *optionalCallbacks,
                        void *closure)
 {
-    CHECK_REQUEST(cx);
-
     if (version > JS_STRUCTURED_CLONE_VERSION) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_CLONE_VERSION);
         return false;
     }
     const JSStructuredCloneCallbacks *callbacks =
         optionalCallbacks ?
         optionalCallbacks :
         cx->runtime->structuredCloneCallbacks;
     return ReadStructuredClone(cx, buf, nbytes, Valueify(vp), callbacks, closure);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_WriteStructuredClone(JSContext *cx, jsval v, uint64 **bufp, size_t *nbytesp,
                         const JSStructuredCloneCallbacks *optionalCallbacks,
                         void *closure)
 {
-    CHECK_REQUEST(cx);
-
     const JSStructuredCloneCallbacks *callbacks =
         optionalCallbacks ?
         optionalCallbacks :
         cx->runtime->structuredCloneCallbacks;
     return WriteStructuredClone(cx, Valueify(v), (uint64_t **) bufp, nbytesp,
                                 callbacks, closure);
 }
 
@@ -6151,18 +6112,16 @@ JS_GetContextThread(JSContext *cx)
 
 /*
  * Set the current thread as the owning thread of a context. Returns the
  * old owning thread id, or -1 if the operation failed.
  */
 JS_PUBLIC_API(jsword)
 JS_SetContextThread(JSContext *cx)
 {
-    JS_AbortIfWrongThread(cx->runtime);
-
 #ifdef JS_THREADSAFE
     JS_ASSERT(!cx->outstandingRequests);
     if (cx->thread()) {
         JS_ASSERT(CURRENT_THREAD_IS_ME(cx->thread()));
         return reinterpret_cast<jsword>(cx->thread()->id);
     }
 
     if (!js_InitContextThreadAndLockGC(cx)) {
@@ -6170,46 +6129,19 @@ JS_SetContextThread(JSContext *cx)
         return -1;
     }
 
     JS_UNLOCK_GC(cx->runtime);
 #endif
     return 0;
 }
 
-extern JS_PUBLIC_API(void)
-JS_ClearRuntimeThread(JSRuntime *rt)
-{
-#ifdef JS_THREADSAFE
-    rt->clearOwnerThread();
-#endif
-}
-
-extern JS_PUBLIC_API(void)
-JS_SetRuntimeThread(JSRuntime *rt)
-{
-#ifdef JS_THREADSAFE
-    rt->setOwnerThread();
-#endif
-}
-
-extern JS_PUBLIC_API(void)
-JS_AbortIfWrongThread(JSRuntime *rt)
-{
-#ifdef JS_THREADSAFE
-    if (!rt->onOwnerThread())
-        JS_Assert("rt->onOwnerThread()", __FILE__, __LINE__);
-#endif
-}
-
 JS_PUBLIC_API(jsword)
 JS_ClearContextThread(JSContext *cx)
 {
-    JS_AbortIfWrongThread(cx->runtime);
-
 #ifdef JS_THREADSAFE
     /*
      * cx must have exited all requests it entered and, if cx is associated
      * with a thread, this must be called only from that thread.  If not, this
      * is a harmless no-op.
      */
     JS_ASSERT(cx->outstandingRequests == 0);
     JSThread *t = cx->thread();
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -3726,61 +3726,16 @@ extern JS_PUBLIC_API(jsword)
 JS_GetContextThread(JSContext *cx);
 
 extern JS_PUBLIC_API(jsword)
 JS_SetContextThread(JSContext *cx);
 
 extern JS_PUBLIC_API(jsword)
 JS_ClearContextThread(JSContext *cx);
 
-/*
- * A JS runtime always has an "owner thread". The owner thread is set when the
- * runtime is created (to the current thread) and practically all entry points
- * into the JS engine check that a runtime (or anything contained in the
- * runtime: context, compartment, object, etc) is only touched by its owner
- * thread. Embeddings may check this invariant outside the JS engine by calling
- * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for
- * non-debug builds).
- *
- * It is possible to "move" a runtime between threads. This is accomplished by
- * calling JS_ClearRuntimeThread on a runtime's owner thread and then calling
- * JS_SetRuntimeThread on the new owner thread. The runtime must not be
- * accessed between JS_ClearRuntimeThread and JS_SetRuntimeThread. Also, the
- * caller is responsible for synchronizing the calls to Set/Clear.
- */
-
-extern JS_PUBLIC_API(void)
-JS_AbortIfWrongThread(JSRuntime *rt);
-
-extern JS_PUBLIC_API(void)
-JS_ClearRuntimeThread(JSRuntime *rt);
-
-extern JS_PUBLIC_API(void)
-JS_SetRuntimeThread(JSRuntime *rt);
-
-#ifdef __cplusplus
-JS_END_EXTERN_C
-
-class JSAutoSetRuntimeThread
-{
-    JSRuntime *runtime;
-
-  public:
-    JSAutoSetRuntimeThread(JSRuntime *runtime) : runtime(runtime) {
-        JS_SetRuntimeThread(runtime);
-    }
-
-    ~JSAutoSetRuntimeThread() {
-        JS_ClearRuntimeThread(runtime);
-    }
-};
-
-JS_BEGIN_EXTERN_C
-#endif
-
 /************************************************************************/
 
 /*
  * JS_IsConstructing must be called from within a native given the
  * native's original cx and vp arguments. If JS_IsConstructing is true,
  * JS_THIS must not be used; the constructor should construct and return a
  * new object. Otherwise, the native is called as an ordinary function and
  * JS_THIS may be used.
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -311,18 +311,16 @@ js_PurgeThreads(JSContext *cx)
 }
 
 static const size_t ARENA_HEADER_SIZE_HACK = 40;
 static const size_t TEMP_POOL_CHUNK_SIZE = 4096 - ARENA_HEADER_SIZE_HACK;
 
 JSContext *
 js_NewContext(JSRuntime *rt, size_t stackChunkSize)
 {
-    JS_AbortIfWrongThread(rt);
-
     JSContext *cx;
     JSBool first;
     JSContextCallback cxCallback;
 
     /*
      * We need to initialize the new context fully before adding it to the
      * runtime list. After that it can be accessed from another thread via
      * js_ContextIterator.
@@ -424,24 +422,23 @@ js_NewContext(JSRuntime *rt, size_t stac
     }
 
     return cx;
 }
 
 void
 js_DestroyContext(JSContext *cx, JSDestroyContextMode mode)
 {
-    JSRuntime *rt = cx->runtime;
-    JS_AbortIfWrongThread(rt);
-
+    JSRuntime *rt;
     JSContextCallback cxCallback;
     JSBool last;
 
     JS_ASSERT(!cx->enumerators);
 
+    rt = cx->runtime;
 #ifdef JS_THREADSAFE
     /*
      * For API compatibility we allow to destroy contexts without a thread in
      * optimized builds. We assume that the embedding knows that an OOM error
      * cannot happen in JS_SetContextThread.
      */
     JS_ASSERT(cx->thread() && CURRENT_THREAD_IS_ME(cx->thread()));
     if (!cx->thread())
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -322,44 +322,29 @@ typedef void
 (* JSActivityCallback)(void *arg, JSBool active);
 
 namespace js {
 
 typedef js::Vector<JSCompartment *, 0, js::SystemAllocPolicy> CompartmentVector;
 
 }
 
-struct JSRuntime
-{
+struct JSRuntime {
     /* Default compartment. */
     JSCompartment       *atomsCompartment;
 #ifdef JS_THREADSAFE
     bool                atomsCompartmentIsLocked;
 #endif
 
     /* List of compartments (protected by the GC lock). */
     js::CompartmentVector compartments;
 
     /* Runtime state, synchronized by the stateChange/gcLock condvar/lock. */
     JSRuntimeState      state;
 
-    /* See comment for JS_AbortIfWrongThread in jsapi.h. */
-#ifdef JS_THREADSAFE
-  public:
-    void clearOwnerThread();
-    void setOwnerThread();
-    JS_FRIEND_API(bool) onOwnerThread() const;
-  private:
-    void                *ownerThread_;
-  public:
-#else
-  public:
-    bool onOwnerThread() const { return true; }
-#endif
-
     /* Context create/destroy callback. */
     JSContextCallback   cxCallback;
 
     /* Compartment create/destroy callback. */
     JSCompartmentCallback compartmentCallback;
 
     /*
      * Sets a callback that is run whenever the runtime goes idle - the
@@ -1367,21 +1352,21 @@ class AutoCheckRequestDepth {
         JS_ASSERT(cx->thread()->checkRequestDepth != 0);
         cx->thread()->checkRequestDepth--;
     }
 };
 
 # define CHECK_REQUEST(cx)                                                    \
     JS_ASSERT((cx)->thread());                                                \
     JS_ASSERT((cx)->thread()->data.requestDepth || (cx)->thread() == (cx)->runtime->gcThread); \
-    JS_ASSERT(cx->runtime->onOwnerThread());                                  \
     AutoCheckRequestDepth _autoCheckRequestDepth(cx);
 
 #else
 # define CHECK_REQUEST(cx)          ((void) 0)
+# define CHECK_REQUEST_THREAD(cx)   ((void) 0)
 #endif
 
 static inline JSAtom **
 FrameAtomBase(JSContext *cx, js::StackFrame *fp)
 {
     return fp->hasImacropc()
            ? cx->runtime->atomState.commonAtomsStart()
            : fp->script()->atomMap.vector;
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -59,16 +59,18 @@
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jsopcode.h"
 #include "jsscope.h"
 #include "jsscript.h"
 #include "jsstaticcheck.h"
 #include "jswrapper.h"
 
+#include "vm/GlobalObject.h"
+
 #include "jsobjinlines.h"
 
 #include "vm/Stack-inl.h"
 
 using namespace js;
 using namespace js::gc;
 
 /* Forward declarations for js_ErrorClass's initializer. */
@@ -1002,80 +1004,90 @@ JS_STATIC_ASSERT(JSProto_Error + JSEXN_S
 JS_STATIC_ASSERT(JSProto_Error + JSEXN_TYPEERR      == JSProto_TypeError);
 JS_STATIC_ASSERT(JSProto_Error + JSEXN_URIERR       == JSProto_URIError);
 
 static JS_INLINE JSProtoKey
 GetExceptionProtoKey(intN exn)
 {
     JS_ASSERT(JSEXN_ERR <= exn);
     JS_ASSERT(exn < JSEXN_LIMIT);
-    return (JSProtoKey) (JSProto_Error + exn);
+    return JSProtoKey(JSProto_Error + exn);
 }
 
-JSObject *
-js_InitExceptionClasses(JSContext *cx, JSObject *obj)
+static JSObject *
+InitErrorClass(JSContext *cx, GlobalObject *global, intN type, JSObject &proto)
 {
-    /*
-     * If lazy class initialization occurs for any Error subclass, then all
-     * classes are initialized, starting with Error.  To avoid reentry and
-     * redundant initialization, we must not pass a null proto parameter to
-     * NewNonFunction below, when called for the Error superclass.  We need to
-     * ensure that Object.prototype is the proto of Error.prototype.
-     *
-     * See the equivalent code to ensure that parent_proto is non-null when
-     * js_InitClass calls NewObject, in jsobj.cpp.
-     */
-    JSObject *obj_proto;
-    if (!js_GetClassPrototype(cx, obj, JSProto_Object, &obj_proto))
+    JSProtoKey key = GetExceptionProtoKey(type);
+    JSAtom *name = cx->runtime->atomState.classAtoms[key];
+    JSObject *errorProto = global->createBlankPrototypeInheriting(cx, &js_ErrorClass, proto);
+    if (!errorProto)
         return NULL;
 
-    /* Define all error constructors. */
     Value empty = StringValue(cx->runtime->emptyString);
     jsid nameId = ATOM_TO_JSID(cx->runtime->atomState.nameAtom);
     jsid messageId = ATOM_TO_JSID(cx->runtime->atomState.messageAtom);
     jsid fileNameId = ATOM_TO_JSID(cx->runtime->atomState.fileNameAtom);
     jsid lineNumberId = ATOM_TO_JSID(cx->runtime->atomState.lineNumberAtom);
-    JSObject *error_proto = NULL;
-    for (intN i = JSEXN_ERR; i != JSEXN_LIMIT; i++) {
-        JSProtoKey protoKey = GetExceptionProtoKey(i);
-        JSAtom *atom = cx->runtime->atomState.classAtoms[protoKey];
-        JSObject *ctor;
-        JSObject *proto =
-            DefineConstructorAndPrototype(cx, obj, protoKey, atom,
-                                          (i == JSEXN_ERR) ? obj_proto : error_proto,
-                                          &js_ErrorClass, Exception, 1,
-                                          NULL, (i == JSEXN_ERR) ? exception_methods : NULL,
-                                          NULL, NULL, &ctor);
-        if (!proto)
-            return NULL;
-        JS_ASSERT(proto->getPrivate() == NULL);
-
-        if (i == JSEXN_ERR)
-            error_proto = proto;
-
-        /* Save the exception type in a reserved slot. */
-        if (!ctor->ensureClassReservedSlots(cx))
-            return NULL;
-        ctor->setReservedSlot(JSSLOT_ERROR_EXNTYPE, Int32Value(int32(i)));
-
-        /* Add properties to the prototype. */
-        JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_DECLARING);
-        if (!DefineNativeProperty(cx, proto, nameId, StringValue(atom),
-                                  PropertyStub, StrictPropertyStub, 0, 0, 0) ||
-            !DefineNativeProperty(cx, proto, messageId, empty,
-                                  PropertyStub, StrictPropertyStub, 0, 0, 0) ||
-            !DefineNativeProperty(cx, proto, fileNameId, empty,
-                                  PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE, 0, 0) ||
-            !DefineNativeProperty(cx, proto, lineNumberId, Valueify(JSVAL_ZERO),
-                                  PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE, 0, 0)) {
-            return NULL;
-        }
+    if (!DefineNativeProperty(cx, errorProto, nameId, StringValue(name),
+                              PropertyStub, StrictPropertyStub, 0, 0, 0) ||
+        !DefineNativeProperty(cx, errorProto, messageId, empty,
+                              PropertyStub, StrictPropertyStub, 0, 0, 0) ||
+        !DefineNativeProperty(cx, errorProto, fileNameId, empty,
+                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE, 0, 0) ||
+        !DefineNativeProperty(cx, errorProto, lineNumberId, Int32Value(0),
+                              PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE, 0, 0))
+    {
+        return NULL;
     }
 
-    return error_proto;
+    /* Create the corresponding constructor. */
+    JSFunction *ctor = global->createConstructor(cx, Exception, &js_ErrorClass, name, 1);
+    if (!ctor)
+        return NULL;
+    ctor->setReservedSlot(JSSLOT_ERROR_EXNTYPE, Int32Value(int32(type)));
+
+    if (!LinkConstructorAndPrototype(cx, ctor, errorProto))
+        return NULL;
+
+    if (!DefineConstructorAndPrototype(cx, global, key, ctor, errorProto))
+        return NULL;
+
+    JS_ASSERT(!errorProto->getPrivate());
+
+    return errorProto;
+}
+
+JSObject *
+js_InitExceptionClasses