Merge inbound to central, a=merge
authorWes Kocher <wkocher@mozilla.com>
Wed, 13 Apr 2016 14:18:44 -0700
changeset 350546 bc2373295e31d99f9b870a1253b6e01650df8f31
parent 350416 196a0e282b3e33aa3d82ae6f3e7d21390d2a60fd (current diff)
parent 350545 0a1722feaf7ba7ceed6b35a00f24d04188e497b5 (diff)
child 350547 d9a0e1cafdeb950858d420d8d025a53e34a19cb9
child 350565 1eb889cd13c0139671453dd6b078883431009e1b
child 350577 fdec59273728a0c962f8d93d1b6e84d3aa2acc1e
child 350581 8630367f5e3f750e23cd04f309a1b279ff07e4a2
child 350599 35a8ccc134cbd33f772aad47fa3c4c3f121faf68
child 350713 441dbdcccdb0fb82b4b4d470236fe262c36e9db5
child 350715 1e607731a5f3d3f216ccd76f8f8dfd263f9fa15a
child 350717 795c6bf0edb1b6b1173a54bb5064c6b8d5490429
child 350787 a1302a3e865dfd515636e7c70f9dcb3e425caa8c
child 350872 52f53557b752eee773cf4069136f281b37564bc5
push id15366
push userb56girard@gmail.com
push dateWed, 13 Apr 2016 23:26:35 +0000
reviewersmerge
milestone48.0a1
Merge inbound to central, a=merge MozReview-Commit-ID: 4hSCKRdSJmM
browser/base/content/browser.js
dom/imptests/editing.txt
dom/imptests/editing/conformancetest/data.js
dom/imptests/editing/conformancetest/test_event.html
dom/imptests/editing/conformancetest/test_runtest.html
dom/imptests/editing/css/reset.css
dom/imptests/editing/implementation.js
dom/imptests/editing/selecttest/common.js
dom/imptests/editing/selecttest/test-iframe.html
dom/imptests/editing/selecttest/test_Document-open.html
dom/imptests/editing/selecttest/test_addRange.html
dom/imptests/editing/selecttest/test_collapse.html
dom/imptests/editing/selecttest/test_collapseToStartEnd.html
dom/imptests/editing/selecttest/test_deleteFromDocument.html
dom/imptests/editing/selecttest/test_extend.html
dom/imptests/editing/selecttest/test_getRangeAt.html
dom/imptests/editing/selecttest/test_getSelection.html
dom/imptests/editing/selecttest/test_interfaces.html
dom/imptests/editing/selecttest/test_isCollapsed.html
dom/imptests/editing/selecttest/test_removeAllRanges.html
dom/imptests/editing/selecttest/test_selectAllChildren.html
dom/imptests/editing/tests.js
dom/imptests/failures/editing/conformancetest/mochitest.ini
dom/imptests/failures/editing/conformancetest/test_event.html.json
dom/imptests/failures/editing/conformancetest/test_runtest.html.json
dom/imptests/failures/editing/selecttest/mochitest.ini
dom/imptests/failures/editing/selecttest/test_Document-open.html.json
dom/imptests/failures/editing/selecttest/test_addRange.html.json
dom/imptests/failures/editing/selecttest/test_collapse.html.json
dom/imptests/failures/editing/selecttest/test_collapseToStartEnd.html.json
dom/imptests/failures/editing/selecttest/test_extend.html.json
dom/imptests/failures/editing/selecttest/test_getSelection.html.json
dom/imptests/failures/editing/selecttest/test_removeAllRanges.html.json
dom/imptests/failures/editing/selecttest/test_selectAllChildren.html.json
dom/imptests/failures/html/dom/errors/mochitest.ini
dom/imptests/failures/html/dom/errors/test_exceptions.html.json
dom/imptests/failures/html/dom/lists/mochitest.ini
dom/imptests/failures/html/dom/lists/test_DOMTokenList-stringifier.html.json
dom/imptests/failures/html/dom/mochitest.ini
dom/imptests/failures/html/dom/nodes/test_Document-createElement-namespace.html.json
dom/imptests/failures/html/dom/nodes/test_Document-createElementNS.html.json
dom/imptests/failures/html/dom/nodes/test_Document-getElementsByTagName.html.json
dom/imptests/failures/html/dom/nodes/test_Node-properties.html.json
dom/imptests/failures/html/dom/nodes/test_attributes.html.json
dom/imptests/failures/html/dom/nodes/test_case.html.json
dom/imptests/failures/html/dom/nodes/test_getElementsByClassName-10.xml.json
dom/imptests/failures/html/dom/nodes/test_getElementsByClassName-11.xml.json
dom/imptests/failures/html/dom/test_interfaces.html.json
dom/imptests/failures/html/html/browsers/the-window-object/mochitest.ini
dom/imptests/failures/html/html/browsers/the-window-object/named-access-on-the-window-object/mochitest.ini
dom/imptests/failures/html/html/browsers/the-window-object/named-access-on-the-window-object/test_window-null-names.html.json
dom/imptests/failures/html/html/dom/documents/dta/doc.gEBN/mochitest.ini
dom/imptests/failures/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-newelements.html.json
dom/imptests/failures/html/html/dom/documents/dta/test_document.title-06.html.json
dom/imptests/failures/html/html/dom/documents/dta/test_nameditem-02.html.json
dom/imptests/failures/html/html/dom/documents/dta/test_nameditem-03.html.json
dom/imptests/failures/html/html/dom/documents/dta/test_nameditem-04.html.json
dom/imptests/failures/html/html/dom/documents/dta/test_nameditem-05.html.json
dom/imptests/failures/html/html/obsolete/implreq/oeaaa/mochitest.ini
dom/imptests/failures/html/html/obsolete/implreq/oeaaa/test_script-IDL-event-htmlfor.html.json
dom/imptests/failures/html/html/semantics/forms/the-select-element/mochitest.ini
dom/imptests/failures/html/html/semantics/forms/the-select-element/test_select-named-getter.html.json
dom/imptests/failures/html/html/semantics/forms/the-select-element/test_select-remove.html.json
dom/imptests/failures/html/html/semantics/scripting-1/the-script-element/mochitest.ini
dom/imptests/failures/html/html/semantics/scripting-1/the-script-element/test_script-for-event.html.json
dom/imptests/failures/html/html/semantics/scripting-1/the-script-element/test_script-language-type.html.json
dom/imptests/failures/html/html/semantics/scripting-1/the-script-element/test_script-languages-01.html.json
dom/imptests/failures/html/html/semantics/scripting-1/the-script-element/test_script-languages-02.html.json
dom/imptests/failures/html/html/semantics/tabular-data/the-table-element/mochitest.ini
dom/imptests/failures/html/html/semantics/tabular-data/the-table-element/test_table-insertRow.html.json
dom/imptests/failures/html/html/semantics/tabular-data/the-table-element/test_table-rows.html.json
dom/imptests/failures/html/html/webappapis/atob/mochitest.ini
dom/imptests/failures/html/html/webappapis/atob/test_base64.html.json
dom/imptests/failures/html/js/builtins/mochitest.ini
dom/imptests/failures/html/microdata/microdata-dom-api/mochitest.ini
dom/imptests/failures/html/microdata/microdata-dom-api/test_001.html.json
dom/imptests/html/dom/collections/test_HTMLCollection-empty-name.html
dom/imptests/html/dom/constants.js
dom/imptests/html/dom/errors/test_DOMException-constants.html
dom/imptests/html/dom/errors/test_exceptions.html
dom/imptests/html/dom/events/test_Event-constants.html
dom/imptests/html/dom/events/test_Event-constructors.html
dom/imptests/html/dom/events/test_Event-defaultPrevented.html
dom/imptests/html/dom/events/test_Event-initEvent.html
dom/imptests/html/dom/events/test_Event-propagation.html
dom/imptests/html/dom/events/test_Event-type.html
dom/imptests/html/dom/events/test_EventTarget-addEventListener.html
dom/imptests/html/dom/events/test_EventTarget-dispatchEvent.html
dom/imptests/html/dom/events/test_EventTarget-removeEventListener.html
dom/imptests/html/dom/events/test_ProgressEvent.html
dom/imptests/html/dom/lists/test_DOMTokenList-stringifier.html
dom/imptests/html/dom/nodes/ChildNode-remove.js
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_mathml.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_mathml.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_svg.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_svg.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_svg.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_svg.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/empty.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/empty.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/empty.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/empty.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/generate.py
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/mathml.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/mathml.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/mathml.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/mathml.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/minimal_html.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/minimal_html.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/minimal_html.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/minimal_html.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/svg.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/svg.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/svg.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/svg.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.html
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.svg
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xhtml
dom/imptests/html/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xml
dom/imptests/html/dom/nodes/Document-createProcessingInstruction.js
dom/imptests/html/dom/nodes/attributes.js
dom/imptests/html/dom/nodes/case.js
dom/imptests/html/dom/nodes/creators.js
dom/imptests/html/dom/nodes/encoding.php
dom/imptests/html/dom/nodes/productions.js
dom/imptests/html/dom/nodes/test_CharacterData-appendData.html
dom/imptests/html/dom/nodes/test_CharacterData-deleteData.html
dom/imptests/html/dom/nodes/test_CharacterData-insertData.html
dom/imptests/html/dom/nodes/test_CharacterData-remove.html
dom/imptests/html/dom/nodes/test_CharacterData-replaceData.html
dom/imptests/html/dom/nodes/test_Comment-constructor.html
dom/imptests/html/dom/nodes/test_DOMImplementation-createDocument.html
dom/imptests/html/dom/nodes/test_DOMImplementation-createDocumentType.html
dom/imptests/html/dom/nodes/test_DOMImplementation-createHTMLDocument.html
dom/imptests/html/dom/nodes/test_DOMImplementation-hasFeature.html
dom/imptests/html/dom/nodes/test_Document-adoptNode.html
dom/imptests/html/dom/nodes/test_Document-createComment.html
dom/imptests/html/dom/nodes/test_Document-createElement-namespace.html
dom/imptests/html/dom/nodes/test_Document-createElement.html
dom/imptests/html/dom/nodes/test_Document-createElementNS.html
dom/imptests/html/dom/nodes/test_Document-createEvent.html
dom/imptests/html/dom/nodes/test_Document-createProcessingInstruction-literal-1.xhtml
dom/imptests/html/dom/nodes/test_Document-createProcessingInstruction-literal-2.xhtml
dom/imptests/html/dom/nodes/test_Document-createProcessingInstruction.html
dom/imptests/html/dom/nodes/test_Document-createProcessingInstruction.xhtml
dom/imptests/html/dom/nodes/test_Document-createTreeWalker.html
dom/imptests/html/dom/nodes/test_Document-getElementById.html
dom/imptests/html/dom/nodes/test_Document-getElementsByTagName.html
dom/imptests/html/dom/nodes/test_Document-getElementsByTagNameNS.html
dom/imptests/html/dom/nodes/test_Document-importNode.html
dom/imptests/html/dom/nodes/test_DocumentType-remove.html
dom/imptests/html/dom/nodes/test_Element-children.html
dom/imptests/html/dom/nodes/test_Element-getElementsByClassName.html
dom/imptests/html/dom/nodes/test_Element-remove.html
dom/imptests/html/dom/nodes/test_Element-removeAttributeNS.html
dom/imptests/html/dom/nodes/test_Element-tagName.html
dom/imptests/html/dom/nodes/test_Node-appendChild.html
dom/imptests/html/dom/nodes/test_Node-cloneNode.html
dom/imptests/html/dom/nodes/test_Node-compareDocumentPosition.html
dom/imptests/html/dom/nodes/test_Node-constants.html
dom/imptests/html/dom/nodes/test_Node-contains.html
dom/imptests/html/dom/nodes/test_Node-contains.xml
dom/imptests/html/dom/nodes/test_Node-insertBefore.html
dom/imptests/html/dom/nodes/test_Node-isEqualNode.xhtml
dom/imptests/html/dom/nodes/test_Node-lookupPrefix.xhtml
dom/imptests/html/dom/nodes/test_Node-nodeName.html
dom/imptests/html/dom/nodes/test_Node-nodeName.xhtml
dom/imptests/html/dom/nodes/test_Node-normalize.html
dom/imptests/html/dom/nodes/test_Node-parentElement.html
dom/imptests/html/dom/nodes/test_Node-parentNode.html
dom/imptests/html/dom/nodes/test_Node-properties.html
dom/imptests/html/dom/nodes/test_Node-removeChild.html
dom/imptests/html/dom/nodes/test_Node-replaceChild.html
dom/imptests/html/dom/nodes/test_attributes.html
dom/imptests/html/dom/nodes/test_case.html
dom/imptests/html/dom/nodes/test_getElementsByClassName-01.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-02.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-03.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-04.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-05.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-06.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-07.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-08.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-09.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-10.xml
dom/imptests/html/dom/nodes/test_getElementsByClassName-11.xml
dom/imptests/html/dom/nodes/test_getElementsByClassName-12.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-13.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-14.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-15.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-16.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-17.htm
dom/imptests/html/dom/nodes/test_getElementsByClassName-18.htm
dom/imptests/html/dom/ranges/Range-test-iframe.html
dom/imptests/html/dom/ranges/test_Range-attributes.html
dom/imptests/html/dom/ranges/test_Range-cloneContents.html
dom/imptests/html/dom/ranges/test_Range-cloneRange.html
dom/imptests/html/dom/ranges/test_Range-collapse.html
dom/imptests/html/dom/ranges/test_Range-commonAncestorContainer-2.html
dom/imptests/html/dom/ranges/test_Range-commonAncestorContainer.html
dom/imptests/html/dom/ranges/test_Range-compareBoundaryPoints.html
dom/imptests/html/dom/ranges/test_Range-comparePoint-2.html
dom/imptests/html/dom/ranges/test_Range-comparePoint.html
dom/imptests/html/dom/ranges/test_Range-deleteContents.html
dom/imptests/html/dom/ranges/test_Range-detach.html
dom/imptests/html/dom/ranges/test_Range-extractContents.html
dom/imptests/html/dom/ranges/test_Range-insertNode.html
dom/imptests/html/dom/ranges/test_Range-intersectsNode-binding.html
dom/imptests/html/dom/ranges/test_Range-intersectsNode.html
dom/imptests/html/dom/ranges/test_Range-isPointInRange.html
dom/imptests/html/dom/ranges/test_Range-mutations.html
dom/imptests/html/dom/ranges/test_Range-selectNode.html
dom/imptests/html/dom/ranges/test_Range-set.html
dom/imptests/html/dom/ranges/test_Range-surroundContents.html
dom/imptests/html/dom/test_historical.html
dom/imptests/html/dom/traversal/test_NodeFilter-constants.html
dom/imptests/html/dom/traversal/unfinished/TODO
dom/imptests/html/domxpath/test_evaluator-constructor.html
dom/imptests/html/html/browsers/browsing-the-web/read-media/test_pageload-image.html
dom/imptests/html/html/browsers/browsing-the-web/read-media/test_pageload-video.html
dom/imptests/html/html/browsers/the-window-object/named-access-on-the-window-object/test_window-null-names.html
dom/imptests/html/html/browsers/the-window-object/test_window-indexed-properties-strict.html
dom/imptests/html/html/browsers/the-window-object/test_window-indexed-properties.html
dom/imptests/html/html/browsers/the-window-object/test_window-properties.html
dom/imptests/html/html/browsers/the-window-object/test_window-prototype-chain.html
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-case.html
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-case.xhtml
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-id.html
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-id.xhtml
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-namespace.html
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-namespace.xhtml
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-newelements.html
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-newelements.xhtml
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-null-undef.html
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-null-undef.xhtml
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-param.html
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-param.xhtml
dom/imptests/html/html/dom/documents/dta/doc.gEBN/test_document.getElementsByName-same.html
dom/imptests/html/html/dom/documents/dta/test_Document.getElementsByClassName-null-undef.html
dom/imptests/html/html/dom/documents/dta/test_Element.getElementsByClassName-null-undef.html
dom/imptests/html/html/dom/documents/dta/test_document.body-getter.html
dom/imptests/html/html/dom/documents/dta/test_document.body-setter-01.html
dom/imptests/html/html/dom/documents/dta/test_document.embeds-document.plugins-01.html
dom/imptests/html/html/dom/documents/dta/test_document.getElementsByClassName-same.html
dom/imptests/html/html/dom/documents/dta/test_document.head-01.html
dom/imptests/html/html/dom/documents/dta/test_document.head-02.html
dom/imptests/html/html/dom/documents/dta/test_document.images.html
dom/imptests/html/html/dom/documents/dta/test_document.title-01.html
dom/imptests/html/html/dom/documents/dta/test_document.title-02.xhtml
dom/imptests/html/html/dom/documents/dta/test_document.title-03.html
dom/imptests/html/html/dom/documents/dta/test_document.title-04.xhtml
dom/imptests/html/html/dom/documents/dta/test_document.title-05.html
dom/imptests/html/html/dom/documents/dta/test_document.title-06.html
dom/imptests/html/html/dom/documents/dta/test_document.title-07.html
dom/imptests/html/html/dom/documents/dta/test_nameditem-01.html
dom/imptests/html/html/dom/documents/dta/test_nameditem-02.html
dom/imptests/html/html/dom/documents/dta/test_nameditem-03.html
dom/imptests/html/html/dom/documents/dta/test_nameditem-04.html
dom/imptests/html/html/dom/documents/dta/test_nameditem-05.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-EN-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-EN-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-EN-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-EN-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-EN-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-EN-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-EN-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-EN-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-EN-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-EN.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-N-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-bdi-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-bdi-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-bdi-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-bdi-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-dir-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-dir-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-dir-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-dir-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-script-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-script-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-script-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-script-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-style-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-style-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-style-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-style-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-textarea-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-textarea-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-textarea-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-contained-textarea-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-EN-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-EN-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-EN-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-EN-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-EN-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-EN-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-EN-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-EN-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-EN-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-EN.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-N-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-EN-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-EN-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-EN-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-EN-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-EN.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-L-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-L.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-N-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-R-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-input-script-R.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-isolate-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-isolate.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-pre-N-EN-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-pre-N-EN.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-pre-N-between-Rs.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-pre-mixed-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-pre-mixed.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-N-EN-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-N-EN.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-N-between-Rs.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-mixed-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-mixed.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-script-N-EN.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-script-N-between-Rs.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed-ref.html
dom/imptests/html/html/dom/elements/global-attributes/dir_auto-textarea-script-mixed.html
dom/imptests/html/html/dom/elements/global-attributes/lang-xmllang-01-ref.html
dom/imptests/html/html/dom/elements/global-attributes/lang-xmllang-01.html
dom/imptests/html/html/dom/elements/global-attributes/lang-xyzzy-ref.html
dom/imptests/html/html/dom/elements/global-attributes/lang-xyzzy.html
dom/imptests/html/html/dom/elements/global-attributes/style-01-ref.html
dom/imptests/html/html/dom/elements/global-attributes/style-01.html
dom/imptests/html/html/dom/elements/global-attributes/test_classlist-nonstring.html
dom/imptests/html/html/dom/elements/global-attributes/test_dataset-delete.html
dom/imptests/html/html/dom/elements/global-attributes/test_dataset-enumeration.html
dom/imptests/html/html/dom/elements/global-attributes/test_dataset-get.html
dom/imptests/html/html/dom/elements/global-attributes/test_dataset-prototype.html
dom/imptests/html/html/dom/elements/global-attributes/test_dataset-set.html
dom/imptests/html/html/dom/elements/global-attributes/test_dataset.html
dom/imptests/html/html/dom/elements/global-attributes/test_document-dir.html
dom/imptests/html/html/dom/elements/global-attributes/test_id-attribute.html
dom/imptests/html/html/dom/elements/global-attributes/test_id-name.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-1-ref.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-1a.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-1b.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-1c.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-1d.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-1e.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-1f.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-1g.html
dom/imptests/html/html/editing/the-hidden-attribute/hidden-2-ref.svg
dom/imptests/html/html/editing/the-hidden-attribute/hidden-2.svg
dom/imptests/html/html/editing/the-hidden-attribute/reftest.list
dom/imptests/html/html/obsolete/implreq/oeaaa/test_document-color-01.html
dom/imptests/html/html/obsolete/implreq/oeaaa/test_document-color-02.html
dom/imptests/html/html/obsolete/implreq/oeaaa/test_document-color-03.html
dom/imptests/html/html/obsolete/implreq/oeaaa/test_document-color-04.html
dom/imptests/html/html/obsolete/implreq/oeaaa/test_heading-obsolete-attributes-01.html
dom/imptests/html/html/obsolete/implreq/oeaaa/test_script-IDL-event-htmlfor.html
dom/imptests/html/html/semantics/document-metadata/the-title-element/test_title.text-01.html
dom/imptests/html/html/semantics/document-metadata/the-title-element/test_title.text-02.xhtml
dom/imptests/html/html/semantics/document-metadata/the-title-element/test_title.text-03.html
dom/imptests/html/html/semantics/document-metadata/the-title-element/test_title.text-04.xhtml
dom/imptests/html/html/semantics/forms/the-form-element/test_form-elements-interfaces-01.html
dom/imptests/html/html/semantics/forms/the-form-element/test_form-elements-matches.html
dom/imptests/html/html/semantics/forms/the-form-element/test_form-elements-nameditem-01.html
dom/imptests/html/html/semantics/forms/the-form-element/test_form-elements-nameditem-02.html
dom/imptests/html/html/semantics/forms/the-form-element/test_form-nameditem.html
dom/imptests/html/html/semantics/forms/the-option-element/test_option-text-backslash.html
dom/imptests/html/html/semantics/forms/the-option-element/test_option-text-recurse.html
dom/imptests/html/html/semantics/forms/the-option-element/test_option-text-spaces.html
dom/imptests/html/html/semantics/forms/the-select-element/test_select-named-getter.html
dom/imptests/html/html/semantics/forms/the-select-element/test_select-remove.html
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-for-event.html
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-for-event.xhtml
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-for-onload.html
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-language-type.html
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-languages-01.html
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-languages-02.html
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-noembed-noframes-iframe.xhtml
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-onload-string.html
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-text.html
dom/imptests/html/html/semantics/scripting-1/the-script-element/test_script-text.xhtml
dom/imptests/html/html/semantics/tabular-data/the-table-element/test_createTBody.html
dom/imptests/html/html/semantics/tabular-data/the-table-element/test_insertRow-method-01.html
dom/imptests/html/html/semantics/tabular-data/the-table-element/test_insertRow-method-02.html
dom/imptests/html/html/semantics/tabular-data/the-table-element/test_tBodies.html
dom/imptests/html/html/semantics/tabular-data/the-table-element/test_table-insertRow.html
dom/imptests/html/html/semantics/tabular-data/the-table-element/test_table-rows.html
dom/imptests/html/html/semantics/text-level-semantics/the-time-element/test_001.html
dom/imptests/html/html/webappapis/atob/test_base64.html
dom/imptests/html/html/webappapis/scripting/events/test_body-onload.html
dom/imptests/html/html/webappapis/scripting/events/test_event-handler-javascript.html
dom/imptests/html/html/webappapis/scripting/events/test_event-handler-spec-example.html
dom/imptests/html/html/webappapis/scripting/processing-model-2/test_window-onerror-parse-error.html
dom/imptests/html/html/webappapis/scripting/processing-model-2/test_window-onerror-runtime-error-throw.html
dom/imptests/html/html/webappapis/scripting/processing-model-2/test_window-onerror-runtime-error.html
dom/imptests/html/html/webappapis/timers/test_evil-spec-example.html
dom/imptests/html/js/builtins/Math.maxmin.js
dom/imptests/html/js/builtins/test_Array.DefineOwnProperty.html
dom/imptests/html/js/builtins/test_Array.prototype.join-order.html
dom/imptests/html/js/builtins/test_Math.max.html
dom/imptests/html/js/builtins/test_Math.min.html
dom/imptests/html/js/builtins/test_Object.prototype.hasOwnProperty-order.html
dom/imptests/html/microdata/microdata-dom-api/test_001.html
dom/imptests/reftest.list
dom/tests/mochitest/dom-level2-core/test_localName03.html
dom/tests/mochitest/dom-level2-core/test_prefix02.html
layout/generic/SummaryFrame.cpp
layout/generic/SummaryFrame.h
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -788,34 +788,23 @@ GetLocaleCB(AtkObject* aAtkObj)
 }
 
 AtkObject *
 getParentCB(AtkObject *aAtkObj)
 {
   if (aAtkObj->accessible_parent)
     return aAtkObj->accessible_parent;
 
-  AtkObject* atkParent = nullptr;
-  if (AccessibleWrap* wrapper = GetAccessibleWrap(aAtkObj)) {
-    Accessible* parent = wrapper->Parent();
-    atkParent = parent ? AccessibleWrap::GetAtkObject(parent) : nullptr;
-  } else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
-    ProxyAccessible* parent = proxy->Parent();
-    if (parent) {
-      atkParent = GetWrapperFor(parent);
-    } else {
-      // Otherwise this should be the proxy for the tab's top level document.
-      Accessible* outerDocParent = proxy->OuterDocOfRemoteBrowser();
-      NS_ASSERTION(outerDocParent, "this document should have an outerDoc as a parent");
-      if (outerDocParent) {
-        atkParent = AccessibleWrap::GetAtkObject(outerDocParent);
-      }
-    }
+  AccessibleOrProxy acc = GetInternalObj(aAtkObj);
+  if (acc.IsNull()) {
+    return nullptr;
   }
 
+  AccessibleOrProxy parent = acc.Parent();
+  AtkObject* atkParent = !parent.IsNull() ? GetWrapperFor(parent) : nullptr;
   if (atkParent)
     atk_object_set_parent(aAtkObj, atkParent);
 
   return aAtkObj->accessible_parent;
 }
 
 gint
 getChildCountCB(AtkObject *aAtkObj)
@@ -1096,16 +1085,26 @@ GetInternalObj(AtkObject* aObj)
 }
 
 AtkObject*
 GetWrapperFor(ProxyAccessible* aProxy)
 {
   return reinterpret_cast<AtkObject*>(aProxy->GetWrapper() & ~IS_PROXY);
 }
 
+AtkObject*
+GetWrapperFor(AccessibleOrProxy aObj)
+{
+  if (aObj.IsProxy()) {
+    return GetWrapperFor(aObj.AsProxy());
+  }
+
+  return AccessibleWrap::GetAtkObject(aObj.AsAccessible());
+}
+
 static uint16_t
 GetInterfacesForProxy(ProxyAccessible* aProxy, uint32_t aInterfaces)
 {
   uint16_t interfaces = 1 << MAI_INTERFACE_COMPONENT;
   if (aInterfaces & Interfaces::HYPERTEXT)
     interfaces |= (1 << MAI_INTERFACE_HYPERTEXT) | (1 << MAI_INTERFACE_TEXT)
         | (1 << MAI_INTERFACE_EDITABLE_TEXT);
 
--- a/accessible/atk/nsMai.h
+++ b/accessible/atk/nsMai.h
@@ -64,16 +64,17 @@ typedef struct _MaiAtkSocketClass
 {
   AtkSocketClass parent_class;
 } MaiAtkSocketClass;
 
 mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
 mozilla::a11y::ProxyAccessible* GetProxy(AtkObject* aAtkObj);
 mozilla::a11y::AccessibleOrProxy GetInternalObj(AtkObject* aObj);
 AtkObject* GetWrapperFor(mozilla::a11y::ProxyAccessible* aProxy);
+AtkObject* GetWrapperFor(mozilla::a11y::AccessibleOrProxy aObj);
 
 extern int atkMajorVersion, atkMinorVersion;
 
 /**
  * Return true if the loaded version of libatk-1.0.so is at least
  * aMajor.aMinor.0.
  */
 static inline bool
new file mode 100644
--- /dev/null
+++ b/accessible/base/AccessibleOrProxy.cpp
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "AccessibleOrProxy.h"
+
+AccessibleOrProxy
+AccessibleOrProxy::Parent() const
+{
+  if (IsAccessible()) {
+    return AsAccessible()->Parent();
+  }
+
+  ProxyAccessible* proxy = AsProxy();
+  if (!proxy) {
+    return nullptr;
+  }
+
+  if (ProxyAccessible* parent = proxy->Parent()) {
+    return parent;
+  }
+
+  // Otherwise this should be the proxy for the tab's top level document.
+  return proxy->OuterDocOfRemoteBrowser();
+}
--- a/accessible/base/AccessibleOrProxy.h
+++ b/accessible/base/AccessibleOrProxy.h
@@ -101,16 +101,18 @@ public:
   {
     if (IsProxy()) {
       return AsProxy()->Role();
     }
 
     return AsAccessible()->Role();
   }
 
+  AccessibleOrProxy Parent() const;
+
   // XXX these are implementation details that ideally would not be exposed.
   uintptr_t Bits() const { return mBits; }
   void SetBits(uintptr_t aBits) { mBits = aBits; }
 
 private:
   uintptr_t mBits;
   static const uintptr_t IS_PROXY = 0x1;
 };
--- a/accessible/base/EventTree.cpp
+++ b/accessible/base/EventTree.cpp
@@ -232,121 +232,66 @@ EventTree::Process()
     mDependentEvents.Clear();
   }
 }
 
 EventTree*
 EventTree::FindOrInsert(Accessible* aContainer)
 {
   if (!mFirst) {
-    return mFirst = new EventTree(aContainer);
+    return mFirst = new EventTree(aContainer, true);
   }
 
   EventTree* prevNode = nullptr;
   EventTree* node = mFirst;
   do {
     MOZ_ASSERT(!node->mContainer->IsApplication(),
                "No event for application accessible is expected here");
     MOZ_ASSERT(!node->mContainer->IsDefunct(), "An event target has to be alive");
 
     // Case of same target.
     if (node->mContainer == aContainer) {
       return node;
     }
 
     // Check if the given container is contained by a current node
-    Accessible* tailRoot = aContainer->Document();
-    Accessible* tailParent = aContainer;
-
-    EventTree* matchNode = nullptr;
-    Accessible* matchParent = nullptr;
-    while (true) {
+    Accessible* top = mContainer ? mContainer : aContainer->Document();
+    Accessible* parent = aContainer;
+    while (parent) {
       // Reached a top, no match for a current event.
-      if (tailParent == tailRoot) {
-        // If we have a match in parents then continue to look in siblings.
-        if (matchNode && node->mNext) {
-          node = node->mNext;
-          if (node->mContainer == aContainer) {
-            return node; // case of same target
-          }
-          tailParent = aContainer;
-          continue;
-        }
+      if (parent == top) {
         break;
       }
 
       // We got a match.
-      if (tailParent->Parent() == node->mContainer) {
-        matchNode = node;
-        matchParent = tailParent;
-
-        // Search the subtree for a better match.
-        if (node->mFirst) {
-          tailRoot = node->mContainer;
-          node = node->mFirst;
-          if (node->mContainer == aContainer) {
-            return node; // case of same target
-          }
-          tailParent = aContainer;
-          continue;
-        }
-        break;
+      if (parent->Parent() == node->mContainer) {
+        return node->FindOrInsert(aContainer);
       }
 
-      tailParent = tailParent->Parent();
-      MOZ_ASSERT(tailParent, "Wrong tree");
-      if (!tailParent) {
-        break;
-      }
+      parent = parent->Parent();
+      MOZ_ASSERT(parent, "Wrong tree");
     }
 
-    // The given node is contained by a current node
-    //   if hide of a current node contains the given node
-    //   then assert
-    //   if show of a current node contains the given node
-    //   then ignore the given node
-    //   otherwise ignore the given node, but not its show and hide events
-    if (matchNode) {
-      uint32_t eventType = 0;
-      uint32_t count = matchNode->mDependentEvents.Length();
-      for (uint32_t idx = count - 1; idx < count; idx--) {
-        if (matchNode->mDependentEvents[idx]->mAccessible == matchParent) {
-          eventType = matchNode->mDependentEvents[idx]->mEventType;
-        }
-      }
-      MOZ_ASSERT(eventType != nsIAccessibleEvent::EVENT_HIDE,
-                 "Accessible tree was modified after it was removed");
-
-      // If contained by show event target then no events are required.
-      if (eventType == nsIAccessibleEvent::EVENT_SHOW) {
-        return nullptr;
-      }
-
-      node->mFirst = new EventTree(aContainer);
-      node->mFirst->mFireReorder = false;
-      return node->mFirst;
-    }
-
-    // If the given node contains a current node
+    // If the given container contains a current node
     // then
     //   if show or hide of the given node contains a grand parent of the current node
     //   then ignore the current node and its show and hide events
     //   otherwise ignore the current node, but not its show and hide events
     Accessible* curParent = node->mContainer;
     while (curParent && !curParent->IsDoc()) {
       if (curParent->Parent() != aContainer) {
         curParent = curParent->Parent();
         continue;
       }
 
       // Insert the tail node into the hierarchy between the current node and
       // its parent.
       node->mFireReorder = false;
       nsAutoPtr<EventTree>& nodeOwnerRef = prevNode ? prevNode->mNext : mFirst;
-      nsAutoPtr<EventTree> newNode(new EventTree(aContainer));
+      nsAutoPtr<EventTree> newNode(new EventTree(aContainer, mDependentEvents.IsEmpty()));
       newNode->mFirst = Move(nodeOwnerRef);
       nodeOwnerRef = Move(newNode);
       nodeOwnerRef->mNext = Move(node->mNext);
 
       // Check if a next node is contained by the given node too, and move them
       // under the given node if so.
       prevNode = nodeOwnerRef;
       node = nodeOwnerRef->mNext;
@@ -378,17 +323,24 @@ EventTree::FindOrInsert(Accessible* aCon
 
       return nodeOwnerRef;
     }
 
     prevNode = node;
   } while ((node = node->mNext));
 
   MOZ_ASSERT(prevNode, "Nowhere to insert");
-  return prevNode->mNext = new EventTree(aContainer);
+  MOZ_ASSERT(!prevNode->mNext, "Taken by another node");
+
+  // If 'this' node contains the given container accessible, then
+  //   do not emit a reorder event for the container
+  //   if a dependent show event target contains the given container then do not
+  //      emit show / hide events (to be done)
+
+  return prevNode->mNext = new EventTree(aContainer, mDependentEvents.IsEmpty());
 }
 
 void
 EventTree::Clear()
 {
   mFirst = nullptr;
   mNext = nullptr;
   mContainer = nullptr;
--- a/accessible/base/EventTree.h
+++ b/accessible/base/EventTree.h
@@ -52,18 +52,19 @@ private:
 
 /**
  * A mutation events coalescence structure.
  */
 class EventTree final {
 public:
   EventTree() :
     mFirst(nullptr), mNext(nullptr), mContainer(nullptr), mFireReorder(false) { }
-  explicit EventTree(Accessible* aContainer) :
-    mFirst(nullptr), mNext(nullptr), mContainer(aContainer), mFireReorder(true) { }
+  explicit EventTree(Accessible* aContainer, bool aFireReorder) :
+    mFirst(nullptr), mNext(nullptr), mContainer(aContainer),
+    mFireReorder(aFireReorder) { }
   ~EventTree() { Clear(); }
 
   void Shown(Accessible* aChild)
   {
     RefPtr<AccShowEvent> ev = new AccShowEvent(aChild);
     Mutated(ev);
   }
 
--- a/accessible/base/moz.build
+++ b/accessible/base/moz.build
@@ -21,16 +21,17 @@ EXPORTS.mozilla.a11y += [
 ]
 
 if CONFIG['MOZ_DEBUG']:
     EXPORTS.mozilla.a11y += [
         'Logging.h',
     ]
 
 UNIFIED_SOURCES += [
+    'AccessibleOrProxy.cpp',
     'AccEvent.cpp',
     'AccGroupInfo.cpp',
     'AccIterator.cpp',
     'ARIAMap.cpp',
     'ARIAStateMap.cpp',
     'Asserts.cpp',
     'DocManager.cpp',
     'EmbeddedObjCollector.cpp',
--- a/accessible/tests/mochitest/events/test_coalescence.html
+++ b/accessible/tests/mochitest/events/test_coalescence.html
@@ -416,16 +416,54 @@
         testIsDefunct(this.o2fc);
       }
 
       this.getID = function test4_getID() {
         return "remove children, and then a parent of 2nd child";
       }
     }
 
+    /**
+     * Remove a child, remove a parent sibling, remove the parent
+     */
+    function test5()
+    {
+      this.o = getAccessible("t5_o");
+      this.ofc = this.o.firstChild;
+      this.b = getAccessible("t5_b");
+      this.lb = getAccessible("t5_lb");
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_HIDE, this.o),
+        new invokerChecker(EVENT_HIDE, this.b),
+        new invokerChecker(EVENT_REORDER, "t5"),
+        new unexpectedInvokerChecker(EVENT_HIDE, this.ofc),
+        new unexpectedInvokerChecker(EVENT_REORDER, this.o),
+        new unexpectedInvokerChecker(EVENT_REORDER, this.lb)
+      ];
+
+      this.invoke = function test5_invoke()
+      {
+        getNode("t5_o").textContent = "";
+        getNode("t5").removeChild(getNode("t5_b"));
+        getNode("t5_lb").removeChild(getNode("t5_o"));
+      }
+
+      this.finalCheck = function test5_finalCheck()
+      {
+        testIsDefunct(this.ofc);
+        testIsDefunct(this.o);
+        testIsDefunct(this.b);
+      }
+
+      this.getID = function test5_getID() {
+        return "remove a child, remove a parent sibling, remove the parent";
+      }
+    }
+
     ////////////////////////////////////////////////////////////////////////////
     // Do tests.
 
     //gA11yEventDumpToConsole = true; // debug stuff
     //enableLogging("tree,eventTree,verbose");
 
     var gQueue = null;
     function doTests()
@@ -446,16 +484,17 @@
       gQueue.push(new showParentNChild("select9", "option9", false));
       gQueue.push(new showParentNChild("select10", "option10", true));
       gQueue.push(new showParentNAddChild("select11", false));
       gQueue.push(new showParentNAddChild("select12", true));
 
       gQueue.push(new removeGrandChildrenNHideParent("t1_child1", "t1_child2", "t1_parent"));
       gQueue.push(new test3());
       gQueue.push(new test4());
+      gQueue.push(new test5());
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
   </script>
 </head>
@@ -529,10 +568,17 @@
   </div>
 
   <div id="t4">
     <div role="listbox" id="t4_lb">
       <div role="option" id="t4_o1">opt1</div>
       <div role="option" id="t4_o2">opt2</div>
     </div>
   </div>
+
+  <div id="t5">
+    <div role="button" id="t5_b">btn</div>
+    <div role="listbox" id="t5_lb">
+      <div role="option" id="t5_o">opt</div>
+    </div>
+  </div>
 </body>
 </html>
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -20,53 +20,64 @@
 
 using namespace mozilla::a11y;
 
 NS_IMETHODIMP
 xpcAccessible::GetParent(nsIAccessible** aParent)
 {
   NS_ENSURE_ARG_POINTER(aParent);
   *aParent = nullptr;
-  if (!Intl())
+  if (IntlGeneric().IsNull())
     return NS_ERROR_FAILURE;
 
-  NS_IF_ADDREF(*aParent = ToXPC(Intl()->Parent()));
+  AccessibleOrProxy parent = IntlGeneric().Parent();
+  NS_IF_ADDREF(*aParent = ToXPC(parent));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetNextSibling(nsIAccessible** aNextSibling)
 {
   NS_ENSURE_ARG_POINTER(aNextSibling);
   *aNextSibling = nullptr;
   if (IntlGeneric().IsNull())
     return NS_ERROR_FAILURE;
 
-  if (!Intl())
-    return NS_ERROR_FAILURE;
+  if (IntlGeneric().IsAccessible()) {
+    nsresult rv = NS_OK;
+    NS_IF_ADDREF(*aNextSibling = ToXPC(Intl()->GetSiblingAtOffset(1, &rv)));
+    return rv;
+  }
 
-  nsresult rv = NS_OK;
-  NS_IF_ADDREF(*aNextSibling = ToXPC(Intl()->GetSiblingAtOffset(1, &rv)));
-  return rv;
+  ProxyAccessible* proxy = IntlGeneric().AsProxy();
+  NS_ENSURE_STATE(proxy);
+
+  NS_IF_ADDREF(*aNextSibling = ToXPC(proxy->NextSibling()));
+  return *aNextSibling ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetPreviousSibling(nsIAccessible** aPreviousSibling)
 {
   NS_ENSURE_ARG_POINTER(aPreviousSibling);
   *aPreviousSibling = nullptr;
   if (IntlGeneric().IsNull())
     return NS_ERROR_FAILURE;
 
-  if (!Intl())
-    return NS_ERROR_FAILURE;
+  if (IntlGeneric().IsAccessible()) {
+    nsresult rv = NS_OK;
+    NS_IF_ADDREF(*aPreviousSibling = ToXPC(Intl()->GetSiblingAtOffset(-1, &rv)));
+    return rv;
+  }
 
-  nsresult rv = NS_OK;
-  NS_IF_ADDREF(*aPreviousSibling = ToXPC(Intl()->GetSiblingAtOffset(-1, &rv)));
-  return rv;
+  ProxyAccessible* proxy = IntlGeneric().AsProxy();
+  NS_ENSURE_STATE(proxy);
+
+  NS_IF_ADDREF(*aPreviousSibling = ToXPC(proxy->PrevSibling()));
+  return *aPreviousSibling ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetFirstChild(nsIAccessible** aFirstChild)
 {
   NS_ENSURE_ARG_POINTER(aFirstChild);
   *aFirstChild = nullptr;
 
@@ -151,20 +162,22 @@ xpcAccessible::GetChildren(nsIArray** aC
 NS_IMETHODIMP
 xpcAccessible::GetIndexInParent(int32_t* aIndexInParent)
 {
   NS_ENSURE_ARG_POINTER(aIndexInParent);
   *aIndexInParent = -1;
   if (IntlGeneric().IsNull())
     return NS_ERROR_FAILURE;
 
-  if (!Intl())
-    return NS_ERROR_FAILURE;
+  if (IntlGeneric().IsAccessible()) {
+    *aIndexInParent = Intl()->IndexInParent();
+  } else if (IntlGeneric().IsProxy()) {
+    *aIndexInParent = IntlGeneric().AsProxy()->IndexInParent();
+  }
 
-  *aIndexInParent = Intl()->IndexInParent();
   return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetDOMNode(nsIDOMNode** aDOMNode)
 {
   NS_ENSURE_ARG_POINTER(aDOMNode);
   *aDOMNode = nullptr;
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -1054,19 +1054,16 @@ pref("layout.accessiblecaret.enabled", t
 // by the spec in bug 921965.
 pref("layout.accessiblecaret.bar.enabled", true);
 
 // APZ on real devices supports long tap events.
 #ifdef MOZ_WIDGET_GONK
 pref("layout.accessiblecaret.use_long_tap_injector", false);
 #endif
 
-// The active caret is disallow to be dragged across the other (inactive) caret.
-pref("layout.accessiblecaret.allow_dragging_across_other_caret", false);
-
 // Enable sync and mozId with Firefox Accounts.
 pref("services.sync.fxaccounts.enabled", true);
 pref("identity.fxaccounts.enabled", true);
 
 // Mobile Identity API.
 pref("services.mobileid.server.uri", "https://msisdn.services.mozilla.com");
 
 pref("identity.fxaccounts.remote.oauth.uri", "https://oauth.accounts.firefox.com/v1");
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3715,19 +3715,22 @@ function FillHistoryMenu(aParent) {
   {
     let count = sessionHistory.entries.length;
 
     if (!initial) {
       if (count <= 1) {
         // if there is only one entry now, close the popup.
         aParent.hidePopup();
         return;
-      } else if (!aParent.parentNode.open) {
+      } else if (aParent.id != "backForwardMenu" && !aParent.parentNode.open) {
         // if the popup wasn't open before, but now needs to be, reopen the menu.
-        // It should trigger FillHistoryMenu again.
+        // It should trigger FillHistoryMenu again. This might happen with the
+        // delay from click-and-hold menus but skip this for the context menu
+        // (backForwardMenu) rather than figuring out how the menu should be
+        // positioned and opened as it is an extreme edgecase.
         aParent.parentNode.open = true;
         return;
       }
     }
 
     let index = sessionHistory.index;
     let half_length = Math.floor(MAX_HISTORY_MENU_ITEMS / 2);
     let start = Math.max(index - half_length, 0);
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -843,16 +843,38 @@ var RefreshBlocker = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener2,
                                          Ci.nsIWebProgressListener,
                                          Ci.nsISupportsWeakReference,
                                          Ci.nsISupports]),
 };
 
 RefreshBlocker.init();
 
+var UserContextIdNotifier = {
+  init() {
+    addEventListener("DOMContentLoaded", this);
+  },
+
+  uninit() {
+    removeEventListener("DOMContentLoaded", this);
+  },
+
+  handleEvent(aEvent) {
+    // When the first content is loaded, we want to inform the tabbrowser about
+    // the userContextId in use in order to update the UI correctly.
+    // Just because we cannot change the userContextId from an active docShell,
+    // we don't need to check DOMContentLoaded again.
+    this.uninit();
+    let userContextId = content.document.nodePrincipal.originAttributes.userContextId;
+    sendAsyncMessage("Browser:FirstContentLoaded", { userContextId });
+  }
+};
+
+UserContextIdNotifier.init();
+
 ExtensionContent.init(this);
 addEventListener("unload", () => {
   ExtensionContent.uninit(this);
   RefreshBlocker.uninit();
 });
 
 addEventListener("MozAfterPaint", function onFirstPaint() {
   removeEventListener("MozAfterPaint", onFirstPaint);
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4280,16 +4280,24 @@
               let tab = this.getTabForBrowser(browser);
               if (!tab)
                 return undefined;
 
               this._outerWindowIDBrowserMap.set(browser.outerWindowID, browser);
               browser.messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: tab.pinned })
               break;
             }
+            case "Browser:FirstContentLoaded": {
+              let tab = this.getTabForBrowser(browser);
+              if (tab && data.userContextId) {
+                tab.setUserContextId(data.userContextId);
+              }
+
+              break;
+            }
             case "Findbar:Keypress": {
               let tab = this.getTabForBrowser(browser);
               // If the find bar for this tab is not yet alive, only initialize
               // it if there's a possibility FindAsYouType will be used.
               // There's no point in doing it for most random keypresses.
               if (!this.isFindBarInitialized(tab) &&
                 data.shouldFastFind) {
                 let shouldFastFind = this._findAsYouType;
@@ -4426,16 +4434,17 @@
             this.mPanelContainer.classList.add("tabbrowser-tabpanels");
           } else {
             this._outerWindowIDBrowserMap.set(this.mCurrentBrowser.outerWindowID,
                                               this.mCurrentBrowser);
           }
           messageManager.addMessageListener("DOMWebNotificationClicked", this);
           messageManager.addMessageListener("DOMServiceWorkerFocusClient", this);
           messageManager.addMessageListener("RefreshBlocker:Blocked", this);
+          messageManager.addMessageListener("Browser:FirstContentLoaded", this);
 
           // To correctly handle keypresses for potential FindAsYouType, while
           // the tab's find bar is not yet initialized.
           this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind");
           Services.prefs.addObserver("accessibility.typeaheadfind", this, false);
           messageManager.addMessageListener("Findbar:Keypress", this);
         ]]>
       </constructor>
--- a/browser/base/content/test/general/browser_selectpopup.js
+++ b/browser/base/content/test/general/browser_selectpopup.js
@@ -21,57 +21,67 @@ const PAGECONTENT =
   "  </optgroup>" +
   "  <option value='Six' disabled='true'>Six</option>" +
   "  <optgroup label='Third Group'>" +
   "    <option value='Seven'>   Seven  </option>" +
   "    <option value='Eight'>&nbsp;&nbsp;Eight&nbsp;&nbsp;</option>" +
   "  </optgroup></select><input />Text" +
   "</body></html>";
 
-function openSelectPopup(selectPopup, withMouse)
+const PAGECONTENT_SMALL =
+  "<html>" +
+  "<body><select id='one'>" +
+  "  <option value='One'>One</option>" +
+  "  <option value='Two'>Two</option>" +
+  "</select><select id='two'>" +
+  "  <option value='Three'>Three</option>" +
+  "  <option value='Four'>Four</option>" +
+  "</select><select id='three'>" +
+  "  <option value='Five'>Five</option>" +
+  "  <option value='Six'>Six</option>" +
+  "</select></body></html>";
+
+function openSelectPopup(selectPopup, withMouse, selector = "select")
 {
   let popupShownPromise = BrowserTestUtils.waitForEvent(selectPopup, "popupshown");
 
   if (withMouse) {
     return Promise.all([popupShownPromise,
-                        BrowserTestUtils.synthesizeMouseAtCenter("select", { }, gBrowser.selectedBrowser)]);
+                        BrowserTestUtils.synthesizeMouseAtCenter(selector, { }, gBrowser.selectedBrowser)]);
   }
 
   setTimeout(() => EventUtils.synthesizeKey("KEY_ArrowDown", { altKey: true, code: "ArrowDown" }), 1500);
   return popupShownPromise;
 }
 
 function hideSelectPopup(selectPopup, withEscape)
 {
-  let popupShownPromise = BrowserTestUtils.waitForEvent(selectPopup, "popuphidden");
+  let popupHiddenPromise = BrowserTestUtils.waitForEvent(selectPopup, "popuphidden");
 
   if (withEscape) {
     EventUtils.synthesizeKey("KEY_Escape", { code: "Escape" });
   }
   else {
     EventUtils.synthesizeKey("KEY_Enter", { code: "Enter" });
   }
 
-  return popupShownPromise;
+  return popupHiddenPromise;
 }
 
 function getChangeEvents()
 {
   return ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
     return content.wrappedJSObject.gChangeEvents;
   });
 }
 
 function doSelectTests(contentType, dtd)
 {
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
-  let browser = gBrowser.getBrowserForTab(tab);
-  yield promiseTabLoadEvent(tab, "data:" + contentType + "," + escape(dtd + "\n" + PAGECONTENT));
-
-  yield SimpleTest.promiseFocus(browser.contentWindow);
+  const pageUrl = "data:" + contentType + "," + escape(dtd + "\n" + PAGECONTENT);
+  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
 
   let menulist = document.getElementById("ContentSelectDropdown");
   let selectPopup = menulist.menupopup;
 
   yield openSelectPopup(selectPopup);
 
   let isWindows = navigator.platform.indexOf("Win") >= 0;
 
@@ -133,19 +143,62 @@ function doSelectTests(contentType, dtd)
   is((yield getChangeEvents()), isWindows ? 2 : 1, "Open and close with change - number of change events");
   EventUtils.synthesizeKey("VK_TAB", { });
   EventUtils.synthesizeKey("VK_TAB", { shiftKey: true });
   is((yield getChangeEvents()), isWindows ? 2 : 1, "Tab away from select with change - number of change events");
 
   is(selectPopup.lastChild.previousSibling.label, "Seven", "Spaces collapsed");
   is(selectPopup.lastChild.label, "\xA0\xA0Eight\xA0\xA0", "Non-breaking spaces not collapsed");
 
-  gBrowser.removeCurrentTab();
+  yield BrowserTestUtils.removeTab(tab);
 }
 
 add_task(function*() {
   yield doSelectTests("text/html", "");
 });
 
 add_task(function*() {
   yield doSelectTests("application/xhtml+xml", XHTML_DTD);
 });
 
+// This test opens a select popup and removes the content node of a popup while
+// The popup should close if its node is removed.
+add_task(function*() {
+  const pageUrl = "data:text/html," + escape(PAGECONTENT_SMALL);
+  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
+
+  let menulist = document.getElementById("ContentSelectDropdown");
+  let selectPopup = menulist.menupopup;
+
+  // First, try it when a different <select> element than the one that is open is removed
+  yield openSelectPopup(selectPopup, true, "#one");
+
+  yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
+    content.document.body.removeChild(content.document.getElementById("two"));
+  });
+
+  // Wait a bit just to make sure the popup won't close.
+  yield new Promise(resolve => setTimeout(resolve, 1000));
+  
+  is(selectPopup.state, "open", "Different popup did not affect open popup");
+
+  yield hideSelectPopup(selectPopup);
+
+  // Next, try it when the same <select> element than the one that is open is removed
+  yield openSelectPopup(selectPopup, true, "#three");
+
+  let popupHiddenPromise = BrowserTestUtils.waitForEvent(selectPopup, "popuphidden");
+  yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
+    content.document.body.removeChild(content.document.getElementById("three"));
+  });
+  yield popupHiddenPromise;
+
+  ok(true, "Popup hidden when select is removed");
+
+  // Finally, try it when the tab is closed while the select popup is open.
+  yield openSelectPopup(selectPopup, true, "#one");
+
+  popupHiddenPromise = BrowserTestUtils.waitForEvent(selectPopup, "popuphidden");
+  yield BrowserTestUtils.removeTab(tab);
+  yield popupHiddenPromise;
+
+  ok(true, "Popup hidden when tab is closed");
+});
--- a/browser/components/contextualidentity/test/browser/browser.ini
+++ b/browser/components/contextualidentity/test/browser/browser.ini
@@ -1,8 +1,9 @@
 [DEFAULT]
 skip-if = buildapp == "mulet"
 support-files =
   empty_file.html
   file_reflect_cookie_into_title.html
 
 [browser_usercontext.js]
 [browser_windowName.js]
+[browser_windowOpen.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/contextualidentity/test/browser/browser_windowOpen.js
@@ -0,0 +1,41 @@
+"use strict";
+
+// Here we want to test that a new opened window shows the same UI of the
+// parent one if this has been loaded from a particular container.
+
+const BASE_URI = "http://mochi.test:8888/browser/browser/components/"
+  + "contextualidentity/test/browser/empty_file.html";
+
+add_task(function* setup() {
+  yield new Promise((resolve) => {
+    SpecialPowers.pushPrefEnv({"set": [
+      ["privacy.userContext.enabled", true],
+      ["browser.link.open_newwindow", 2],
+    ]}, resolve);
+  });
+});
+
+
+add_task(function* test() {
+  info("Creating a tab with UCI = 1...");
+  let tab = gBrowser.addTab(BASE_URI, {userContextId: 1});
+  is(tab.getAttribute('usercontextid'), 1, "New tab has UCI equal 1");
+
+  let browser = gBrowser.getBrowserForTab(tab);
+  yield BrowserTestUtils.browserLoaded(browser);
+
+  info("Opening a new window from this tab...");
+  ContentTask.spawn(browser, BASE_URI, function(url) {
+    content.window.newWindow = content.window.open(url, "_blank");
+  });
+
+  let newWin = yield BrowserTestUtils.waitForNewWindow();
+  let newTab = newWin.gBrowser.selectedTab;
+
+  yield BrowserTestUtils.browserLoaded(newTab.linkedBrowser);
+  is(newTab.getAttribute('usercontextid'), 1, "New tab has UCI equal 1");
+
+  info("Closing the new window and tab...");
+  yield BrowserTestUtils.closeWindow(newWin);
+  yield BrowserTestUtils.removeTab(tab);
+});
--- a/build/autoconf/toolchain.m4
+++ b/build/autoconf/toolchain.m4
@@ -16,18 +16,16 @@ cat <<EOF > conftest.c
 COMPILER clang-cl _MSC_VER
 #else
 COMPILER msvc _MSC_FULL_VER
 #endif
 #elif defined(__clang__)
 COMPILER clang __clang_major__.__clang_minor__.__clang_patchlevel__
 #elif defined(__GNUC__)
 COMPILER gcc __GNUC__.__GNUC_MINOR__.__GNUC_PATCHLEVEL__
-#elif defined(__INTEL_COMPILER)
-COMPILER icc __INTEL_COMPILER
 #endif
 EOF
 read dummy compiler CC_VERSION <<EOF
 $($CC -E $CPPFLAGS $CFLAGS conftest.c 2>/dev/null | grep COMPILER)
 EOF
 read dummy cxxcompiler CXX_VERSION <<EOF
 $($CXX -E $CPPFLAGS $CXXFLAGS conftest.c 2>/dev/null | grep COMPILER)
 EOF
@@ -63,23 +61,16 @@ if test "`echo | $LD -v 2>&1 | grep -c G
 fi
 
 if test "$compiler" = "msvc"; then
      MSVC_VERSION_FULL="$CXX_VERSION"
      CC_VERSION=`echo ${CC_VERSION} | cut -c 1-4`
      CXX_VERSION=`echo ${CXX_VERSION} | cut -c 1-4`
 fi
 
-INTEL_CC=
-INTEL_CXX=
-if test "$compiler" = "icc"; then
-   INTEL_CC=1
-   INTEL_CXX=1
-fi
-
 CLANG_CC=
 CLANG_CXX=
 CLANG_CL=
 if test "$compiler" = "clang"; then
     GNU_CC=1
     GNU_CXX=1
     CLANG_CC=1
     CLANG_CXX=1
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -124,31 +124,34 @@ def old_configure_assignments(help):
     return []
 
 @depends('--help')
 def extra_old_configure_args(help):
     return []
 
 @template
 @imports(_from='mozbuild.configure', _import='DependsFunction')
-def add_old_configure_assignment(var, value_func):
-    assert isinstance(value_func, DependsFunction)
+def add_old_configure_assignment(var, value):
+    if not isinstance(var, DependsFunction):
+        var = depends('--help')(lambda x: var)
+    if not isinstance(value, DependsFunction):
+        value = depends('--help')(lambda x: value)
 
-    @depends(old_configure_assignments, value_func)
+    @depends(old_configure_assignments, var, value)
     @imports(_from='mozbuild.shellutil', _import='quote')
-    def add_assignment(assignments, value):
-        if value is None:
+    def add_assignment(assignments, var, value):
+        if var is None or value is None:
             return
         if value is True:
             assignments.append('%s=1' % var)
         elif value is False:
             assignments.append('%s=' % var)
         else:
             if isinstance(value, (list, tuple)):
-                value = ' '.join(quote(v) for v in value)
+                value = quote(*value)
             assignments.append('%s=%s' % (var, quote(value)))
 
 @template
 def add_old_configure_arg(arg):
     @depends(extra_old_configure_args, arg)
     def add_arg(args, arg):
         if arg:
             args.append(arg)
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -391,17 +391,17 @@ def old_configure(prepare_configure, ext
     # We also pass it the options from js/moz.configure so that it can pass
     # them down to js/src/configure. Note this list is empty when running
     # js/src/configure, in which case we don't need to pass those options
     # to old-configure since old-configure doesn't handle them anyways.
     if extra_old_configure_args:
         cmd += extra_old_configure_args
 
     # For debugging purpose, in case it's not what we'd expect.
-    log.debug('Running %s', ' '.join(quote(a) for a in cmd))
+    log.debug('Running %s', quote(*cmd))
 
     # Our logging goes to config.log, the same file old.configure uses.
     # We can't share the handle on the file, so close it. We assume nothing
     # beyond this point is going to be interesting to log to config.log from
     # our end, so we don't make the effort to recreate a logging.FileHandler.
     logger = logging.getLogger('moz.configure')
     for handler in logger.handlers:
         if isinstance(handler, logging.FileHandler):
--- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-02.js
@@ -515,25 +515,25 @@ function testGetterSetterObject() {
     is(propEnums.length, 0,
       "The propEnums should contain all the created enumerable elements.");
     is(propNonEnums.length, 2,
       "The propEnums should contain all the created non-enumerable elements.");
 
     is(propNonEnums[0].querySelector(".name").getAttribute("value"), "get",
       "Should have the right property name for 'get'.");
     is(propNonEnums[0].querySelector(".value").getAttribute("value"),
-      "test/myVar.prop()",
+      "get prop()",
       "Should have the right property value for 'get'.");
     ok(propNonEnums[0].querySelector(".value").className.includes("token-other"),
       "Should have the right token class for 'get'.");
 
     is(propNonEnums[1].querySelector(".name").getAttribute("value"), "set",
       "Should have the right property name for 'set'.");
     is(propNonEnums[1].querySelector(".value").getAttribute("value"),
-      "test/myVar.prop(val)",
+      "set prop(val)",
       "Should have the right property value for 'set'.");
     ok(propNonEnums[1].querySelector(".value").className.includes("token-other"),
       "Should have the right token class for 'set'.");
 
     deferred.resolve();
   });
 
   myVar.expand();
--- a/devtools/client/framework/test/browser.ini
+++ b/devtools/client/framework/test/browser.ini
@@ -36,16 +36,18 @@ support-files =
 [browser_target_remote.js]
 [browser_target_support.js]
 [browser_toolbox_custom_host.js]
 [browser_toolbox_dynamic_registration.js]
 [browser_toolbox_getpanelwhenready.js]
 [browser_toolbox_highlight.js]
 [browser_toolbox_hosts.js]
 [browser_toolbox_hosts_size.js]
+[browser_toolbox_keyboard_navigation.js]
+skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keyboard Access setting is set to All Control in System Keyboard Preferences
 [browser_toolbox_minimize.js]
 skip-if = true # Bug 1177463 - Temporarily hide the minimize button
 [browser_toolbox_options.js]
 [browser_toolbox_options_disable_buttons.js]
 [browser_toolbox_options_disable_cache-01.js]
 [browser_toolbox_options_disable_cache-02.js]
 [browser_toolbox_options_disable_js.js]
 [browser_toolbox_options_enable_serviceworkers_testing.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/framework/test/browser_toolbox_keyboard_navigation.js
@@ -0,0 +1,88 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Tests keyboard navigation of devtools tabbar.
+
+const TEST_URL =
+  "data:text/html;charset=utf8,test page for toolbar keyboard navigation";
+
+function containsFocus(aDoc, aElm) {
+  let elm = aDoc.activeElement;
+  while (elm) {
+    if (elm === aElm) { return true; }
+    elm = elm.parentNode;
+  }
+  return false;
+}
+
+function testFocus(aDoc, aToolbar, aElm) {
+  let id = aElm.id;
+  is(aToolbar.getAttribute("aria-activedescendant"), id,
+    `Active descendant is set to a new control: ${id}`);
+  is(aDoc.activeElement.id, id, "New control is focused");
+}
+
+add_task(function*() {
+  info("Create a test tab and open the toolbox");
+  let toolbox = yield openNewTabAndToolbox(TEST_URL, "webconsole");
+  let doc = toolbox.doc;
+
+  let toolbar = doc.querySelector(".devtools-tabbar");
+  let toolbarControls = [...toolbar.querySelectorAll(
+    ".devtools-tab, toolbarbutton")].filter(elm =>
+      !elm.hidden && doc.defaultView.getComputedStyle(elm).getPropertyValue(
+        "display") !== "none");
+
+  // Put the keyboard focus onto the first toolbar control.
+  toolbarControls[0].focus();
+  ok(containsFocus(doc, toolbar), "Focus is within the toolbar");
+
+  // Move the focus away from toolbar to a next focusable element.
+  EventUtils.synthesizeKey("VK_TAB", {});
+  ok(!containsFocus(doc, toolbar), "Focus is outside of the toolbar");
+
+  // Move the focus back to the toolbar.
+  EventUtils.synthesizeKey("VK_TAB", { shiftKey: true });
+  ok(containsFocus(doc, toolbar), "Focus is within the toolbar again");
+
+  // Move through the toolbar forward using the right arrow key.
+  for (let i = 0; i < toolbarControls.length; ++i) {
+    testFocus(doc, toolbar, toolbarControls[i]);
+    if (i < toolbarControls.length - 1) {
+      EventUtils.synthesizeKey("VK_RIGHT", {});
+    }
+  }
+
+  // Move the focus away from toolbar to a next focusable element.
+  EventUtils.synthesizeKey("VK_TAB", {});
+  ok(!containsFocus(doc, toolbar), "Focus is outside of the toolbar");
+
+  // Move the focus back to the toolbar.
+  EventUtils.synthesizeKey("VK_TAB", { shiftKey: true });
+  ok(containsFocus(doc, toolbar), "Focus is within the toolbar again");
+
+  // Move through the toolbar backward using the left arrow key.
+  for (let i = toolbarControls.length - 1; i >= 0; --i) {
+    testFocus(doc, toolbar, toolbarControls[i]);
+    if (i > 0) { EventUtils.synthesizeKey("VK_LEFT", {}); }
+  }
+
+  // Move focus to the 3rd (non-first) toolbar control.
+  let expectedFocusedControl = toolbarControls[2];
+  EventUtils.synthesizeKey("VK_RIGHT", {});
+  EventUtils.synthesizeKey("VK_RIGHT", {});
+  testFocus(doc, toolbar, expectedFocusedControl);
+
+  // Move the focus away from toolbar to a next focusable element.
+  EventUtils.synthesizeKey("VK_TAB", {});
+  ok(!containsFocus(doc, toolbar), "Focus is outside of the toolbar");
+
+  // Move the focus back to the toolbar, ensure we land on the last active
+  // descendant control.
+  EventUtils.synthesizeKey("VK_TAB", { shiftKey: true });
+  testFocus(doc, toolbar, expectedFocusedControl);
+});
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -408,16 +408,17 @@ Toolbox.prototype = {
       this._addHostListeners();
       this._registerOverlays();
       if (this._hostOptions && this._hostOptions.zoom === false) {
         this._disableZoomKeys();
       } else {
         this._addZoomKeys();
         this._loadInitialZoom();
       }
+      this._setToolbarKeyboardNavigation();
 
       this.webconsolePanel = this.doc.querySelector("#toolbox-panel-webconsole");
       this.webconsolePanel.height = Services.prefs.getIntPref(SPLITCONSOLE_HEIGHT_PREF);
       this.webconsolePanel.addEventListener("resize", this._saveSplitConsoleHeight);
 
       let buttonsPromise = this._buildButtons();
 
       this._pingTelemetry();
@@ -902,16 +903,82 @@ Toolbox.prototype = {
    */
   _buildTabs: function() {
     for (let definition of gDevTools.getToolDefinitionArray()) {
       this._buildTabForTool(definition);
     }
   },
 
   /**
+   * Sets up keyboard navigation with and within the dev tools toolbar.
+   */
+  _setToolbarKeyboardNavigation() {
+    let toolbar = this.doc.querySelector(".devtools-tabbar");
+    // Set and track aria-activedescendant to indicate which control is
+    // currently focused within the toolbar (for accessibility purposes).
+    toolbar.addEventListener("focus", event => {
+      let { target, rangeParent } = event;
+      let control, controlID = toolbar.getAttribute("aria-activedescendant");
+
+      if (controlID) {
+        control = this.doc.getElementById(controlID);
+      }
+      if (rangeParent || !control) {
+        // If range parent is present, the focused is moved within the toolbar,
+        // simply updating aria-activedescendant. Or if aria-activedescendant is
+        // not available, set it to target.
+        toolbar.setAttribute("aria-activedescendant", target.id);
+      } else {
+        // When range parent is not present, we focused into the toolbar, move
+        // focus to current aria-activedescendant.
+        event.preventDefault();
+        control.focus();
+      }
+    }, true)
+
+    toolbar.addEventListener("keypress", event => {
+      let { key, target } = event;
+      let win = this.doc.defaultView;
+      let elm, type;
+      if (key === "Tab") {
+        // Tabbing when toolbar or its contents are focused should move focus to
+        // next/previous focusable element relative to toolbar itself.
+        if (event.shiftKey) {
+          elm = toolbar;
+          type = Services.focus.MOVEFOCUS_BACKWARD;
+        } else {
+          // To move focus to next element following the toolbar, relative
+          // element needs to be the last element in its subtree.
+          let last = toolbar.lastChild;
+          while (last && last.lastChild) {
+            last = last.lastChild;
+          }
+          elm = last;
+          type = Services.focus.MOVEFOCUS_FORWARD;
+        }
+      } else if (key === "ArrowLeft") {
+        // Using left arrow key inside toolbar should move focus to previous
+        // toolbar control.
+        elm = target;
+        type = Services.focus.MOVEFOCUS_BACKWARD;
+      } else if (key === "ArrowRight") {
+        // Using right arrow key inside toolbar should move focus to next
+        // toolbar control.
+        elm = target;
+        type = Services.focus.MOVEFOCUS_FORWARD;
+      } else {
+        // Ignore all other keys.
+        return;
+      }
+      event.preventDefault();
+      Services.focus.moveFocus(win, elm, type, 0);
+    });
+  },
+
+  /**
    * Add buttons to the UI as specified in the devtools.toolbox.toolbarSpec pref
    */
   _buildButtons: function() {
     if (!this.target.isAddon) {
       this._buildPickerButton();
     }
 
     this.setToolboxButtonsVisibility();
--- a/devtools/client/inspector/breadcrumbs.js
+++ b/devtools/client/inspector/breadcrumbs.js
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cu, Ci} = require("chrome");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 const Services = require("Services");
 const promise = require("promise");
+const FocusManager = Services.focus;
 
 const ENSURE_SELECTION_VISIBLE_DELAY = 50; // ms
 const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
 const MAX_LABEL_LENGTH = 40;
 const LOW_PRIORITY_ELEMENTS = {
   "HEAD": true,
   "BASE": true,
   "BASEFONT": true,
@@ -67,16 +68,17 @@ HTMLBreadcrumbs.prototype = {
                       "<box id='breadcrumb-separator-after'></box>" +
                       "<box id='breadcrumb-separator-normal'></box>";
     this.container.parentNode.appendChild(this.separators);
 
     this.container.addEventListener("mousedown", this, true);
     this.container.addEventListener("keypress", this, true);
     this.container.addEventListener("mouseover", this, true);
     this.container.addEventListener("mouseleave", this, true);
+    this.container.addEventListener("focus", this, true);
 
     // We will save a list of already displayed nodes in this array.
     this.nodeHierarchy = [];
 
     // Last selected node in nodeHierarchy.
     this.currentIndex = -1;
 
     // By default, hide the arrows. We let the <scrollbox> show them
@@ -285,16 +287,34 @@ HTMLBreadcrumbs.prototype = {
     if (event.type == "mousedown" && event.button == 0) {
       this.handleMouseDown(event);
     } else if (event.type == "keypress" && this.selection.isElementNode()) {
       this.handleKeyPress(event);
     } else if (event.type == "mouseover") {
       this.handleMouseOver(event);
     } else if (event.type == "mouseleave") {
       this.handleMouseLeave(event);
+    } else if (event.type == "focus") {
+      this.handleFocus(event);
+    }
+  },
+
+  /**
+   * Focus event handler. When breadcrumbs container gets focus, if there is an
+   * already selected breadcrumb, move focus to it.
+   * @param {DOMEvent} event.
+   */
+  handleFocus: function(event) {
+    let control = this.container.querySelector(
+      ".breadcrumbs-widget-item[checked]");
+    if (control && control !== event.target) {
+      // If we already have a selected breadcrumb and focus target is not it,
+      // move focus to selected breadcrumb.
+      event.preventDefault();
+      control.focus();
     }
   },
 
   /**
    * On click and hold, open the siblings menu.
    * @param {DOMEvent} event.
    */
   handleMouseDown: function(event) {
@@ -374,16 +394,36 @@ HTMLBreadcrumbs.prototype = {
             whatToShow: Ci.nsIDOMNodeFilter.SHOW_ELEMENT
           });
           break;
         case this.chromeWin.KeyEvent.DOM_VK_DOWN:
           navigate = this.walker.nextSibling(this.selection.nodeFront, {
             whatToShow: Ci.nsIDOMNodeFilter.SHOW_ELEMENT
           });
           break;
+        case this.chromeWin.KeyEvent.DOM_VK_TAB:
+          // Tabbing when breadcrumbs or its contents are focused should move
+          // focus to next/previous focusable element relative to breadcrumbs
+          // themselves.
+          let elm, type;
+          if (event.shiftKey) {
+            elm = this.container;
+            type = FocusManager.MOVEFOCUS_BACKWARD;
+          } else {
+            // To move focus to next element following the breadcrumbs, relative
+            // element needs to be the last element in breadcrumbs' subtree.
+            let last = this.container.lastChild;
+            while (last && last.lastChild) {
+              last = last.lastChild;
+            }
+            elm = last;
+            type = FocusManager.MOVEFOCUS_FORWARD;
+          }
+          FocusManager.moveFocus(this.chromeWin, elm, type, 0);
+          break;
       }
 
       return navigate.then(node => this.navigateTo(node));
     });
 
     event.preventDefault();
     event.stopPropagation();
   },
@@ -398,16 +438,17 @@ HTMLBreadcrumbs.prototype = {
     this.inspector.off("markupmutation", this.update);
 
     this.container.removeEventListener("underflow", this.onscrollboxreflow, false);
     this.container.removeEventListener("overflow", this.onscrollboxreflow, false);
     this.container.removeEventListener("mousedown", this, true);
     this.container.removeEventListener("keypress", this, true);
     this.container.removeEventListener("mouseover", this, true);
     this.container.removeEventListener("mouseleave", this, true);
+    this.container.removeEventListener("focus", this, true);
 
     this.empty();
     this.separators.remove();
 
     this.onscrollboxreflow = null;
     this.container = null;
     this.separators = null;
     this.nodeHierarchy = null;
--- a/devtools/client/inspector/inspector-search.js
+++ b/devtools/client/inspector/inspector-search.js
@@ -283,16 +283,22 @@ SelectorAutocompleter.prototype = {
       case event.DOM_VK_RETURN:
       case event.DOM_VK_TAB:
         if (this.searchPopup.isOpen &&
             this.searchPopup.getItemAtIndex(this.searchPopup.itemCount - 1)
                 .preLabel == query) {
           this.searchPopup.selectedIndex = this.searchPopup.itemCount - 1;
           this.searchBox.value = this.searchPopup.selectedItem.label;
           this.hidePopup();
+        } else if (!this.searchPopup.isOpen && event.keyCode === event.DOM_VK_TAB) {
+          // When tab is pressed with focus on searchbox and closed popup,
+          // do not prevent the default to avoid a keyboard trap and move focus
+          // to next/previous element.
+          this.emit("processing-done");
+          return;
         }
         break;
 
       case event.DOM_VK_UP:
         if (this.searchPopup.isOpen && this.searchPopup.itemCount > 0) {
           this.searchPopup.focus();
           if (this.searchPopup.selectedIndex == this.searchPopup.itemCount - 1) {
             this.searchPopup.selectedIndex =
--- a/devtools/client/inspector/test/browser.ini
+++ b/devtools/client/inspector/test/browser.ini
@@ -38,16 +38,18 @@ support-files =
   !/devtools/client/shared/test/test-actor-registry.js
 
 [browser_inspector_addNode_01.js]
 [browser_inspector_addNode_02.js]
 [browser_inspector_addNode_03.js]
 [browser_inspector_breadcrumbs.js]
 [browser_inspector_breadcrumbs_highlight_hover.js]
 [browser_inspector_breadcrumbs_keybinding.js]
+[browser_inspector_breadcrumbs_keyboard_trap.js]
+skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keyboard Access setting is set to All Control in System Keyboard Preferences
 [browser_inspector_breadcrumbs_menu.js]
 [browser_inspector_breadcrumbs_mutations.js]
 [browser_inspector_delete-selected-node-01.js]
 [browser_inspector_delete-selected-node-02.js]
 [browser_inspector_delete-selected-node-03.js]
 [browser_inspector_destroy-after-navigation.js]
 [browser_inspector_destroy-before-ready.js]
 [browser_inspector_expand-collapse.js]
@@ -116,15 +118,16 @@ skip-if = (e10s && debug) # Bug 1250058 
 [browser_inspector_remove-iframe-during-load.js]
 [browser_inspector_search-01.js]
 [browser_inspector_search-02.js]
 [browser_inspector_search-03.js]
 [browser_inspector_search-04.js]
 [browser_inspector_search-05.js]
 [browser_inspector_search-06.js]
 [browser_inspector_search-07.js]
+[browser_inspector_search_keyboard_trap.js]
 [browser_inspector_search-reserved.js]
 [browser_inspector_search-selection.js]
 [browser_inspector_select-docshell.js]
 [browser_inspector_select-last-selected.js]
 [browser_inspector_search-navigation.js]
 [browser_inspector_sidebarstate.js]
 [browser_inspector_switch-to-inspector-on-pick.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/inspector/test/browser_inspector_breadcrumbs_keyboard_trap.js
@@ -0,0 +1,79 @@
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test ability to tab to and away from breadcrumbs using keyboard.
+
+const TEST_URL = URL_ROOT + "doc_inspector_breadcrumbs.html";
+
+/**
+ * Test data has the format of:
+ * {
+ *   desc     {String}   description for better logging
+ *   focused  {Boolean}  flag, indicating if breadcrumbs contain focus
+ *   key      {String}   key event's key
+ *   options  {?Object}  optional event data such as shiftKey, etc
+ * }
+ */
+const TEST_DATA = [
+  {
+    desc: "Move the focus away from breadcrumbs to a next focusable element",
+    focused: false,
+    key: "VK_TAB",
+    options: { }
+  },
+  {
+    desc: "Move the focus back to the breadcrumbs",
+    focused: true,
+    key: "VK_TAB",
+    options: { shiftKey: true }
+  },
+  {
+    desc: "Move the focus back away from breadcrumbs to a previous focusable element",
+    focused: false,
+    key: "VK_TAB",
+    options: { shiftKey: true }
+  },
+  {
+    desc: "Move the focus back to the breadcrumbs",
+    focused: true,
+    key: "VK_TAB",
+    options: { }
+  }
+];
+
+add_task(function*() {
+  let { toolbox, inspector } = yield openInspectorForURL(TEST_URL);
+  let doc = inspector.panelDoc;
+
+  yield selectNode("#i2", inspector);
+
+  info("Clicking on the corresponding breadcrumbs node to focus it");
+  let container = doc.getElementById("inspector-breadcrumbs");
+
+  let button = container.querySelector("button[checked]");
+  let onHighlight = toolbox.once("node-highlight");
+  button.click();
+  yield onHighlight;
+
+  // Ensure a breadcrumb is focused.
+  is(doc.activeElement, button, "Focus is on selected breadcrumb");
+
+  for (let { desc, focused, key, options } of TEST_DATA) {
+    info(desc);
+
+    let onUpdated;
+    if (!focused) {
+      onUpdated = inspector.once("breadcrumbs-navigation-cancelled");
+    }
+    EventUtils.synthesizeKey(key, options);
+    if (focused) {
+      is(doc.activeElement, button, "Focus is on selected breadcrumb");
+    } else {
+      yield onUpdated;
+      ok(!containsFocus(doc, container), "Focus is outside of breadcrumbs");
+    }
+  }
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/inspector/test/browser_inspector_search_keyboard_trap.js
@@ -0,0 +1,93 @@
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test ability to tab to and away from inspector search using keyboard.
+
+const TEST_URL = URL_ROOT + "doc_inspector_search.html";
+
+/**
+ * Test data has the format of:
+ * {
+ *   desc         {String}    description for better logging
+ *   focused      {Boolean}   flag, indicating if search box contains focus
+ *   keys:        {Array}     list of keys that include key code and optional
+ *                            event data (shiftKey, etc)
+ * }
+ *
+ */
+const TEST_DATA = [
+  {
+    desc: "Move focus to a next focusable element",
+    focused: false,
+    keys: [
+      {
+        key: "VK_TAB",
+        options: { }
+      }
+    ]
+  },
+  {
+    desc: "Move focus back to searchbox",
+    focused: true,
+    keys: [
+      {
+        key: "VK_TAB",
+        options: { shiftKey: true }
+      }
+    ]
+  },
+  {
+    desc: "Open popup and then tab away (2 times) to the a next focusable element",
+    focused: false,
+    keys: [
+      {
+        key: "d",
+        options: { }
+      },
+      {
+        key: "VK_TAB",
+        options: { }
+      },
+      {
+        key: "VK_TAB",
+        options: { }
+      }
+    ]
+  },
+  {
+    desc: "Move focus back to searchbox",
+    focused: true,
+    keys: [
+      {
+        key: "VK_TAB",
+        options: { shiftKey: true }
+      }
+    ]
+  }
+];
+
+add_task(function*() {
+  let { inspector } = yield openInspectorForURL(TEST_URL);
+  let { searchBox } = inspector;
+  let doc = inspector.panelDoc;
+
+  yield selectNode("#b1", inspector);
+  yield focusSearchBoxUsingShortcut(inspector.panelWin);
+
+  // Ensure a searchbox is focused.
+  ok(containsFocus(doc, searchBox), "Focus is in a searchbox");
+
+  for (let { desc, focused, keys } of TEST_DATA) {
+    info(desc);
+    for (let { key, options } of keys) {
+      let done = !focused ?
+        inspector.searchSuggestions.once("processing-done") : Promise.resolve();
+      EventUtils.synthesizeKey(key, options);
+      yield done;
+    }
+    is(containsFocus(doc, searchBox), focused, "Focus is set correctly");
+  }
+});
--- a/devtools/client/inspector/test/head.js
+++ b/devtools/client/inspector/test/head.js
@@ -650,8 +650,25 @@ function waitForStyleEditor(toolbox, hre
  * @return a promise that resolves when the expected string has been found or
  * the validator function has returned true, rejects otherwise.
  */
 function waitForClipboard(setup, expected) {
   let def = promise.defer();
   SimpleTest.waitForClipboard(expected, setup, def.resolve, def.reject);
   return def.promise;
 }
+
+/**
+ * Checks if document's active element is within the given element.
+ * @param  {HTMLDocument}  doc document with active element in question
+ * @param  {DOMNode}       container element tested on focus containment
+ * @return {Boolean}
+ */
+function containsFocus(doc, container) {
+  let elm = doc.activeElement;
+  while (elm) {
+    if (elm === container) {
+      return true;
+    }
+    elm = elm.parentNode;
+  }
+  return false;
+}
--- a/devtools/client/themes/toolbars.css
+++ b/devtools/client/themes/toolbars.css
@@ -600,16 +600,17 @@
 
 /* Toolbox - moved from toolbox.css.
  * Rules that apply to the global toolbox like command buttons,
  * devtools tabs, docking buttons, etc. */
 
 #toolbox-controls > toolbarbutton,
 #toolbox-dock-buttons > toolbarbutton {
   -moz-appearance: none;
+  -moz-user-focus: normal;
   border: none;
   margin: 0 4px;
   min-width: 16px;
   width: 16px;
 }
 
 #toolbox-controls > toolbarbutton > .toolbarbutton-text,
 #toolbox-dock-buttons > toolbarbutton > .toolbarbutton-text,
@@ -686,16 +687,17 @@
 
 .command-button {
   -moz-appearance: none;
   border: none;
   padding: 0 8px;
   margin: 0;
   width: 32px;
   position: relative;
+  -moz-user-focus: normal;
 }
 
 .command-button:hover {
   background-color: hsla(206,37%,4%,.2);
 }
 .command-button:hover:active, .command-button[checked=true]:not(:hover) {
   background-color: hsla(206,37%,4%,.4);
 }
@@ -807,16 +809,17 @@
   min-height: 24px;
   max-width: 100px;
   margin: 0;
   padding: 0;
   border-style: solid;
   border-width: 0;
   -moz-border-start-width: 1px;
   -moz-box-align: center;
+  -moz-user-focus: normal;
 }
 
 .theme-dark .devtools-tab {
   color: var(--theme-body-color-alt);
   border-color: #42484f;
 }
 
 .theme-light .devtools-tab {
--- a/dom/apps/AppsUtils.jsm
+++ b/dom/apps/AppsUtils.jsm
@@ -834,17 +834,17 @@ this.ManifestHelper = function(aManifest
       this._localeRoot = this._manifest.locales[lang];
   }
 };
 
 ManifestHelper.prototype = {
   _localeProp: function(aProp) {
     if (this._localeRoot[aProp] != undefined)
       return this._localeRoot[aProp];
-    return this._manifest[aProp];
+    return (aProp in this._manifest) ? this._manifest[aProp] : undefined;
   },
 
   get name() {
     return this._localeProp("name");
   },
 
   get short_name() {
     return this._localeProp("short_name");
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -3870,16 +3870,24 @@ nsDOMWindowUtils::SetNextPaintSyncId(int
       return NS_OK;
     }
   }
 
   NS_WARNING("Paint sync id could not be set on the ClientLayerManager");
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsDOMWindowUtils::RespectDisplayPortSuppression(bool aEnabled)
+{
+  nsCOMPtr<nsIPresShell> shell(GetPresShell());
+  APZCCallbackHelper::RespectDisplayPortSuppression(aEnabled, shell);
+  return NS_OK;
+}
+
 NS_INTERFACE_MAP_BEGIN(nsTranslationNodeList)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsITranslationNodeList)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(nsTranslationNodeList)
 NS_IMPL_RELEASE(nsTranslationNodeList)
 
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -29,17 +29,17 @@
 
 //---------------------------------------------------------------------------
 // Generic atoms
 //---------------------------------------------------------------------------
 
 GK_ATOM(_empty, "")
 GK_ATOM(moz, "_moz")
 GK_ATOM(mozframetype, "mozframetype")
-GK_ATOM(_moz_abspos, "_moz_activated")
+GK_ATOM(_moz_abspos, "_moz_abspos")
 GK_ATOM(_moz_activated, "_moz_activated")
 GK_ATOM(_moz_resizing, "_moz_resizing")
 GK_ATOM(mozallowfullscreen, "mozallowfullscreen")
 GK_ATOM(moztype, "_moz-type")
 GK_ATOM(mozdirty, "_moz_dirty")
 GK_ATOM(mozdisallowselectionprint, "mozdisallowselectionprint")
 GK_ATOM(mozdonotsend, "moz-do-not-send")
 GK_ATOM(mozeditorbogusnode, "_moz_editor_bogus_node")
@@ -1998,17 +1998,16 @@ GK_ATOM(rubyBaseContainerFrame, "RubyBas
 GK_ATOM(rubyBaseFrame, "RubyBaseFrame")
 GK_ATOM(rubyFrame, "RubyFrame")
 GK_ATOM(rubyTextContainerFrame, "RubyTextContainerFrame")
 GK_ATOM(rubyTextFrame, "RubyTextFrame")
 GK_ATOM(scrollFrame, "ScrollFrame")
 GK_ATOM(scrollbarFrame, "ScrollbarFrame")
 GK_ATOM(sequenceFrame, "SequenceFrame")
 GK_ATOM(sliderFrame, "sliderFrame")
-GK_ATOM(summaryFrame, "SummaryFrame")
 GK_ATOM(tableCellFrame, "TableCellFrame")
 GK_ATOM(tableColFrame, "TableColFrame")
 GK_ATOM(tableColGroupFrame, "TableColGroupFrame")
 GK_ATOM(tableFrame, "TableFrame")
 GK_ATOM(tableOuterFrame, "TableOuterFrame")
 GK_ATOM(tableRowGroupFrame, "TableRowGroupFrame")
 GK_ATOM(tableRowFrame, "TableRowFrame")
 GK_ATOM(textInputFrame,"TextInputFrame")
--- a/dom/base/test/test_bug352728.html
+++ b/dom/base/test/test_bug352728.html
@@ -35,18 +35,18 @@ function checkInterfaces(aNode, aNodeTyp
   }
 }
 
 function testCharacterData(aNode, aText)
 {
   is(aNode.length, aText.length, "Text length should match");
   is(aNode.data, aText, "Text content should match");
   is(aNode.nodeValue, aText, "Check nodeValue");
-  is(aNode.localName, null, "Check localName")
-  is(aNode.namespaceURI, null, "Check namespaceURI");
+  is(aNode.localName, undefined, "Check localName")
+  is(aNode.namespaceURI, undefined, "Check namespaceURI");
 }
 
 function testComment(aText)
 {
   try {
     var comment = document.createComment(aText);
     var types = [ Comment, CharacterData, Node ];
     checkTypes(comment, "comment", types);
@@ -85,18 +85,18 @@ function testPI(aTarget, aData, aShouldS
     var interfaces = [ "nsIDOMProcessingInstruction", "nsIDOMNode",
                        "nsIDOMEventTarget" ];
     checkInterfaces(pi, "processing instruction", interfaces);
 
     is(pi.target, aTarget, "Check target");
     is(pi.data, aData, "Check data");
     is(pi.nodeName, aTarget, "Check nodeName");
     is(pi.nodeValue, aData, "Check nodeValue");
-    is(pi.localName, null, "Check localName")
-    is(pi.namespaceURI, null, "Check namespaceURI");
+    is(pi.localName, undefined, "Check localName")
+    is(pi.namespaceURI, undefined, "Check namespaceURI");
     
     is(pi.nodeType, Node.PROCESSING_INSTRUCTION_NODE, "Check nodeType");
 
     if (!aShouldSucceed) {
       ok(false, "Invalid processing instruction creation", aReason);
     }
   } catch (e) {
     if (aShouldSucceed) {
--- a/dom/base/test/test_bug352728.xhtml
+++ b/dom/base/test/test_bug352728.xhtml
@@ -59,18 +59,18 @@ function checkInterfaces(aNode, aNodeTyp
   }
 }
 
 function testCharacterData(aNode, aText)
 {
   is(aNode.length, aText.length, "Text length should match");
   is(aNode.data, aText, "Text content should match");
   is(aNode.nodeValue, aText, "Check nodeValue");
-  is(aNode.localName, null, "Check localName")
-  is(aNode.namespaceURI, null, "Check namespaceURI");
+  is(aNode.localName, undefined, "Check localName")
+  is(aNode.namespaceURI, undefined, "Check namespaceURI");
 }
 
 function testComment(aText)
 {
   try {
     var comment = document.createComment(aText);
     var types = [ Comment, CharacterData, Node ];
     checkTypes(comment, "comment", types);
@@ -129,18 +129,18 @@ function testPI(aTarget, aData, aShouldS
     var interfaces = [ "nsIDOMProcessingInstruction", "nsIDOMNode",
                        "nsIDOMEventTarget" ];
     checkInterfaces(pi, "processing instruction", interfaces);
 
     is(pi.target, aTarget, "Check target");
     is(pi.data, aData, "Check data");
     is(pi.nodeName, aTarget, "Check nodeName");
     is(pi.nodeValue, aData, "Check nodeValue");
-    is(pi.localName, null, "Check localName")
-    is(pi.namespaceURI, null, "Check namespaceURI");
+    is(pi.localName, undefined, "Check localName")
+    is(pi.namespaceURI, undefined, "Check namespaceURI");
     
     is(pi.nodeType, Node.PROCESSING_INSTRUCTION_NODE, "Check nodeType");
 
     if (!aShouldSucceed) {
       ok(0, "Invalid processing instruction creation", aReason);
     }
   } catch (e) {
     if (aShouldSucceed) {
--- a/dom/canvas/test/offscreencanvas.js
+++ b/dom/canvas/test/offscreencanvas.js
@@ -165,22 +165,27 @@ function createDrawFunc(canvas) {
   return function(prefix, needCommitFrame) {
     if (prefix) {
       prefix = "[" + prefix + "] ";
     } else {
       prefix = "";
     }
 
     gl.viewport(0, 0, canvas.width, canvas.height);
+    checkGLError(prefix + "[viewport]");
 
     preDraw(prefix);
+    checkGLError(prefix + "[predraw]");
     gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+    checkGLError(prefix + "[drawarrays]");
     postDraw(prefix);
+    checkGLError(prefix + "[postdraw]");
     if (needCommitFrame) {
       gl.commit();
+      checkGLError(prefix + "[commit]");
     }
     checkGLError(prefix);
   };
 }
 
 /* entry point */
 function entryFunction(testStr, subtests, offscreenCanvas) {
   var test = testStr;
--- a/dom/filesystem/CreateDirectoryTask.cpp
+++ b/dom/filesystem/CreateDirectoryTask.cpp
@@ -126,17 +126,17 @@ CreateDirectoryTaskChild::HandlerCallbac
 
   mPromise->MaybeResolve(dir);
   mPromise = nullptr;
 }
 
 void
 CreateDirectoryTaskChild::GetPermissionAccessType(nsCString& aAccess) const
 {
-  aAccess.AssignLiteral(CREATE_DIRECTORY_TASK_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_CREATE_PERMISSION);
 }
 
 /**
  * CreateDirectoryTaskParent
  */
 
 /* static */ already_AddRefed<CreateDirectoryTaskParent>
 CreateDirectoryTaskParent::Create(FileSystemBase* aFileSystem,
@@ -211,13 +211,13 @@ CreateDirectoryTaskParent::IOWork()
   }
 
   return NS_OK;
 }
 
 void
 CreateDirectoryTaskParent::GetPermissionAccessType(nsCString& aAccess) const
 {
-  aAccess.AssignLiteral(CREATE_DIRECTORY_TASK_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_CREATE_PERMISSION);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/filesystem/CreateDirectoryTask.h
+++ b/dom/filesystem/CreateDirectoryTask.h
@@ -6,18 +6,16 @@
 
 #ifndef mozilla_dom_CreateDirectoryTask_h
 #define mozilla_dom_CreateDirectoryTask_h
 
 #include "mozilla/dom/FileSystemTaskBase.h"
 #include "nsAutoPtr.h"
 #include "mozilla/ErrorResult.h"
 
-#define CREATE_DIRECTORY_TASK_PERMISSION "create"
-
 namespace mozilla {
 namespace dom {
 
 class FileSystemCreateDirectoryParams;
 class Promise;
 
 class CreateDirectoryTaskChild final : public FileSystemTaskChildBase
 {
--- a/dom/filesystem/CreateFileTask.cpp
+++ b/dom/filesystem/CreateFileTask.cpp
@@ -1,17 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CreateFileTask.h"
-#include "CreateDirectoryTask.h"
-#include "RemoveTask.h"
 
 #include <algorithm>
 
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/FileSystemBase.h"
 #include "mozilla/dom/FileSystemUtils.h"
 #include "mozilla/dom/PFileSystemParams.h"
@@ -22,20 +20,20 @@
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "nsIFile.h"
 #include "nsNetUtil.h"
 #include "nsIOutputStream.h"
 #include "nsStringGlue.h"
 
 #define GET_PERMISSION_ACCESS_TYPE(aAccess)                \
   if (mReplace) {                                          \
-    aAccess.AssignLiteral(REMOVE_TASK_PERMISSION);         \
+    aAccess.AssignLiteral(DIRECTORY_WRITE_PERMISSION);     \
     return;                                                \
   }                                                        \
-  aAccess.AssignLiteral(CREATE_DIRECTORY_TASK_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_CREATE_PERMISSION);
 
 namespace mozilla {
 namespace dom {
 
 /**
  *CreateFileTaskChild
  */
 
--- a/dom/filesystem/Directory.cpp
+++ b/dom/filesystem/Directory.cpp
@@ -6,16 +6,17 @@
 
 #include "mozilla/dom/Directory.h"
 
 #include "CreateDirectoryTask.h"
 #include "CreateFileTask.h"
 #include "FileSystemPermissionRequest.h"
 #include "GetDirectoryListingTask.h"
 #include "GetFileOrDirectoryTask.h"
+#include "GetFilesTask.h"
 #include "RemoveTask.h"
 
 #include "nsCharSeparatedTokenizer.h"
 #include "nsString.h"
 #include "mozilla/dom/DirectoryBinding.h"
 #include "mozilla/dom/FileSystemBase.h"
 #include "mozilla/dom/FileSystemUtils.h"
 #include "mozilla/dom/OSFileSystem.h"
@@ -441,16 +442,37 @@ Directory::GetFilesAndDirectories(ErrorR
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   FileSystemPermissionRequest::RequestForTask(task);
   return task->GetPromise();
 }
 
+already_AddRefed<Promise>
+Directory::GetFiles(bool aRecursiveFlag, ErrorResult& aRv)
+{
+  ErrorResult rv;
+  RefPtr<FileSystemBase> fs = GetFileSystem(rv);
+  if (NS_WARN_IF(rv.Failed())) {
+    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    return nullptr;
+  }
+
+  RefPtr<GetFilesTaskChild> task =
+    GetFilesTaskChild::Create(fs, mFile, aRecursiveFlag, rv);
+  if (NS_WARN_IF(rv.Failed())) {
+    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    return nullptr;
+  }
+
+  FileSystemPermissionRequest::RequestForTask(task);
+  return task->GetPromise();
+}
+
 void
 Directory::SetContentFilters(const nsAString& aFilters)
 {
   mFilters = aFilters;
 }
 
 FileSystemBase*
 Directory::GetFileSystem(ErrorResult& aRv)
--- a/dom/filesystem/Directory.h
+++ b/dom/filesystem/Directory.h
@@ -107,16 +107,19 @@ public:
   GetPath(nsAString& aRetval, ErrorResult& aRv);
 
   nsresult
   GetFullRealPath(nsAString& aPath);
 
   already_AddRefed<Promise>
   GetFilesAndDirectories(ErrorResult& aRv);
 
+  already_AddRefed<Promise>
+  GetFiles(bool aRecursiveFlag, ErrorResult& aRv);
+
   // =========== End WebIDL bindings.============
 
   /**
    * Sets a semi-colon separated list of filters to filter-in or filter-out
    * certain types of files when the contents of this directory are requested
    * via a GetFilesAndDirectories() call.
    *
    * Currently supported keywords:
--- a/dom/filesystem/FileSystemRequestParent.cpp
+++ b/dom/filesystem/FileSystemRequestParent.cpp
@@ -48,16 +48,17 @@ FileSystemRequestParent::Initialize(cons
   ErrorResult rv;
 
   switch (aParams.type()) {
 
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(CreateDirectory)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(CreateFile)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(GetDirectoryListing)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(GetFileOrDirectory)
+    FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(GetFiles)
     FILESYSTEM_REQUEST_PARENT_DISPATCH_ENTRY(Remove)
 
     default: {
       NS_RUNTIMEABORT("not reached");
       break;
     }
   }
 
--- a/dom/filesystem/FileSystemTaskBase.h
+++ b/dom/filesystem/FileSystemTaskBase.h
@@ -15,16 +15,20 @@
 namespace mozilla {
 namespace dom {
 
 class BlobImpl;
 class FileSystemBase;
 class FileSystemParams;
 class PBlobParent;
 
+#define DIRECTORY_READ_PERMISSION "read"
+#define DIRECTORY_WRITE_PERMISSION "write"
+#define DIRECTORY_CREATE_PERMISSION "create"
+
 /*
  * The base class to implement a Task class.
  * The file system operations can only be performed in the parent process. In
  * order to avoid duplicated code, we used PBackground for child-parent and
  * parent-parent communications.
  *
  * The following diagram illustrates the how a API call from the content page
  * starts a task and gets call back results.
--- a/dom/filesystem/GetDirectoryListingTask.cpp
+++ b/dom/filesystem/GetDirectoryListingTask.cpp
@@ -13,18 +13,16 @@
 #include "mozilla/dom/FileSystemUtils.h"
 #include "mozilla/dom/PFileSystemParams.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/dom/ipc/BlobParent.h"
 #include "nsIFile.h"
 #include "nsStringGlue.h"
 
-#define GET_DIRECTORY_LISTING_PERMISSION "read"
-
 namespace mozilla {
 namespace dom {
 
 /**
  * GetDirectoryListingTaskChild
  */
 
 /* static */ already_AddRefed<GetDirectoryListingTaskChild>
@@ -201,17 +199,17 @@ GetDirectoryListingTaskChild::HandlerCal
 
   mPromise->MaybeResolve(listing);
   mPromise = nullptr;
 }
 
 void
 GetDirectoryListingTaskChild::GetPermissionAccessType(nsCString& aAccess) const
 {
-  aAccess.AssignLiteral(GET_DIRECTORY_LISTING_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_READ_PERMISSION);
 }
 
 /**
  * GetDirectoryListingTaskParent
  */
 
 /* static */ already_AddRefed<GetDirectoryListingTaskParent>
 GetDirectoryListingTaskParent::Create(FileSystemBase* aFileSystem,
@@ -389,13 +387,13 @@ GetDirectoryListingTaskParent::IOWork()
     }
   }
   return NS_OK;
 }
 
 void
 GetDirectoryListingTaskParent::GetPermissionAccessType(nsCString& aAccess) const
 {
-  aAccess.AssignLiteral(GET_DIRECTORY_LISTING_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_READ_PERMISSION);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/filesystem/GetFileOrDirectoryTask.cpp
+++ b/dom/filesystem/GetFileOrDirectoryTask.cpp
@@ -12,18 +12,16 @@
 #include "mozilla/dom/FileSystemUtils.h"
 #include "mozilla/dom/PFileSystemParams.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/dom/ipc/BlobParent.h"
 #include "nsIFile.h"
 #include "nsStringGlue.h"
 
-#define GET_FILE_OR_DIRECTORY_PERMISSION "read"
-
 namespace mozilla {
 namespace dom {
 
 /**
  * GetFileOrDirectoryTaskChild
  */
 
 /* static */ already_AddRefed<GetFileOrDirectoryTaskChild>
@@ -166,17 +164,17 @@ GetFileOrDirectoryTaskChild::HandlerCall
                                            mTargetPath);
   mPromise->MaybeResolve(file);
   mPromise = nullptr;
 }
 
 void
 GetFileOrDirectoryTaskChild::GetPermissionAccessType(nsCString& aAccess) const
 {
-  aAccess.AssignLiteral(GET_FILE_OR_DIRECTORY_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_READ_PERMISSION);
 }
 
 /**
  * GetFileOrDirectoryTaskParent
  */
 
 /* static */ already_AddRefed<GetFileOrDirectoryTaskParent>
 GetFileOrDirectoryTaskParent::Create(FileSystemBase* aFileSystem,
@@ -293,13 +291,13 @@ GetFileOrDirectoryTaskParent::IOWork()
   }
 
   return NS_OK;
 }
 
 void
 GetFileOrDirectoryTaskParent::GetPermissionAccessType(nsCString& aAccess) const
 {
-  aAccess.AssignLiteral(GET_FILE_OR_DIRECTORY_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_READ_PERMISSION);
 }
 
 } // namespace dom
 } // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/dom/filesystem/GetFilesTask.cpp
@@ -0,0 +1,359 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "GetFilesTask.h"
+
+#include "HTMLSplitOnSpacesTokenizer.h"
+#include "js/Value.h"
+#include "mozilla/dom/File.h"
+#include "mozilla/dom/FileSystemBase.h"
+#include "mozilla/dom/FileSystemUtils.h"
+#include "mozilla/dom/PFileSystemParams.h"
+#include "mozilla/dom/Promise.h"
+#include "mozilla/dom/ipc/BlobChild.h"
+#include "mozilla/dom/ipc/BlobParent.h"
+#include "nsIFile.h"
+#include "nsStringGlue.h"
+
+namespace mozilla {
+namespace dom {
+
+/**
+ * GetFilesTaskChild
+ */
+
+/* static */ already_AddRefed<GetFilesTaskChild>
+GetFilesTaskChild::Create(FileSystemBase* aFileSystem,
+                          nsIFile* aTargetPath,
+                          bool aRecursiveFlag,
+                          ErrorResult& aRv)
+{
+  MOZ_ASSERT(aFileSystem);
+  aFileSystem->AssertIsOnOwningThread();
+
+  nsCOMPtr<nsIGlobalObject> globalObject =
+    do_QueryInterface(aFileSystem->GetParentObject());
+  if (NS_WARN_IF(!globalObject)) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+
+  RefPtr<GetFilesTaskChild> task =
+    new GetFilesTaskChild(aFileSystem, aTargetPath, aRecursiveFlag);
+
+  // aTargetPath can be null. In this case SetError will be called.
+
+  task->mPromise = Promise::Create(globalObject, aRv);
+  if (NS_WARN_IF(aRv.Failed())) {
+    return nullptr;
+  }
+
+  return task.forget();
+}
+
+GetFilesTaskChild::GetFilesTaskChild(FileSystemBase* aFileSystem,
+                                     nsIFile* aTargetPath,
+                                     bool aRecursiveFlag)
+  : FileSystemTaskChildBase(aFileSystem)
+  , mTargetPath(aTargetPath)
+  , mRecursiveFlag(aRecursiveFlag)
+{
+  MOZ_ASSERT(aFileSystem);
+  aFileSystem->AssertIsOnOwningThread();
+}
+
+GetFilesTaskChild::~GetFilesTaskChild()
+{
+  mFileSystem->AssertIsOnOwningThread();
+}
+
+already_AddRefed<Promise>
+GetFilesTaskChild::GetPromise()
+{
+  mFileSystem->AssertIsOnOwningThread();
+  return RefPtr<Promise>(mPromise).forget();
+}
+
+FileSystemParams
+GetFilesTaskChild::GetRequestParams(const nsString& aSerializedDOMPath,
+                                    ErrorResult& aRv) const
+{
+  mFileSystem->AssertIsOnOwningThread();
+
+  nsAutoString path;
+  aRv = mTargetPath->GetPath(path);
+  if (NS_WARN_IF(aRv.Failed())) {
+    return FileSystemGetFilesParams();
+  }
+
+  return FileSystemGetFilesParams(aSerializedDOMPath, path, mRecursiveFlag);
+}
+
+void
+GetFilesTaskChild::SetSuccessRequestResult(const FileSystemResponseValue& aValue,
+                                           ErrorResult& aRv)
+{
+  mFileSystem->AssertIsOnOwningThread();
+  MOZ_ASSERT(aValue.type() ==
+               FileSystemResponseValue::TFileSystemFilesResponse);
+
+  FileSystemFilesResponse r = aValue;
+
+  if (!mTargetData.SetLength(r.data().Length(), mozilla::fallible_t())) {
+    aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
+    return;
+  }
+
+  for (uint32_t i = 0; i < r.data().Length(); ++i) {
+    const FileSystemFileResponse& data = r.data()[i];
+    mTargetData[i] = data.realPath();
+  }
+}
+
+void
+GetFilesTaskChild::HandlerCallback()
+{
+  mFileSystem->AssertIsOnOwningThread();
+  if (mFileSystem->IsShutdown()) {
+    mPromise = nullptr;
+    return;
+  }
+
+  if (HasError()) {
+    mPromise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
+    mPromise = nullptr;
+    return;
+  }
+
+  size_t count = mTargetData.Length();
+
+  Sequence<RefPtr<File>> listing;
+
+  if (!listing.SetLength(count, mozilla::fallible_t())) {
+    mPromise->MaybeReject(NS_ERROR_OUT_OF_MEMORY);
+    mPromise = nullptr;
+    return;
+  }
+
+  for (unsigned i = 0; i < count; i++) {
+    nsCOMPtr<nsIFile> path;
+    NS_ConvertUTF16toUTF8 fullPath(mTargetData[i]);
+    nsresult rv = NS_NewNativeLocalFile(fullPath, true, getter_AddRefs(path));
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      mPromise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
+      mPromise = nullptr;
+      return;
+    }
+
+#ifdef DEBUG
+    nsCOMPtr<nsIFile> rootPath;
+    rv = NS_NewLocalFile(mFileSystem->LocalOrDeviceStorageRootPath(), false,
+                         getter_AddRefs(rootPath));
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      mPromise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
+      mPromise = nullptr;
+      return;
+    }
+
+    MOZ_ASSERT(FileSystemUtils::IsDescendantPath(rootPath, path));
+#endif
+
+    RefPtr<File> file =
+      File::CreateFromFile(mFileSystem->GetParentObject(), path);
+    MOZ_ASSERT(file);
+
+    listing[i] = file;
+  }
+
+  mPromise->MaybeResolve(listing);
+  mPromise = nullptr;
+}
+
+void
+GetFilesTaskChild::GetPermissionAccessType(nsCString& aAccess) const
+{
+  aAccess.AssignLiteral("read");
+}
+
+/**
+ * GetFilesTaskParent
+ */
+
+/* static */ already_AddRefed<GetFilesTaskParent>
+GetFilesTaskParent::Create(FileSystemBase* aFileSystem,
+                           const FileSystemGetFilesParams& aParam,
+                           FileSystemRequestParent* aParent,
+                           ErrorResult& aRv)
+{
+  MOZ_ASSERT(XRE_IsParentProcess(), "Only call from parent process!");
+  AssertIsOnBackgroundThread();
+  MOZ_ASSERT(aFileSystem);
+
+  RefPtr<GetFilesTaskParent> task =
+    new GetFilesTaskParent(aFileSystem, aParam, aParent);
+
+  NS_ConvertUTF16toUTF8 path(aParam.realPath());
+  aRv = NS_NewNativeLocalFile(path, true, getter_AddRefs(task->mTargetPath));
+  if (NS_WARN_IF(aRv.Failed())) {
+    return nullptr;
+  }
+
+  return task.forget();
+}
+
+GetFilesTaskParent::GetFilesTaskParent(FileSystemBase* aFileSystem,
+                                       const FileSystemGetFilesParams& aParam,
+                                       FileSystemRequestParent* aParent)
+  : FileSystemTaskParentBase(aFileSystem, aParam, aParent)
+  , mRecursiveFlag(aParam.recursiveFlag())
+{
+  MOZ_ASSERT(XRE_IsParentProcess(), "Only call from parent process!");
+  AssertIsOnBackgroundThread();
+  MOZ_ASSERT(aFileSystem);
+}
+
+FileSystemResponseValue
+GetFilesTaskParent::GetSuccessRequestResult(ErrorResult& aRv) const
+{
+  AssertIsOnBackgroundThread();
+
+  InfallibleTArray<PBlobParent*> blobs;
+
+  FallibleTArray<FileSystemFileResponse> inputs;
+  if (!inputs.SetLength(mTargetData.Length(), mozilla::fallible_t())) {
+    aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
+    FileSystemFilesResponse response;
+    return response;
+  }
+
+  for (unsigned i = 0; i < mTargetData.Length(); i++) {
+    FileSystemFileResponse fileData;
+    fileData.realPath() = mTargetData[i];
+    inputs[i] = fileData;
+  }
+
+  FileSystemFilesResponse response;
+  response.data().SwapElements(inputs);
+  return response;
+}
+
+nsresult
+GetFilesTaskParent::IOWork()
+{
+  MOZ_ASSERT(XRE_IsParentProcess(),
+             "Only call from parent process!");
+  MOZ_ASSERT(!NS_IsMainThread(), "Only call on I/O thread!");
+
+  if (mFileSystem->IsShutdown()) {
+    return NS_ERROR_FAILURE;
+  }
+
+  bool exists;
+  nsresult rv = mTargetPath->Exists(&exists);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
+
+  if (!exists) {
+    return NS_OK;
+  }
+
+  // Get isDirectory.
+  rv = ExploreDirectory(mTargetPath);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
+
+  return NS_OK;
+}
+
+nsresult
+GetFilesTaskParent::ExploreDirectory(nsIFile* aPath)
+{
+  MOZ_ASSERT(XRE_IsParentProcess(),
+             "Only call from parent process!");
+  MOZ_ASSERT(!NS_IsMainThread(), "Only call on worker thread!");
+  MOZ_ASSERT(aPath);
+
+  bool isDir;
+  nsresult rv = aPath->IsDirectory(&isDir);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
+
+  if (!isDir) {
+    return NS_ERROR_DOM_FILESYSTEM_TYPE_MISMATCH_ERR;
+  }
+
+  nsCOMPtr<nsISimpleEnumerator> entries;
+  rv = aPath->GetDirectoryEntries(getter_AddRefs(entries));
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
+
+  for (;;) {
+    bool hasMore = false;
+    if (NS_WARN_IF(NS_FAILED(entries->HasMoreElements(&hasMore))) || !hasMore) {
+      break;
+    }
+    nsCOMPtr<nsISupports> supp;
+    if (NS_WARN_IF(NS_FAILED(entries->GetNext(getter_AddRefs(supp))))) {
+      break;
+    }
+
+    nsCOMPtr<nsIFile> currFile = do_QueryInterface(supp);
+    MOZ_ASSERT(currFile);
+
+    bool isLink, isSpecial, isFile;
+    if (NS_WARN_IF(NS_FAILED(currFile->IsSymlink(&isLink)) ||
+                   NS_FAILED(currFile->IsSpecial(&isSpecial))) ||
+        isLink || isSpecial) {
+      continue;
+    }
+
+    if (NS_WARN_IF(NS_FAILED(currFile->IsFile(&isFile)) ||
+                   NS_FAILED(currFile->IsDirectory(&isDir))) ||
+        !(isFile || isDir)) {
+      continue;
+    }
+
+    if (isFile) {
+      nsAutoString path;
+      if (NS_WARN_IF(NS_FAILED(currFile->GetPath(path)))) {
+        continue;
+      }
+
+      if (!mTargetData.AppendElement(path, fallible)) {
+        return NS_ERROR_OUT_OF_MEMORY;
+      }
+
+      continue;
+    }
+
+    MOZ_ASSERT(isDir);
+
+    if (!mRecursiveFlag) {
+      continue;
+    }
+
+    // Recursive.
+    rv = ExploreDirectory(currFile);
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      return rv;
+    }
+  }
+
+  return NS_OK;
+}
+
+void
+GetFilesTaskParent::GetPermissionAccessType(nsCString& aAccess) const
+{
+  aAccess.AssignLiteral(DIRECTORY_READ_PERMISSION);
+}
+
+} // namespace dom
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/dom/filesystem/GetFilesTask.h
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_dom_GetFilesTask_h
+#define mozilla_dom_GetFilesTask_h
+
+#include "mozilla/dom/Directory.h"
+#include "mozilla/dom/FileSystemTaskBase.h"
+#include "mozilla/ErrorResult.h"
+#include "nsAutoPtr.h"
+
+namespace mozilla {
+namespace dom {
+
+class BlobImpl;
+
+class GetFilesTaskChild final : public FileSystemTaskChildBase
+{
+public:
+  static already_AddRefed<GetFilesTaskChild>
+  Create(FileSystemBase* aFileSystem,
+         nsIFile* aTargetPath,
+         bool aRecursiveFlag,
+         ErrorResult& aRv);
+
+  virtual
+  ~GetFilesTaskChild();
+
+  already_AddRefed<Promise>
+  GetPromise();
+
+  virtual void
+  GetPermissionAccessType(nsCString& aAccess) const override;
+
+private:
+  // If aDirectoryOnly is set, we should ensure that the target is a directory.
+  GetFilesTaskChild(FileSystemBase* aFileSystem,
+                    nsIFile* aTargetPath,
+                    bool aRecursiveFlag);
+
+  virtual FileSystemParams
+  GetRequestParams(const nsString& aSerializedDOMPath,
+                   ErrorResult& aRv) const override;
+
+  virtual void
+  SetSuccessRequestResult(const FileSystemResponseValue& aValue,
+                          ErrorResult& aRv) override;
+
+  virtual void
+  HandlerCallback() override;
+
+  RefPtr<Promise> mPromise;
+  nsCOMPtr<nsIFile> mTargetPath;
+  bool mRecursiveFlag;
+
+  // We store the fullpath of Files.
+  FallibleTArray<nsString> mTargetData;
+};
+
+class GetFilesTaskParent final : public FileSystemTaskParentBase
+{
+public:
+  static already_AddRefed<GetFilesTaskParent>
+  Create(FileSystemBase* aFileSystem,
+         const FileSystemGetFilesParams& aParam,
+         FileSystemRequestParent* aParent,
+         ErrorResult& aRv);
+
+  virtual void
+  GetPermissionAccessType(nsCString& aAccess) const override;
+
+private:
+  GetFilesTaskParent(FileSystemBase* aFileSystem,
+                     const FileSystemGetFilesParams& aParam,
+                     FileSystemRequestParent* aParent);
+
+  virtual FileSystemResponseValue
+  GetSuccessRequestResult(ErrorResult& aRv) const override;
+
+  virtual nsresult
+  IOWork() override;
+
+  nsresult
+  ExploreDirectory(nsIFile* aPath);
+
+  nsCOMPtr<nsIFile> mTargetPath;
+  bool mRecursiveFlag;
+
+  // We store the fullpath of Files.
+  FallibleTArray<nsString> mTargetData;
+};
+
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_GetFilesTask_h
--- a/dom/filesystem/PFileSystemParams.ipdlh
+++ b/dom/filesystem/PFileSystemParams.ipdlh
@@ -39,16 +39,23 @@ struct FileSystemGetDirectoryListingPara
   // filters.  Since an nsString can share its buffer when copied,
   // using that instead of InfallibleTArray<nsString> makes copying the filters
   // around in any given process a bit more efficient too, since copying a
   // single nsString is cheaper than copying InfallibleTArray member data and
   // each nsString that it contains.
   nsString filters;
 };
 
+struct FileSystemGetFilesParams
+{
+  nsString filesystem;
+  nsString realPath;
+  bool recursiveFlag;
+};
+
 struct FileSystemGetFileOrDirectoryParams
 {
   nsString filesystem;
   nsString realPath;
   bool isRoot;
 };
 
 struct FileSystemRemoveParams
@@ -59,14 +66,15 @@ struct FileSystemRemoveParams
   bool recursive;
 };
 
 union FileSystemParams
 {
   FileSystemCreateDirectoryParams;
   FileSystemCreateFileParams;
   FileSystemGetDirectoryListingParams;
+  FileSystemGetFilesParams;
   FileSystemGetFileOrDirectoryParams;
   FileSystemRemoveParams;
 };
 
 } // dom namespace
 } // mozilla namespace
--- a/dom/filesystem/PFileSystemRequest.ipdl
+++ b/dom/filesystem/PFileSystemRequest.ipdl
@@ -38,32 +38,38 @@ union FileSystemDirectoryListingResponse
   FileSystemDirectoryListingResponseDirectory;
 };
 
 struct FileSystemDirectoryListingResponse
 {
   FileSystemDirectoryListingResponseData[] data;
 };
 
+struct FileSystemFilesResponse
+{
+  FileSystemFileResponse[] data;
+};
+
 struct FileSystemErrorResponse
 {
   nsresult error;
 };
 
 struct FileSystemBooleanResponse
 {
   bool success;
 };
 
 union FileSystemResponseValue
 {
   FileSystemBooleanResponse;
   FileSystemDirectoryResponse;
   FileSystemDirectoryListingResponse;
   FileSystemFileResponse;
+  FileSystemFilesResponse;
   FileSystemErrorResponse;
 };
 
 protocol PFileSystemRequest
 {
   manager PBackground;
 
 child:
--- a/dom/filesystem/RemoveTask.cpp
+++ b/dom/filesystem/RemoveTask.cpp
@@ -137,17 +137,17 @@ RemoveTaskChild::HandlerCallback()
 
   mPromise->MaybeResolve(mReturnValue);
   mPromise = nullptr;
 }
 
 void
 RemoveTaskChild::GetPermissionAccessType(nsCString& aAccess) const
 {
-  aAccess.AssignLiteral(REMOVE_TASK_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_WRITE_PERMISSION);
 }
 
 /**
  * RemoveTaskParent
  */
 
 /* static */ already_AddRefed<RemoveTaskParent>
 RemoveTaskParent::Create(FileSystemBase* aFileSystem,
@@ -247,13 +247,13 @@ RemoveTaskParent::IOWork()
   mReturnValue = true;
 
   return NS_OK;
 }
 
 void
 RemoveTaskParent::GetPermissionAccessType(nsCString& aAccess) const
 {
-  aAccess.AssignLiteral(REMOVE_TASK_PERMISSION);
+  aAccess.AssignLiteral(DIRECTORY_WRITE_PERMISSION);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/filesystem/RemoveTask.h
+++ b/dom/filesystem/RemoveTask.h
@@ -6,18 +6,16 @@
 
 #ifndef mozilla_dom_RemoveTask_h
 #define mozilla_dom_RemoveTask_h
 
 #include "mozilla/dom/FileSystemTaskBase.h"
 #include "nsAutoPtr.h"
 #include "mozilla/ErrorResult.h"
 
-#define REMOVE_TASK_PERMISSION "write"
-
 namespace mozilla {
 namespace dom {
 
 class BlobImpl;
 class Promise;
 
 class RemoveTaskChild final : public FileSystemTaskChildBase
 {
--- a/dom/filesystem/moz.build
+++ b/dom/filesystem/moz.build
@@ -23,16 +23,17 @@ UNIFIED_SOURCES += [
     'Directory.cpp',
     'FileSystemBase.cpp',
     'FileSystemPermissionRequest.cpp',
     'FileSystemRequestParent.cpp',
     'FileSystemTaskBase.cpp',
     'FileSystemUtils.cpp',
     'GetDirectoryListingTask.cpp',
     'GetFileOrDirectoryTask.cpp',
+    'GetFilesTask.cpp',
     'OSFileSystem.cpp',
     'RemoveTask.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 IPDL_SOURCES += [
     'PFileSystemParams.ipdlh',
new file mode 100644
--- /dev/null
+++ b/dom/filesystem/tests/filesystem_commons.js
@@ -0,0 +1,75 @@
+function test_basic(aDirectory, aNext) {
+  ok(aDirectory, "Directory exists.");
+  ok(aDirectory instanceof Directory, "We have a directory.");
+  is(aDirectory.name, '/', "directory.name must be '/'");
+  is(aDirectory.path, '/', "directory.path must be '/'");
+  aNext();
+}
+
+function test_getFilesAndDirectories(aDirectory, aRecursive, aNext) {
+  function checkSubDir(dir) {
+    return dir.getFilesAndDirectories().then(
+      function(data) {
+        for (var i = 0; i < data.length; ++i) {
+          ok (data[i] instanceof File || data[i] instanceof Directory, "Just Files or Directories");
+          if (data[i] instanceof Directory) {
+            isnot(data[i].name, '/', "Subdirectory should be called with the leafname");
+            isnot(data[i].path, '/', "Subdirectory path should be called with the leafname");
+            isnot(data[i].path, dir.path, "Subdirectory path should contain the parent path.");
+            is(data[i].path,dir.path + '/' + data[i].name, "Subdirectory path should be called parentdir.path + '/' + leafname");
+          }
+        }
+      }
+    );
+  }
+
+  aDirectory.getFilesAndDirectories().then(
+    function(data) {
+      ok(data.length, "We should have some data.");
+      var promises = [];
+      for (var i = 0; i < data.length; ++i) {
+        ok (data[i] instanceof File || data[i] instanceof Directory, "Just Files or Directories: " + data[i].name);
+        if (data[i] instanceof Directory) {
+          isnot(data[i].name, '/', "Subdirectory should be called with the leafname");
+          is(data[i].path, '/' + data[i].name, "Subdirectory path should be called '/' + leafname");
+          if (aRecursive) {
+            promises.push(checkSubDir(data[i]));
+          }
+        }
+      }
+
+      return Promise.all(promises);
+    },
+    function() {
+      ok(false, "Something when wrong");
+    }
+  ).then(aNext);
+}
+
+function test_getFiles(aDirectory, aRecursive, aNext) {
+  aDirectory.getFiles(aRecursive).then(
+    function(data) {
+      for (var i = 0; i < data.length; ++i) {
+        ok (data[i] instanceof File, "File: " + data[i].name);
+      }
+    },
+    function() {
+      ok(false, "Something when wrong");
+    }
+  ).then(aNext);
+}
+
+function test_getFiles_recursiveComparison(aDirectory, aNext) {
+  aDirectory.getFiles(true).then(function(data) {
+    is(data.length, 2, "Only 2 files for this test.");
+    ok(data[0].name == 'foo.txt' || data[0].name == 'bar.txt', "First filename matches");
+    ok(data[1].name == 'foo.txt' || data[1].name == 'bar.txt', "Second filename matches");
+  }).then(function() {
+    return aDirectory.getFiles(false);
+  }).then(function(data) {
+    is(data.length, 1, "Only 1 file for this test.");
+    ok(data[0].name == 'foo.txt' || data[0].name == 'bar.txt', "First filename matches");
+  }).catch(function() {
+    ok(false, "Something when wrong");
+  }).then(aNext);
+}
--- a/dom/filesystem/tests/mochitest.ini
+++ b/dom/filesystem/tests/mochitest.ini
@@ -1,7 +1,8 @@
 [DEFAULT]
 support-files =
+  filesystem_commons.js
   script_fileList.js
   worker_basic.js
 
 [test_basic.html]
 [test_worker_basic.html]
--- a/dom/filesystem/tests/script_fileList.js
+++ b/dom/filesystem/tests/script_fileList.js
@@ -1,25 +1,70 @@
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 Cu.importGlobalProperties(["File"]);
 
-addMessageListener("dir.open", function (e) {
-  var testFile = Cc["@mozilla.org/file/directory_service;1"]
-                   .getService(Ci.nsIDirectoryService)
-                   .QueryInterface(Ci.nsIProperties)
-                   .get(e.path == 'root' ? 'ProfD' : e.path, Ci.nsIFile);
+function createProfDFile() {
+  return Cc["@mozilla.org/file/directory_service;1"]
+           .getService(Ci.nsIDirectoryService)
+           .QueryInterface(Ci.nsIProperties)
+           .get('ProfD', Ci.nsIFile);
+}
+
+function createRootFile() {
+  var testFile = createProfDFile();
 
   // Let's go back to the root of the FileSystem
-  if (e.path == 'root') {
-    while (true) {
-      var parent = testFile.parent;
-      if (!parent) {
-        break;
-      }
+  while (true) {
+    var parent = testFile.parent;
+    if (!parent) {
+      break;
+    }
+
+    testFile = parent;
+  }
+
+  return testFile;
+}
+
+function createTestFile() {
+  var tmpFile = Cc["@mozilla.org/file/directory_service;1"]
+                  .getService(Ci.nsIDirectoryService)
+                  .QueryInterface(Ci.nsIProperties)
+                  .get('TmpD', Ci.nsIFile)
+  tmpFile.append('dir-test');
+  tmpFile.createUnique(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0o700);
+
+  var file1 = tmpFile.clone();
+  file1.append('foo.txt');
+  file1.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0o600);
 
-      testFile = parent;
-    }
+  var dir = tmpFile.clone();
+  dir.append('subdir');
+  dir.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0o700);
+
+  var file2 = dir.clone();
+  file2.append('bar.txt');
+  file2.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0o600);
+
+  return tmpFile;
+}
+
+addMessageListener("dir.open", function (e) {
+  var testFile;
+
+  switch (e.path) {
+    case 'ProfD':
+      testFile = createProfDFile();
+      break;
+
+    case 'root':
+      testFile = createRootFile();
+      break;
+
+    case 'test':
+      testFile = createTestFile();
+      break;
   }
 
   sendAsyncMessage("dir.opened", {
     dir: testFile.path
   });
 });
--- a/dom/filesystem/tests/test_basic.html
+++ b/dom/filesystem/tests/test_basic.html
@@ -1,13 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test for Directory API</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="filesystem_commons.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 
 <body>
 <input id="fileList" type="file"></input>
 <script type="application/javascript;version=1.7">
 
 var directory;
@@ -29,73 +30,30 @@ function create_fileList(aPath) {
       next();
     });
   }
 
   script.addMessageListener("dir.opened", onOpened);
   script.sendAsyncMessage("dir.open", { path: aPath });
 }
 
-function test_basic() {
-  ok(directory, "Directory exists.");
-  ok(directory instanceof Directory, "We have a directory.");
-  is(directory.name, '/', "directory.name must be '/'");
-  is(directory.path, '/', "directory.path must be '/'");
-  next();
-}
-
-function checkSubDir(dir) {
-  return dir.getFilesAndDirectories().then(
-    function(data) {
-      for (var i = 0; i < data.length; ++i) {
-        ok (data[i] instanceof File || data[i] instanceof Directory, "Just Files or Directories");
-        if (data[i] instanceof Directory) {
-          isnot(data[i].name, '/', "Subdirectory should be called with the leafname: " + data[i].name);
-          isnot(data[i].path, '/', "Subdirectory path should be called with the leafname:" + data[i].path);
-          isnot(data[i].path, dir.path, "Subdirectory path should contain the parent path.");
-          is(data[i].path,dir.path + '/' + data[i].name, "Subdirectory path should be called parentdir.path + '/' + leafname");
-        }
-      }
-    }
-  );
-}
-
-function getFilesAndDirectories(aRecursive) {
-  directory.getFilesAndDirectories().then(
-    function(data) {
-      ok(data.length, "We should have some data.");
-      var promises = [];
-      for (var i = 0; i < data.length; ++i) {
-        ok (data[i] instanceof File || data[i] instanceof Directory, "Just Files or Directories");
-        if (data[i] instanceof Directory) {
-          isnot(data[i].name, '/', "Subdirectory should be called with the leafname");
-          is(data[i].path, '/' + data[i].name, "Subdirectory path should be called '/' + leafname");
-
-          if (aRecursive) {
-            promises.push(checkSubDir(data[i]));
-          }
-        }
-      }
-
-      return Promise.all(promises);
-    },
-    function() {
-      ok(false, "Something when wrong");
-    }
-  ).then(next);
-}
-
 var tests = [
   function() { create_fileList('ProfD') },
-  test_basic,
-  function() { getFilesAndDirectories(true) },
+  function() { test_basic(directory, next); },
+  function() { test_getFilesAndDirectories(directory, true, next); },
+  function() { test_getFiles(directory, false, next); },
+  function() { test_getFiles(directory, true, next); },
 
-  function() { create_fileList('root') },
-  test_basic,
-  function() { getFilesAndDirectories(false) },
+  function() { create_fileList('test') },
+  function() { test_getFiles_recursiveComparison(directory, next); },
+
+  function() { create_fileList('root'); },
+  function() { test_basic(directory, next); },
+  function() { test_getFilesAndDirectories(directory, false, next); },
+  function() { test_getFiles(directory, false, next); },
 ];
 
 function next() {
   if (!tests.length) {
     SimpleTest.finish();
     return;
   }
 
--- a/dom/filesystem/tests/worker_basic.js
+++ b/dom/filesystem/tests/worker_basic.js
@@ -1,56 +1,41 @@
+importScripts('filesystem_commons.js');
+
 function finish() {
   postMessage({ type: 'finish' });
 }
 
 function ok(a, msg) {
   postMessage({ type: 'test', test: !!a, message: msg });
 }
 
 function is(a, b, msg) {
   ok(a === b, msg);
 }
 
 function isnot(a, b, msg) {
   ok(a != b, msg);
 }
 
-function checkSubDir(dir) {
-  return dir.getFilesAndDirectories().then(
-    function(data) {
-      for (var i = 0; i < data.length; ++i) {
-        ok (data[i] instanceof File || data[i] instanceof Directory, "Just Files or Directories");
-        if (data[i] instanceof Directory) {
-          isnot(data[i].name, '/', "Subdirectory should be called with the leafname");
-          isnot(data[i].path, '/', "Subdirectory path should be called with the leafname");
-          isnot(data[i].path, dir.path, "Subdirectory path should contain the parent path.");
-          is(data[i].path,dir.path + '/' + data[i].name, "Subdirectory path should be called parentdir.path + '/' + leafname");
-        }
-      }
-    }
-  );
+var tests = [
+  function() { test_basic(directory, next); },
+  function() { test_getFilesAndDirectories(directory, true, next); },
+  function() { test_getFiles(directory, false, next); },
+  function() { test_getFiles(directory, true, next); },
+];
+
+function next() {
+  if (!tests.length) {
+    finish();
+    return;
+  }
+
+  var test = tests.shift();
+  test();
 }
 
+var directory;
+
 onmessage = function(e) {
-  var directory = e.data;
-  ok(directory instanceof Directory, "This is a directory.");
-
-  directory.getFilesAndDirectories().then(
-    function(data) {
-      ok(data.length, "We should have some data.");
-      var promises = [];
-      for (var i = 0; i < data.length; ++i) {
-        ok (data[i] instanceof File || data[i] instanceof Directory, "Just Files or Directories");
-        if (data[i] instanceof Directory) {
-          isnot(data[i].name, '/', "Subdirectory should be called with the leafname");
-          is(data[i].path, '/' + data[i].name, "Subdirectory path should be called '/' + leafname");
-          promises.push(checkSubDir(data[i]));
-        }
-      }
-
-      return Promise.all(promises);
-    },
-    function() {
-      ok(false, "Something when wrong");
-    }
-  ).then(finish);
+  directory = e.data;
+  next();
 }
--- a/dom/html/ImageDocument.cpp
+++ b/dom/html/ImageDocument.cpp
@@ -280,16 +280,19 @@ ImageDocument::SetScriptGlobalObject(nsI
 void
 ImageDocument::OnPageShow(bool aPersisted,
                           EventTarget* aDispatchStartTarget)
 {
   if (aPersisted) {
     mOriginalZoomLevel =
       Preferences::GetBool(SITE_SPECIFIC_ZOOM, false) ? 1.0 : GetZoomLevel();
   }
+  RefPtr<ImageDocument> kungFuDeathGrip(this);
+  UpdateSizeFromLayout();
+
   MediaDocument::OnPageShow(aPersisted, aDispatchStartTarget);
 }
 
 NS_IMETHODIMP
 ImageDocument::GetImageResizingEnabled(bool* aImageResizingEnabled)
 {
   *aImageResizingEnabled = ImageResizingEnabled();
   return NS_OK;
deleted file mode 100644
--- a/dom/imptests/editing.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-hg|https://dvcs.w3.org/hg/editing|editing
-
deleted file mode 100644
--- a/dom/imptests/editing/conformancetest/data.js
+++ /dev/null
@@ -1,30097 +0,0 @@
-var browserTests = [
-["foo[]bar",
-	[["backcolor","#00FFFF"]],
-	"foo[]bar",
-	[true],
-	{"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<p>[foo</p> <p>bar]</p>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<p><span style=\"background-color:rgb(0, 255, 255)\">[foo</span></p> <p><span style=\"background-color:rgb(0, 255, 255)\">bar]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<p>[foo</p> <p>bar]</p>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<p><span style=\"background-color:rgb(0, 255, 255)\">[foo</span></p> <p><span style=\"background-color:rgb(0, 255, 255)\">bar]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<span>[foo</span> <span>bar]</span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\"><span>[foo</span> <span>bar]</span></span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<span>[foo</span> <span>bar]</span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\"><span>[foo</span> <span>bar]</span></span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<p><span style=\"background-color:rgb(0, 255, 255)\">[foo</span></p><p> <span style=\"background-color:rgb(0, 255, 255)\"><span>bar</span></span> </p><p><span style=\"background-color:rgb(0, 255, 255)\">baz]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<p><span style=\"background-color:rgb(0, 255, 255)\">[foo</span></p><p> <span style=\"background-color:rgb(0, 255, 255)\"><span>bar</span></span> </p><p><span style=\"background-color:rgb(0, 255, 255)\">baz]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<p>[foo<p><br><p>bar]",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<p><span style=\"background-color:rgb(0, 255, 255)\">[foo</span></p><p><span style=\"background-color:rgb(0, 255, 255)\"><br></span></p><p><span style=\"background-color:rgb(0, 255, 255)\">bar]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<p>[foo<p><br><p>bar]",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<p><span style=\"background-color:rgb(0, 255, 255)\">[foo</span></p><p><span style=\"background-color:rgb(0, 255, 255)\"><br></span></p><p><span style=\"background-color:rgb(0, 255, 255)\">bar]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<b>foo[]bar</b>",
-	[["backcolor","#00FFFF"]],
-	"<b>foo[]bar</b>",
-	[true],
-	{"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<i>foo[]bar</i>",
-	[["backcolor","#00FFFF"]],
-	"<i>foo[]bar</i>",
-	[true],
-	{"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<span>foo</span>{}<span>bar</span>",
-	[["backcolor","#00FFFF"]],
-	"<span>foo</span>{}<span>bar</span>",
-	[true],
-	{"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<span>foo[</span><span>]bar</span>",
-	[["backcolor","#00FFFF"]],
-	"<span>foo[</span><span>]bar</span>",
-	[true],
-	{"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["foo[bar]baz",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(0, 255, 255)\">[bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["foo[bar]baz",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(0, 255, 255)\">[bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["foo[bar<b>baz]qoz</b>quz",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(0, 255, 255)\">[bar</span><b><span style=\"background-color:rgb(0, 255, 255)\">baz]</span>qoz</b>quz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["foo[bar<b>baz]qoz</b>quz",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(0, 255, 255)\">[bar</span><b><span style=\"background-color:rgb(0, 255, 255)\">baz]</span>qoz</b>quz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["foo[bar<i>baz]qoz</i>quz",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(0, 255, 255)\">[bar</span><i><span style=\"background-color:rgb(0, 255, 255)\">baz]</span>qoz</i>quz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["foo[bar<i>baz]qoz</i>quz",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(0, 255, 255)\">[bar</span><i><span style=\"background-color:rgb(0, 255, 255)\">baz]</span>qoz</i>quz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["{<p><p> <p>foo</p>}",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"{<p></p><p> </p><p><span style=\"background-color:rgb(0, 255, 255)\">foo</span></p>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["{<p><p> <p>foo</p>}",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"{<p></p><p> </p><p><span style=\"background-color:rgb(0, 255, 255)\">foo</span></p>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<table><tbody><tr><td>foo</td><td>b<span style=\"background-color:rgb(0, 255, 255)\">[a]</span>r</td><td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<table><tbody><tr><td>foo</td><td>b<span style=\"background-color:rgb(0, 255, 255)\">[a]</span>r</td><td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<table><tbody><tr><td>foo</td>{<td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td>}<td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<table><tbody><tr><td>foo</td>{<td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td>}<td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<table><tbody><tr>{<td><span style=\"background-color:rgb(0, 255, 255)\">foo</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td>}<td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<table><tbody><tr>{<td><span style=\"background-color:rgb(0, 255, 255)\">foo</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td>}<td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<table><tbody>{<tr><td><span style=\"background-color:rgb(0, 255, 255)\">foo</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">baz</span></td></tr>}</tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<table><tbody>{<tr><td><span style=\"background-color:rgb(0, 255, 255)\">foo</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">baz</span></td></tr>}</tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<table>{<tbody><tr><td><span style=\"background-color:rgb(0, 255, 255)\">foo</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">baz</span></td></tr></tbody>}</table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<table>{<tbody><tr><td><span style=\"background-color:rgb(0, 255, 255)\">foo</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">baz</span></td></tr></tbody>}</table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["{<table><tr><td>foo<td>bar<td>baz</table>}",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"{<table><tbody><tr><td><span style=\"background-color:rgb(0, 255, 255)\">foo</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">baz</span></td></tr></tbody></table>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["{<table><tr><td>foo<td>bar<td>baz</table>}",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"{<table><tbody><tr><td><span style=\"background-color:rgb(0, 255, 255)\">foo</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">bar</span></td><td><span style=\"background-color:rgb(0, 255, 255)\">baz</span></td></tr></tbody></table>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["<p style=\"background-color: rgb(0, 255, 255)\">foo[bar]baz</p>",
-	[["backcolor","#00FFFF"]],
-	"<p style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</p>",
-	[true],
-	{"backcolor":[false,false,"rgb(0, 255, 255)",false,false,"rgb(0, 255, 255)"]}],
-["<p style=\"background-color: #00ffff\">foo[bar]baz</p>",
-	[["backcolor","#00FFFF"]],
-	"<p style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</p>",
-	[true],
-	{"backcolor":[false,false,"rgb(0, 255, 255)",false,false,"rgb(0, 255, 255)"]}],
-["<p style=\"background-color: aqua\">foo[bar]baz</p>",
-	[["backcolor","#00FFFF"]],
-	"<p style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</p>",
-	[true],
-	{"backcolor":[false,false,"rgb(0, 255, 255)",false,false,"rgb(0, 255, 255)"]}],
-["{<p style=\"background-color: aqua\">foo</p><p>bar</p>}",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"{<p style=\"background-color:rgb(0, 255, 255)\">foo</p><p><span style=\"background-color:rgb(0, 255, 255)\">bar</span></p>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[true,false,"rgb(0, 255, 255)",false,false,"rgb(0, 255, 255)"]}],
-["{<p style=\"background-color: aqua\">foo</p><p>bar</p>}",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"{<p style=\"background-color:rgb(0, 255, 255)\">foo</p><p><span style=\"background-color:rgb(0, 255, 255)\">bar</span></p>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[true,false,"rgb(0, 255, 255)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: aqua\">foo<span style=\"background-color: tan\">[bar]</span>baz</span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: aqua\">foo<span style=\"background-color: tan\">[bar]</span>baz</span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: #00ffff\">foo<span style=\"background-color: tan\">[bar]</span>baz</span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: #00ffff\">foo<span style=\"background-color: tan\">[bar]</span>baz</span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: #0ff\">foo<span style=\"background-color: tan\">[bar]</span>baz</span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: #0ff\">foo<span style=\"background-color: tan\">[bar]</span>baz</span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: rgb(0, 255, 255)\">foo<span style=\"background-color: tan\">[bar]</span>baz</span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: rgb(0, 255, 255)\">foo<span style=\"background-color: tan\">[bar]</span>baz</span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo[bar]baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"background-color: aqua\">foo<span style=\"background-color: tan\">b[ar]</span>baz</span>",
-	[["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(0, 255, 255)\">foo<span style=\"background-color:rgb(210, 180, 140)\">b</span>[ar]baz</span>",
-	[true],
-	{"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<p style=\"background-color: aqua\">foo<span style=\"background-color: tan\">b[ar]</span>baz</p>",
-	[["backcolor","#00FFFF"]],
-	"<p style=\"background-color:rgb(0, 255, 255)\">foo<span style=\"background-color:rgb(210, 180, 140)\">b</span>[ar]baz</p>",
-	[true],
-	{"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<div style=\"background-color: aqua\"><p style=\"background-color: tan\">b[ar]</p></div>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<div style=\"background-color:rgb(0, 255, 255)\"><p style=\"background-color:rgb(210, 180, 140)\">b<span style=\"background-color:rgb(0, 255, 255)\">[ar]</span></p></div>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<div style=\"background-color: aqua\"><p style=\"background-color: tan\">b[ar]</p></div>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<div style=\"background-color:rgb(0, 255, 255)\"><p style=\"background-color:rgb(210, 180, 140)\">b<span style=\"background-color:rgb(0, 255, 255)\">[ar]</span></p></div>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"display: block; background-color: aqua\"><span style=\"display: block; background-color: tan\">b[ar]</span></span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"display:block; background-color:rgb(0, 255, 255)\"><span style=\"display:block; background-color:rgb(210, 180, 140)\">b<span style=\"background-color:rgb(0, 255, 255)\">[ar]</span></span></span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=\"display: block; background-color: aqua\"><span style=\"display: block; background-color: tan\">b[ar]</span></span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"display:block; background-color:rgb(0, 255, 255)\"><span style=\"display:block; background-color:rgb(210, 180, 140)\">b<span style=\"background-color:rgb(0, 255, 255)\">[ar]</span></span></span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["fo[o<span style=background-color:tan>b]ar</span>baz",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"fo<span style=\"background-color:rgb(0, 255, 255)\">[o</span><span style=\"background-color:rgb(210, 180, 140)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[true,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["fo[o<span style=background-color:tan>b]ar</span>baz",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"fo<span style=\"background-color:rgb(0, 255, 255)\">[o</span><span style=\"background-color:rgb(210, 180, 140)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[true,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["foo<span style=background-color:tan>ba[r</span>b]az",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(210, 180, 140)\">ba<span style=\"background-color:rgb(0, 255, 255)\">[r</span></span><span style=\"background-color:rgb(0, 255, 255)\">b]</span>az",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[true,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["foo<span style=background-color:tan>ba[r</span>b]az",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(210, 180, 140)\">ba<span style=\"background-color:rgb(0, 255, 255)\">[r</span></span><span style=\"background-color:rgb(0, 255, 255)\">b]</span>az",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[true,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["fo[o<span style=background-color:tan>bar</span>b]az",
-	[["backcolor","#00FFFF"]],
-	"fo<span style=\"background-color:rgb(0, 255, 255)\">[obarb]</span>az",
-	[true],
-	{"backcolor":[true,false,"rgba(0, 0, 0, 0)",false,false,"rgb(0, 255, 255)"]}],
-["foo[<span style=background-color:tan>b]ar</span>baz",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"foo[<span style=\"background-color:rgb(210, 180, 140)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["foo[<span style=background-color:tan>b]ar</span>baz",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"foo[<span style=\"background-color:rgb(210, 180, 140)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["foo<span style=background-color:tan>ba[r</span>]baz",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(210, 180, 140)\">ba<span style=\"background-color:rgb(0, 255, 255)\">[r</span></span>]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["foo<span style=background-color:tan>ba[r</span>]baz",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(210, 180, 140)\">ba<span style=\"background-color:rgb(0, 255, 255)\">[r</span></span>]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["foo[<span style=background-color:tan>bar</span>]baz",
-	[["backcolor","#00FFFF"]],
-	"foo[<span style=\"background-color:rgb(0, 255, 255)\">bar</span>]baz",
-	[true],
-	{"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["foo<span style=background-color:tan>[bar]</span>baz",
-	[["backcolor","#00FFFF"]],
-	"foo<span style=\"background-color:rgb(0, 255, 255)\">[bar]</span>baz",
-	[true],
-	{"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["foo{<span style=background-color:tan>bar</span>}baz",
-	[["backcolor","#00FFFF"]],
-	"foo{<span style=\"background-color:rgb(0, 255, 255)\">bar}</span>baz",
-	[true],
-	{"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=background-color:tan>fo[o</span><span style=background-color:yellow>b]ar</span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(210, 180, 140)\">fo<span style=\"background-color:rgb(0, 255, 255)\">[o</span></span><span style=\"background-color:rgb(255, 255, 0)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[true,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=background-color:tan>fo[o</span><span style=background-color:yellow>b]ar</span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(210, 180, 140)\">fo<span style=\"background-color:rgb(0, 255, 255)\">[o</span></span><span style=\"background-color:rgb(255, 255, 0)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[true,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=background-color:tan>fo[o</span><span style=background-color:tan>b]ar</span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(210, 180, 140)\">fo<span style=\"background-color:rgb(0, 255, 255)\">[o</span></span><span style=\"background-color:rgb(210, 180, 140)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=background-color:tan>fo[o</span><span style=background-color:tan>b]ar</span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(210, 180, 140)\">fo<span style=\"background-color:rgb(0, 255, 255)\">[o</span></span><span style=\"background-color:rgb(210, 180, 140)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=background-color:tan>fo[o<span style=background-color:transparent>b]ar</span></span>",
-	[["stylewithcss","true"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(210, 180, 140)\">fo<span style=\"background-color:rgb(0, 255, 255)\">[o</span><span style=\"background-color:rgba(0, 0, 0, 0)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span></span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["<span style=background-color:tan>fo[o<span style=background-color:transparent>b]ar</span></span>",
-	[["stylewithcss","false"],["backcolor","#00FFFF"]],
-	"<span style=\"background-color:rgb(210, 180, 140)\">fo<span style=\"background-color:rgb(0, 255, 255)\">[o</span><span style=\"background-color:rgba(0, 0, 0, 0)\"><span style=\"background-color:rgb(0, 255, 255)\">b]</span>ar</span></span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"backcolor":[false,false,"rgb(210, 180, 140)",false,false,"rgb(0, 255, 255)"]}],
-["foo[]bar",
-	[["bold",""]],
-	"foo[]bar",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["<p>[foo</p> <p>bar]</p>",
-	[["stylewithcss","true"],["bold",""]],
-	"<p><span style=\"font-weight:bold\">[foo</span></p> <p><span style=\"font-weight:bold\">bar]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<p>[foo</p> <p>bar]</p>",
-	[["stylewithcss","false"],["bold",""]],
-	"<p><b>[foo</b></p> <p><b>bar]</b></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span>[foo</span> <span>bar]</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:bold\"><span>[foo</span> <span>bar]</span></span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span>[foo</span> <span>bar]</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b><span>[foo</span> <span>bar]</span></b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
-	[["stylewithcss","true"],["bold",""]],
-	"<p><span style=\"font-weight:bold\">[foo</span></p><p> <span style=\"font-weight:bold\"><span>bar</span></span> </p><p><span style=\"font-weight:bold\">baz]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
-	[["stylewithcss","false"],["bold",""]],
-	"<p><b>[foo</b></p><p> <b><span>bar</span></b> </p><p><b>baz]</b></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<p>[foo<p><br><p>bar]",
-	[["stylewithcss","true"],["bold",""]],
-	"<p><span style=\"font-weight:bold\">[foo</span></p><p><span style=\"font-weight:bold\"><br></span></p><p><span style=\"font-weight:bold\">bar]</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<p>[foo<p><br><p>bar]",
-	[["stylewithcss","false"],["bold",""]],
-	"<p><b>[foo</b></p><p><b><br></b></p><p><b>bar]</b></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<b>foo[]bar</b>",
-	[["bold",""]],
-	"<b>foo[]bar</b>",
-	[true],
-	{"bold":[false,true,"",false,false,""]}],
-["<i>foo[]bar</i>",
-	[["bold",""]],
-	"<i>foo[]bar</i>",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["<span>foo</span>{}<span>bar</span>",
-	[["bold",""]],
-	"<span>foo</span>{}<span>bar</span>",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["<span>foo[</span><span>]bar</span>",
-	[["bold",""]],
-	"<span>foo[</span><span>]bar</span>",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["foo[bar]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">[bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo[bar]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>[bar]</b>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo[bar<b>baz]qoz</b>quz",
-	[["bold",""]],
-	"foo<b>[barbaz]qoz</b>quz",
-	[true],
-	{"bold":[true,false,"",false,true,""]}],
-["foo[bar<i>baz]qoz</i>quz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">[bar</span><i><span style=\"font-weight:bold\">baz]</span>qoz</i>quz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo[bar<i>baz]qoz</i>quz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>[bar</b><i><b>baz]</b>qoz</i>quz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["{<p><p> <p>foo</p>}",
-	[["stylewithcss","true"],["bold",""]],
-	"{<p></p><p> </p><p><span style=\"font-weight:bold\">foo</span></p>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["{<p><p> <p>foo</p>}",
-	[["stylewithcss","false"],["bold",""]],
-	"{<p></p><p> </p><p><b>foo</b></p>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span contenteditable=false>[bar]</span>baz",
-	[["bold",""]],
-	"foo<span contenteditable=\"false\">[bar]</span>baz",
-	[false],
-	{"bold":[false,false,"",false,false,""]}],
-["fo[o<span contenteditable=false>bar</span>b]az",
-	[["stylewithcss","true"],["bold",""]],
-	"fo<span style=\"font-weight:bold\">[o</span><span contenteditable=\"false\">bar</span><span style=\"font-weight:bold\">b]</span>az",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["fo[o<span contenteditable=false>bar</span>b]az",
-	[["stylewithcss","false"],["bold",""]],
-	"fo<b>[o</b><span contenteditable=\"false\">bar</span><b>b]</b>az",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span contenteditable=false>ba[r</span>b]az",
-	[["bold",""]],
-	"foo<span contenteditable=\"false\">ba[r</span>b]az",
-	[false],
-	{"bold":[false,false,"",false,false,""]}],
-["fo[o<span contenteditable=false>b]ar</span>baz",
-	[["bold",""]],
-	"fo[o<span contenteditable=\"false\">b]ar</span>baz",
-	[false],
-	{"bold":[false,false,"",false,false,""]}],
-["fo[<b>o</b><span contenteditable=false>bar</span><b>b</b>]az",
-	[["stylewithcss","true"],["bold",""]],
-	"fo[o<span contenteditable=\"false\">bar</span>b]az",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["fo[<b>o</b><span contenteditable=false>bar</span><b>b</b>]az",
-	[["stylewithcss","false"],["bold",""]],
-	"fo[o<span contenteditable=\"false\">bar</span>b]az",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<span contenteditable=false>foo<span contenteditable=true>[bar]</span>baz</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span contenteditable=\"false\">foo<span contenteditable=\"true\"><span style=\"font-weight:bold\">[bar]</span></span>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span contenteditable=false>foo<span contenteditable=true>[bar]</span>baz</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span contenteditable=\"false\">foo<span contenteditable=\"true\"><b>[bar]</b></span>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span contenteditable=false>fo[o<span contenteditable=true>bar</span>b]az</span>",
-	[["bold",""]],
-	"<span contenteditable=\"false\">fo[o<span contenteditable=\"true\">bar</span>b]az</span>",
-	[false],
-	{"bold":[false,false,"",false,false,""]}],
-["<span contenteditable=false>foo<span contenteditable=true>ba[r</span>b]az</span>",
-	[["bold",""]],
-	"<span contenteditable=\"false\">foo<span contenteditable=\"true\">ba[r</span>b]az</span>",
-	[false],
-	{"bold":[false,false,"",false,false,""]}],
-["<span contenteditable=false>fo[o<span contenteditable=true>b]ar</span>baz</span>",
-	[["bold",""]],
-	"<span contenteditable=\"false\">fo[o<span contenteditable=\"true\">b]ar</span>baz</span>",
-	[false],
-	{"bold":[false,false,"",false,false,""]}],
-["<span contenteditable=false>fo[<b>o<span contenteditable=true>bar</span>b</b>]az</span>",
-	[["bold",""]],
-	"<span contenteditable=\"false\">fo[<b>o<span contenteditable=\"true\">bar</span>b</b>]az</span>",
-	[false],
-	{"bold":[false,true,"",false,true,""]}],
-["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
-	[["stylewithcss","true"],["bold",""]],
-	"<table><tbody><tr><td>foo</td><td>b<span style=\"font-weight:bold\">[a]</span>r</td><td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
-	[["stylewithcss","false"],["bold",""]],
-	"<table><tbody><tr><td>foo</td><td>b<b>[a]</b>r</td><td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","true"],["bold",""]],
-	"<table><tbody><tr><td>foo</td>{<td><span style=\"font-weight:bold\">bar</span></td>}<td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","false"],["bold",""]],
-	"<table><tbody><tr><td>foo</td>{<td><b>bar</b></td>}<td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","true"],["bold",""]],
-	"<table><tbody><tr>{<td><span style=\"font-weight:bold\">foo</span></td><td><span style=\"font-weight:bold\">bar</span></td>}<td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","false"],["bold",""]],
-	"<table><tbody><tr>{<td><b>foo</b></td><td><b>bar</b></td>}<td>baz</td></tr></tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","true"],["bold",""]],
-	"<table><tbody>{<tr><td><span style=\"font-weight:bold\">foo</span></td><td><span style=\"font-weight:bold\">bar</span></td><td><span style=\"font-weight:bold\">baz</span></td></tr>}</tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","false"],["bold",""]],
-	"<table><tbody>{<tr><td><b>foo</b></td><td><b>bar</b></td><td><b>baz</b></td></tr>}</tbody></table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","true"],["bold",""]],
-	"<table>{<tbody><tr><td><span style=\"font-weight:bold\">foo</span></td><td><span style=\"font-weight:bold\">bar</span></td><td><span style=\"font-weight:bold\">baz</span></td></tr></tbody>}</table>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
-	[["stylewithcss","false"],["bold",""]],
-	"<table>{<tbody><tr><td><b>foo</b></td><td><b>bar</b></td><td><b>baz</b></td></tr></tbody>}</table>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["{<table><tr><td>foo<td>bar<td>baz</table>}",
-	[["stylewithcss","true"],["bold",""]],
-	"{<table><tbody><tr><td><span style=\"font-weight:bold\">foo</span></td><td><span style=\"font-weight:bold\">bar</span></td><td><span style=\"font-weight:bold\">baz</span></td></tr></tbody></table>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["{<table><tr><td>foo<td>bar<td>baz</table>}",
-	[["stylewithcss","false"],["bold",""]],
-	"{<table><tbody><tr><td><b>foo</b></td><td><b>bar</b></td><td><b>baz</b></td></tr></tbody></table>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: bold\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: bold\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>[bar]</b>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>[bar]</b>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>bar</b>[baz]",
-	[["bold",""]],
-	"foo<b>bar[baz]</b>",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["[foo]<b>bar</b>baz",
-	[["bold",""]],
-	"<b>[foo]bar</b>baz",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["<b>foo</b>[bar]<b>baz</b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<b>foo[bar]baz</b>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<b>foo</b>[bar]<b>baz</b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b>foo[bar]baz</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<strong>bar</strong>[baz]",
-	[["bold",""]],
-	"foo<strong>bar[baz]</strong>",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["[foo]<strong>bar</strong>baz",
-	[["bold",""]],
-	"<strong>[foo]bar</strong>baz",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["<strong>foo</strong>[bar]<strong>baz</strong>",
-	[["bold",""]],
-	"<strong>foo[bar]baz</strong>",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["<b>foo</b>[bar]<strong>baz</strong>",
-	[["bold",""]],
-	"<b>foo[bar]baz</b>",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["<strong>foo</strong>[bar]<b>baz</b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<strong>foo[bar]baz</strong>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<strong>foo</strong>[bar]<b>baz</b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<strong>foo[bar]baz</strong>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo[<b>bar</b>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo[<b>bar</b>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo[<b>bar]</b>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo[<b>bar]</b>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>[bar</b>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>[bar</b>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo{<b></b>}baz",
-	[["bold",""]],
-	"foo{<b></b>}baz",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["foo{<i></i>}baz",
-	[["bold",""]],
-	"foo{<i></i>}baz",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["foo{<b><i></i></b>}baz",
-	[["bold",""]],
-	"foo{<b><i></i></b>}baz",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["foo{<i><b></b></i>}baz",
-	[["bold",""]],
-	"foo{<i><b></b></i>}baz",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["foo<strong>[bar]</strong>baz",
-	[["bold",""]],
-	"foo[bar]baz",
-	[true],
-	{"bold":[false,true,"",false,false,""]}],
-["foo[<strong>bar</strong>]baz",
-	[["bold",""]],
-	"foo[bar]baz",
-	[true],
-	{"bold":[false,true,"",false,false,""]}],
-["foo[<strong>bar]</strong>baz",
-	[["bold",""]],
-	"foo[bar]baz",
-	[true],
-	{"bold":[false,true,"",false,false,""]}],
-["foo<strong>[bar</strong>]baz",
-	[["bold",""]],
-	"foo[bar]baz",
-	[true],
-	{"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: bold\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: bold\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo[<span style=\"font-weight: bold\">bar</span>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo[<span style=\"font-weight: bold\">bar</span>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo[<span style=\"font-weight: bold\">bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo[<span style=\"font-weight: bold\">bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: bold\">[bar</span>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: bold\">[bar</span>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<b>{<p>foo</p><p>bar</p>}<p>baz</p></b>",
-	[["stylewithcss","true"],["bold",""]],
-	"{<p>foo</p><p>bar</p>}<p><span style=\"font-weight:bold\">baz</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<b>{<p>foo</p><p>bar</p>}<p>baz</p></b>",
-	[["stylewithcss","false"],["bold",""]],
-	"{<p>foo</p><p>bar</p>}<p><b>baz</b></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<b><p>foo[<i>bar</i>}</p><p>baz</p></b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<p><span style=\"font-weight:bold\">foo[</span><i>bar</i>}</p><p><span style=\"font-weight:bold\">baz</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<b><p>foo[<i>bar</i>}</p><p>baz</p></b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<p><b>foo[</b><i>bar</i>}</p><p><b>baz</b></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo [bar <b>baz] qoz</b> quz sic",
-	[["bold",""]],
-	"foo <b>[bar baz] qoz</b> quz sic",
-	[true],
-	{"bold":[true,false,"",false,true,""]}],
-["foo bar <b>baz [qoz</b> quz] sic",
-	[["bold",""]],
-	"foo bar <b>baz [qoz quz]</b> sic",
-	[true],
-	{"bold":[true,false,"",false,true,""]}],
-["<b id=purple>bar [baz] qoz</b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span id=\"purple\"><span style=\"font-weight:bold\">bar </span>[baz]<span style=\"font-weight:bold\"> qoz</span></span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<b id=purple>bar [baz] qoz</b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span id=\"purple\"><b>bar </b>[baz]<b> qoz</b></span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 100\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">[bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 100\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>[bar]</b>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 200\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">[bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 200\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>[bar]</b>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 300\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">[bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 300\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>[bar]</b>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 400\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">[bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 400\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>[bar]</b>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 500\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">[bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 500\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>[bar]</b>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 600\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 600\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 700\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 700\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 800\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 800\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 900\">[bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 900\">[bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 400\">[bar</span>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">[bar</span>]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 400\">[bar</span>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>[bar</b>]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: 700\">[bar</span>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: 700\">[bar</span>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo[<span style=\"font-weight: 400\">bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[<span style=\"font-weight:bold\">bar]</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo[<span style=\"font-weight: 400\">bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[<b>bar]</b>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo[<span style=\"font-weight: 700\">bar]</span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo[<span style=\"font-weight: 700\">bar]</span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo[<span style=\"font-weight: 400\">bar</span>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[<span style=\"font-weight:bold\">bar</span>]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["foo[<span style=\"font-weight: 400\">bar</span>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[<b>bar</b>]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo[<span style=\"font-weight: 700\">bar</span>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo[<span style=\"font-weight: 700\">bar</span>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<span style=\"font-weight: 100\">foo[bar]baz</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:100\">foo<span style=\"font-weight:bold\">[bar]</span>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span style=\"font-weight: 100\">foo[bar]baz</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:100\">foo<b>[bar]</b>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span style=\"font-weight: 400\">foo[bar]baz</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:400\">foo<span style=\"font-weight:bold\">[bar]</span>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span style=\"font-weight: 400\">foo[bar]baz</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:400\">foo<b>[bar]</b>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span style=\"font-weight: 700\">foo[bar]baz</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:700\">foo</span>[bar]<span style=\"font-weight:700\">baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<span style=\"font-weight: 700\">foo[bar]baz</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b>foo</b>[bar]<b>baz</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<span style=\"font-weight: 900\">foo[bar]baz</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:900\">foo</span>[bar]<span style=\"font-weight:900\">baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<span style=\"font-weight: 900\">foo[bar]baz</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:900\">foo</span>[bar]<span style=\"font-weight:900\">baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["{<span style=\"font-weight: 100\">foobar]baz</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"{<span style=\"font-weight:100\"><span style=\"font-weight:bold\">foobar]</span>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["{<span style=\"font-weight: 100\">foobar]baz</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"{<span style=\"font-weight:100\"><b>foobar]</b>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["{<span style=\"font-weight: 400\">foobar]baz</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"{<span style=\"font-weight:400\"><span style=\"font-weight:bold\">foobar]</span>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["{<span style=\"font-weight: 400\">foobar]baz</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"{<span style=\"font-weight:400\"><b>foobar]</b>baz</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["{<span style=\"font-weight: 700\">foobar]baz</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"{foobar]<span style=\"font-weight:700\">baz</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["{<span style=\"font-weight: 700\">foobar]baz</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"{foobar]<b>baz</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["{<span style=\"font-weight: 900\">foobar]baz</span>",
-	[["bold",""]],
-	"{foobar]<span style=\"font-weight:900\">baz</span>",
-	[true],
-	{"bold":[false,true,"",false,false,""]}],
-["<span style=\"font-weight: 100\">foo[barbaz</span>}",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:100\">foo<span style=\"font-weight:bold\">[barbaz</span></span>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span style=\"font-weight: 100\">foo[barbaz</span>}",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:100\">foo<b>[barbaz</b></span>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span style=\"font-weight: 400\">foo[barbaz</span>}",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:400\">foo<span style=\"font-weight:bold\">[barbaz</span></span>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span style=\"font-weight: 400\">foo[barbaz</span>}",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:400\">foo<b>[barbaz</b></span>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span style=\"font-weight: 700\">foo[barbaz</span>}",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:700\">foo</span>[barbaz}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<span style=\"font-weight: 700\">foo[barbaz</span>}",
-	[["stylewithcss","false"],["bold",""]],
-	"<b>foo</b>[barbaz}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<span style=\"font-weight: 900\">foo[barbaz</span>}",
-	[["bold",""]],
-	"<span style=\"font-weight:900\">foo</span>[barbaz}",
-	[true],
-	{"bold":[false,true,"",false,false,""]}],
-["<h3>foo[bar]baz</h3>",
-	[["stylewithcss","true"],["bold",""]],
-	"<h3>foo<span style=\"font-weight:normal\">[bar]</span>baz</h3>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<h3>foo[bar]baz</h3>",
-	[["stylewithcss","false"],["bold",""]],
-	"<h3>foo<span style=\"font-weight:normal\">[bar]</span>baz</h3>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["{<h3>foobar]baz</h3>",
-	[["stylewithcss","true"],["bold",""]],
-	"{<h3><span style=\"font-weight:normal\">foobar]</span>baz</h3>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["{<h3>foobar]baz</h3>",
-	[["stylewithcss","false"],["bold",""]],
-	"{<h3><span style=\"font-weight:normal\">foobar]</span>baz</h3>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<h3>foo[barbaz</h3>}",
-	[["stylewithcss","true"],["bold",""]],
-	"<h3>foo<span style=\"font-weight:normal\">[barbaz</span></h3>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<h3>foo[barbaz</h3>}",
-	[["stylewithcss","false"],["bold",""]],
-	"<h3>foo<span style=\"font-weight:normal\">[barbaz</span></h3>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<h3>[foobarbaz]</h3>",
-	[["stylewithcss","true"],["bold",""]],
-	"<h3><span style=\"font-weight:normal\">[foobarbaz]</span></h3>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<h3>[foobarbaz]</h3>",
-	[["stylewithcss","false"],["bold",""]],
-	"<h3><span style=\"font-weight:normal\">[foobarbaz]</span></h3>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["{<h3>foobarbaz]</h3>",
-	[["stylewithcss","true"],["bold",""]],
-	"{<h3><span style=\"font-weight:normal\">foobarbaz]</span></h3>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["{<h3>foobarbaz]</h3>",
-	[["stylewithcss","false"],["bold",""]],
-	"{<h3><span style=\"font-weight:normal\">foobarbaz]</span></h3>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<h3>[foobarbaz</h3>}",
-	[["stylewithcss","true"],["bold",""]],
-	"<h3><span style=\"font-weight:normal\">[foobarbaz</span></h3>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<h3>[foobarbaz</h3>}",
-	[["stylewithcss","false"],["bold",""]],
-	"<h3><span style=\"font-weight:normal\">[foobarbaz</span></h3>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["{<h3>foobarbaz</h3>}",
-	[["stylewithcss","true"],["bold",""]],
-	"{<h3><span style=\"font-weight:normal\">foobarbaz</span></h3>}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["{<h3>foobarbaz</h3>}",
-	[["stylewithcss","false"],["bold",""]],
-	"{<h3><span style=\"font-weight:normal\">foobarbaz</span></h3>}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<b>foo<span style=\"font-weight: normal\">bar<b>[baz]</b>quz</span>qoz</b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<b>foo<span style=\"font-weight:normal\">bar[baz]quz</span>qoz</b>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<b>foo<span style=\"font-weight: normal\">bar<b>[baz]</b>quz</span>qoz</b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b>foo<span style=\"font-weight:normal\">bar[baz]quz</span>qoz</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<b>foo<span style=\"font-weight: normal\">[bar]</span>baz</b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<b>foo[bar]baz</b>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<b>foo<span style=\"font-weight: normal\">[bar]</span>baz</b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b>foo[bar]baz</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["{<b>foo</b> <b>bar</b>}",
-	[["stylewithcss","true"],["bold",""]],
-	"{<span style=\"font-weight:bold\">foo bar}</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[true,false,"",false,true,""]}],
-["{<b>foo</b> <b>bar</b>}",
-	[["stylewithcss","false"],["bold",""]],
-	"{<b>foo bar}</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[true,false,"",false,true,""]}],
-["{<h3>foo</h3><b>bar</b>}",
-	[["stylewithcss","true"],["bold",""]],
-	"{<h3><span style=\"font-weight:normal\">foo</span></h3>bar}",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["{<h3>foo</h3><b>bar</b>}",
-	[["stylewithcss","false"],["bold",""]],
-	"{<h3><span style=\"font-weight:normal\">foo</span></h3>bar}",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<i><b>foo</b></i>[bar]<i><b>baz</b></i>",
-	[["stylewithcss","true"],["bold",""]],
-	"<b><i>foo</i>[bar]<i>baz</i></b>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<i><b>foo</b></i>[bar]<i><b>baz</b></i>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b><i>foo</i>[bar]<i>baz</i></b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<i><b>foo</b></i>[bar]<b>baz</b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<b><i>foo</i>[bar]baz</b>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<i><b>foo</b></i>[bar]<b>baz</b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b><i>foo</i>[bar]baz</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<b>foo</b>[bar]<i><b>baz</b></i>",
-	[["stylewithcss","true"],["bold",""]],
-	"<b>foo[bar]<i>baz</i></b>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<b>foo</b>[bar]<i><b>baz</b></i>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b>foo[bar]<i>baz</i></b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<font color=blue face=monospace><b>foo</b></font>[bar]",
-	[["bold",""]],
-	"<b><font color=\"blue\" face=\"monospace\">foo</font>[bar]</b>",
-	[true],
-	{"bold":[false,false,"",false,true,""]}],
-["foo<span style=\"font-weight: normal\"><b>{bar}</b></span>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo{bar}baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<span style=\"font-weight: normal\"><b>{bar}</b></span>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo{bar}baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["[foo<span class=notbold>bar</span>baz]",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:bold\">[foo<span class=\"notbold\"><span style=\"font-weight:bold\">bar</span></span>baz]</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["[foo<span class=notbold>bar</span>baz]",
-	[["stylewithcss","false"],["bold",""]],
-	"<b>[foo<span class=\"notbold\"><b>bar</b></span>baz]</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<b><span class=notbold>[foo]</span></b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span class=\"notbold\"><span style=\"font-weight:bold\">[foo]</span></span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<b><span class=notbold>[foo]</span></b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span class=\"notbold\"><b>[foo]</b></span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<b><span class=notbold>foo[bar]baz</span></b>",
-	[["stylewithcss","true"],["bold",""]],
-	"<b><span class=\"notbold\">foo<span style=\"font-weight:bold\">[bar]</span>baz</span></b>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<b><span class=notbold>foo[bar]baz</span></b>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b><span class=\"notbold\">foo<b>[bar]</b>baz</span></b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<p style=\"font-weight: bold\">foo[bar]baz</p>",
-	[["stylewithcss","true"],["bold",""]],
-	"<p><span style=\"font-weight:bold\">foo</span>[bar]<span style=\"font-weight:bold\">baz</span></p>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<p style=\"font-weight: bold\">foo[bar]baz</p>",
-	[["stylewithcss","false"],["bold",""]],
-	"<p><b>foo</b>[bar]<b>baz</b></p>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["fo[o<b>b]ar</b>baz",
-	[["bold",""]],
-	"fo<b>[ob]ar</b>baz",
-	[true],
-	{"bold":[true,false,"",false,true,""]}],
-["foo<b>ba[r</b>b]az",
-	[["bold",""]],
-	"foo<b>ba[rb]</b>az",
-	[true],
-	{"bold":[true,false,"",false,true,""]}],
-["fo[o<b>bar</b>b]az",
-	[["stylewithcss","true"],["bold",""]],
-	"fo<span style=\"font-weight:bold\">[obarb]</span>az",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[true,false,"",false,true,""]}],
-["fo[o<b>bar</b>b]az",
-	[["stylewithcss","false"],["bold",""]],
-	"fo<b>[obarb]</b>az",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[true,false,"",false,true,""]}],
-["foo[<b>b]ar</b>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[b]<span style=\"font-weight:bold\">ar</span>baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo[<b>b]ar</b>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[b]<b>ar</b>baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>ba[r</b>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo<span style=\"font-weight:bold\">ba</span>[r]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>ba[r</b>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo<b>ba</b>[r]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo[<b>bar</b>]baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo[<b>bar</b>]baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>[bar]</b>baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo<b>[bar]</b>baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo[bar]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["foo{<b>bar</b>}baz",
-	[["stylewithcss","true"],["bold",""]],
-	"foo{bar}baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["foo{<b>bar</b>}baz",
-	[["stylewithcss","false"],["bold",""]],
-	"foo{bar}baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["fo[o<span style=font-weight:bold>b]ar</span>baz",
-	[["bold",""]],
-	"fo<span style=\"font-weight:bold\">[ob]ar</span>baz",
-	[true],
-	{"bold":[true,false,"",false,true,""]}],
-["<span style=font-weight:800>fo[o</span><span style=font-weight:900>b]ar</span>",
-	[["bold",""]],
-	"<span style=\"font-weight:800\">fo</span>[ob]<span style=\"font-weight:900\">ar</span>",
-	[true],
-	{"bold":[false,true,"",false,false,""]}],
-["<span style=font-weight:700>fo[o</span><span style=font-weight:800>b]ar</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:700\">fo</span>[ob]<span style=\"font-weight:800\">ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<span style=font-weight:700>fo[o</span><span style=font-weight:800>b]ar</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<b>fo</b>[ob]<span style=\"font-weight:800\">ar</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<span style=font-weight:600>fo[o</span><span style=font-weight:700>b]ar</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:600\">fo</span>[ob]<span style=\"font-weight:700\">ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,true,"",false,false,""]}],
-["<span style=font-weight:600>fo[o</span><span style=font-weight:700>b]ar</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:600\">fo</span>[ob]<b>ar</b>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,true,"",false,false,""]}],
-["<span style=font-weight:500>fo[o</span><span style=font-weight:600>b]ar</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:500\">fo<span style=\"font-weight:bold\">[o</span></span><span style=\"font-weight:600\"><span style=\"font-weight:bold\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[true,false,"",false,true,""]}],
-["<span style=font-weight:500>fo[o</span><span style=font-weight:600>b]ar</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:500\">fo<b>[o</b></span><span style=\"font-weight:600\"><b>b]</b>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[true,false,"",false,true,""]}],
-["<span style=font-weight:400>fo[o</span><span style=font-weight:500>b]ar</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:400\">fo<span style=\"font-weight:bold\">[o</span></span><span style=\"font-weight:500\"><span style=\"font-weight:bold\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span style=font-weight:400>fo[o</span><span style=font-weight:500>b]ar</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:400\">fo<b>[o</b></span><span style=\"font-weight:500\"><b>b]</b>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span style=font-weight:300>fo[o</span><span style=font-weight:400>b]ar</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:300\">fo<span style=\"font-weight:bold\">[o</span></span><span style=\"font-weight:400\"><span style=\"font-weight:bold\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span style=font-weight:300>fo[o</span><span style=font-weight:400>b]ar</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:300\">fo<b>[o</b></span><span style=\"font-weight:400\"><b>b]</b>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span style=font-weight:200>fo[o</span><span style=font-weight:300>b]ar</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:200\">fo<span style=\"font-weight:bold\">[o</span></span><span style=\"font-weight:300\"><span style=\"font-weight:bold\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span style=font-weight:200>fo[o</span><span style=font-weight:300>b]ar</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:200\">fo<b>[o</b></span><span style=\"font-weight:300\"><b>b]</b>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["<span style=font-weight:100>fo[o</span><span style=font-weight:200>b]ar</span>",
-	[["stylewithcss","true"],["bold",""]],
-	"<span style=\"font-weight:100\">fo<span style=\"font-weight:bold\">[o</span></span><span style=\"font-weight:200\"><span style=\"font-weight:bold\">b]</span>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"bold":[false,false,"",false,true,""]}],
-["<span style=font-weight:100>fo[o</span><span style=font-weight:200>b]ar</span>",
-	[["stylewithcss","false"],["bold",""]],
-	"<span style=\"font-weight:100\">fo<b>[o</b></span><span style=\"font-weight:200\"><b>b]</b>ar</span>",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"bold":[false,false,"",false,true,""]}],
-["foo[]bar",
-	[["createlink","http://www.google.com/"]],
-	"foo[]bar",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<p>[foo</p> <p>bar]</p>",
-	[["createlink","http://www.google.com/"]],
-	"<p><a href=\"http://www.google.com/\">[foo</a></p> <p><a href=\"http://www.google.com/\">bar]</a></p>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<span>[foo</span> <span>bar]</span>",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\"><span>[foo</span> <span>bar]</span></a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<p>[foo</p><p> <span>bar</span> </p><p>baz]</p>",
-	[["createlink","http://www.google.com/"]],
-	"<p><a href=\"http://www.google.com/\">[foo</a></p><p> <a href=\"http://www.google.com/\"><span>bar</span></a> </p><p><a href=\"http://www.google.com/\">baz]</a></p>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<p>[foo<p><br><p>bar]",
-	[["createlink","http://www.google.com/"]],
-	"<p><a href=\"http://www.google.com/\">[foo</a></p><p><a href=\"http://www.google.com/\"><br></a></p><p><a href=\"http://www.google.com/\">bar]</a></p>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<b>foo[]bar</b>",
-	[["createlink","http://www.google.com/"]],
-	"<b>foo[]bar</b>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<i>foo[]bar</i>",
-	[["createlink","http://www.google.com/"]],
-	"<i>foo[]bar</i>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<span>foo</span>{}<span>bar</span>",
-	[["createlink","http://www.google.com/"]],
-	"<span>foo</span>{}<span>bar</span>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<span>foo[</span><span>]bar</span>",
-	[["createlink","http://www.google.com/"]],
-	"<span>foo[</span><span>]bar</span>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo[bar]baz",
-	[["createlink","http://www.google.com/"]],
-	"foo<a href=\"http://www.google.com/\">[bar]</a>baz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo[bar<b>baz]qoz</b>quz",
-	[["createlink","http://www.google.com/"]],
-	"foo<a href=\"http://www.google.com/\">[bar</a><b><a href=\"http://www.google.com/\">baz]</a>qoz</b>quz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo[bar<i>baz]qoz</i>quz",
-	[["createlink","http://www.google.com/"]],
-	"foo<a href=\"http://www.google.com/\">[bar</a><i><a href=\"http://www.google.com/\">baz]</a>qoz</i>quz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["{<p><p> <p>foo</p>}",
-	[["createlink","http://www.google.com/"]],
-	"{<p></p><p> </p><p><a href=\"http://www.google.com/\">foo</a></p>}",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
-	[["createlink","http://www.google.com/"]],
-	"<table><tbody><tr><td>foo</td><td>b<a href=\"http://www.google.com/\">[a]</a>r</td><td>baz</td></tr></tbody></table>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["createlink","http://www.google.com/"]],
-	"<table><tbody><tr><td>foo</td>{<td><a href=\"http://www.google.com/\">bar</a></td>}<td>baz</td></tr></tbody></table>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
-	[["createlink","http://www.google.com/"]],
-	"<table><tbody><tr>{<td><a href=\"http://www.google.com/\">foo</a></td><td><a href=\"http://www.google.com/\">bar</a></td>}<td>baz</td></tr></tbody></table>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
-	[["createlink","http://www.google.com/"]],
-	"<table><tbody>{<tr><td><a href=\"http://www.google.com/\">foo</a></td><td><a href=\"http://www.google.com/\">bar</a></td><td><a href=\"http://www.google.com/\">baz</a></td></tr>}</tbody></table>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
-	[["createlink","http://www.google.com/"]],
-	"<table>{<tbody><tr><td><a href=\"http://www.google.com/\">foo</a></td><td><a href=\"http://www.google.com/\">bar</a></td><td><a href=\"http://www.google.com/\">baz</a></td></tr></tbody>}</table>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["{<table><tr><td>foo<td>bar<td>baz</table>}",
-	[["createlink","http://www.google.com/"]],
-	"{<table><tbody><tr><td><a href=\"http://www.google.com/\">foo</a></td><td><a href=\"http://www.google.com/\">bar</a></td><td><a href=\"http://www.google.com/\">baz</a></td></tr></tbody></table>}",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=http://www.google.com/>foo[bar]baz</a>",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">foo[bar]baz</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=http://www.google.com/>foo[barbaz</a>}",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">foo[barbaz</a>}",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["{<a href=http://www.google.com/>foobar]baz</a>",
-	[["createlink","http://www.google.com/"]],
-	"{<a href=\"http://www.google.com/\">foobar]baz</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["{<a href=http://www.google.com/>foobarbaz</a>}",
-	[["createlink","http://www.google.com/"]],
-	"{<a href=\"http://www.google.com/\">foobarbaz}</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=http://www.google.com/>[foobarbaz]</a>",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">[foobarbaz]</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo<a href=http://www.google.com/>[bar]</a>baz",
-	[["createlink","http://www.google.com/"]],
-	"foo<a href=\"http://www.google.com/\">[bar]</a>baz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["[foo]<a href=http://www.google.com/>bar</a>baz",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">[foo]bar</a>baz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo<a href=http://www.google.com/>bar</a>[baz]",
-	[["createlink","http://www.google.com/"]],
-	"foo<a href=\"http://www.google.com/\">bar[baz]</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo[<a href=http://www.google.com/>bar</a>]baz",
-	[["createlink","http://www.google.com/"]],
-	"foo[<a href=\"http://www.google.com/\">bar</a>]baz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo<a href=http://www.google.com/>[bar</a>baz]",
-	[["createlink","http://www.google.com/"]],
-	"foo<a href=\"http://www.google.com/\">[barbaz]</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["[foo<a href=http://www.google.com/>bar]</a>baz",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">[foobar]</a>baz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["[foo<a href=http://www.google.com/>bar</a>baz]",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">[foobarbaz]</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=otherurl>foo[bar]baz</a>",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">foo[bar]baz</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=otherurl>foo[barbaz</a>}",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">foo[barbaz</a>}",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["{<a href=otherurl>foobar]baz</a>",
-	[["createlink","http://www.google.com/"]],
-	"{<a href=\"http://www.google.com/\">foobar]baz</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["{<a href=otherurl>foobarbaz</a>}",
-	[["createlink","http://www.google.com/"]],
-	"{<a href=\"http://www.google.com/\">foobarbaz}</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=otherurl>[foobarbaz]</a>",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">[foobarbaz]</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo<a href=otherurl>[bar]</a>baz",
-	[["createlink","http://www.google.com/"]],
-	"foo<a href=\"http://www.google.com/\">[bar]</a>baz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo[<a href=otherurl>bar</a>]baz",
-	[["createlink","http://www.google.com/"]],
-	"foo[<a href=\"http://www.google.com/\">bar</a>]baz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo<a href=otherurl>[bar</a>baz]",
-	[["createlink","http://www.google.com/"]],
-	"foo<a href=\"http://www.google.com/\">[barbaz]</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["[foo<a href=otherurl>bar]</a>baz",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">[foobar]</a>baz",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["[foo<a href=otherurl>bar</a>baz]",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\">[foobarbaz]</a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=otherurl><b>foo[bar]baz</b></a>",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\"><b>foo[bar]baz</b></a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=otherurl><b>foo[barbaz</b></a>}",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\"><b>foo[barbaz</b></a>}",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["{<a href=otherurl><b>foobar]baz</b></a>",
-	[["createlink","http://www.google.com/"]],
-	"{<a href=\"http://www.google.com/\"><b>foobar]baz</b></a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a href=otherurl><b>[foobarbaz]</b></a>",
-	[["createlink","http://www.google.com/"]],
-	"<a href=\"http://www.google.com/\"><b>[foobarbaz]</b></a>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a name=abc>foo[bar]baz</a>",
-	[["createlink","http://www.google.com/"]],
-	"<span name=\"abc\">foo<a href=\"http://www.google.com/\">[bar]</a>baz</span>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["<a name=abc><b>foo[bar]baz</b></a>",
-	[["createlink","http://www.google.com/"]],
-	"<span name=\"abc\"><b>foo<a href=\"http://www.google.com/\">[bar]</a>baz</b></span>",
-	[true],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo[bar]baz",
-	[["createlink",""]],
-	"foo[bar]baz",
-	[false],
-	{"createlink":[false,false,"",false,false,""]}],
-["foo[]bar",
-	[["delete",""]],
-	"fo[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<span>foo</span>{}<span>bar</span>",
-	[["delete",""]],
-	"<span>fo[]</span><span>bar</span>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<span>foo[</span><span>]bar</span>",
-	[["delete",""]],
-	"<span>foo[]</span><span>bar</span>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<span style=display:none>bar</span>[]baz",
-	[["stylewithcss","true"],["delete",""]],
-	"fo[]baz",
-	[true,true],
-	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
-["foo<span style=display:none>bar</span>[]baz",
-	[["stylewithcss","false"],["delete",""]],
-	"fo[]baz",
-	[true,true],
-	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
-["foo<script>bar</script>[]baz",
-	[["delete",""]],
-	"fo[]baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["fo&ouml;[]bar",
-	[["delete",""]],
-	"fo[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo&#x308;[]bar",
-	[["delete",""]],
-	"foo[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo&#x308;&#x327;[]bar",
-	[["delete",""]],
-	"foö[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["&ouml;[]bar",
-	[["delete",""]],
-	"{}bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["o&#x308;[]bar",
-	[["delete",""]],
-	"o[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["o&#x308;&#x327;[]bar",
-	[["delete",""]],
-	"ö[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["&#x5e9;&#x5c1;&#x5b8;[]&#x5dc;&#x5d5;&#x5b9;&#x5dd;",
-	[["delete",""]],
-	"שׁ[]לוֹם",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["&#x5e9;&#x5c1;&#x5b8;&#x5dc;&#x5d5;&#x5b9;[]&#x5dd;",
-	[["delete",""]],
-	"שָׁלו[]ם",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo</p><p>[]bar</p>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<p>foo{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<p>foo</p><p>[]bar</p>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<p>foo{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<p>foo</p>[]bar",
-	[["delete",""]],
-	"<p>foo{}bar</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<p>[]bar</p>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo{}bar",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<p>[]bar</p>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo{}bar",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<p>foo<br></p><p>[]bar</p>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<p>foo{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<p>foo<br></p><p>[]bar</p>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<p>foo{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<p>foo<br></p>[]bar",
-	[["delete",""]],
-	"<p>foo{}bar</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<br><p>[]bar</p>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo{}bar",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<br><p>[]bar</p>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo{}bar",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<p>foo<br><br></p><p>[]bar</p>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<p>foo<br>{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<p>foo<br><br></p><p>[]bar</p>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<p>foo<br>{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<p>foo<br><br></p>[]bar",
-	[["delete",""]],
-	"<p>foo<br>{}bar</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<br><br><p>[]bar</p>",
-	[["delete",""]],
-	"foo<br><p>{}bar</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div><p>foo</p></div><p>[]bar</p>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<div><p>foo{}bar</p></div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<div><p>foo</p></div><p>[]bar</p>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<div><p>foo{}bar</p></div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<p>foo</p><div><p>[]bar</p></div>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<p>foo{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<p>foo</p><div><p>[]bar</p></div>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<p>foo{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<div><p>foo</p></div><div><p>[]bar</p></div>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<div><p>foo{}bar</p></div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<div><p>foo</p></div><div><p>[]bar</p></div>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<div><p>foo{}bar</p></div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<div><p>foo</p></div>[]bar",
-	[["delete",""]],
-	"<div><p>foo{}bar</p></div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<div><p>[]bar</p></div>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo{}bar",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<div><p>[]bar</p></div>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo{}bar",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<div>foo</div><div>[]bar</div>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<div>foo{}bar</div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<div>foo</div><div>[]bar</div>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<div>foo{}bar</div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<pre>foo</pre>[]bar",
-	[["delete",""]],
-	"<pre>foo{}bar</pre>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<br>[]bar",
-	[["delete",""]],
-	"foo{}bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<br><b>[]bar</b>",
-	[["delete",""]],
-	"foo{}<b>bar</b>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<hr>[]bar",
-	[["delete",""]],
-	"foo{}bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo<hr><p>[]bar",
-	[["delete",""]],
-	"<p>foo</p><p>{}bar</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo</p><br><p>[]bar</p>",
-	[["delete",""]],
-	"<p>foo</p><p>{}bar</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo</p><br><br><p>[]bar</p>",
-	[["delete",""]],
-	"<p>foo</p><br><p>{}bar</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo</p><img src=/img/lion.svg><p>[]bar",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<p>foo</p><img src=\"/img/lion.svg\">{}bar",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<p>foo</p><img src=/img/lion.svg><p>[]bar",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<p>foo</p><img src=\"/img/lion.svg\">{}bar",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["foo<img src=/img/lion.svg>[]bar",
-	[["delete",""]],
-	"foo{}bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<a>foo</a>[]bar",
-	[["delete",""]],
-	"foo[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<a href=/>foo</a>[]bar",
-	[["delete",""]],
-	"foo[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<a name=abc>foo</a>[]bar",
-	[["delete",""]],
-	"foo[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<a href=/ name=abc>foo</a>[]bar",
-	[["delete",""]],
-	"foo[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<span><a>foo</a></span>[]bar",
-	[["delete",""]],
-	"<span>foo</span>[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<span><a href=/>foo</a></span>[]bar",
-	[["delete",""]],
-	"<span>foo</span>[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<span><a name=abc>foo</a></span>[]bar",
-	[["delete",""]],
-	"<span>foo</span>[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<span><a href=/ name=abc>foo</a></span>[]bar",
-	[["delete",""]],
-	"<span>foo</span>[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<a>[]bar</a>",
-	[["delete",""]],
-	"fo[]<a>bar</a>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<a href=/>[]bar</a>",
-	[["delete",""]],
-	"fo[]<a href=\"/\">bar</a>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<a name=abc>[]bar</a>",
-	[["delete",""]],
-	"fo[]<a name=\"abc\">bar</a>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<a href=/ name=abc>[]bar</a>",
-	[["delete",""]],
-	"fo[]<a href=\"/\" name=\"abc\">bar</a>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo &nbsp;[]",
-	[["delete",""]],
-	"foo&nbsp;[]",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["&nbsp;[] foo",
-	[["delete",""]],
-	"{}&nbsp;foo",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo &nbsp;[]bar",
-	[["delete",""]],
-	"foo []bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo&nbsp; []bar",
-	[["delete",""]],
-	"foo []bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo&nbsp;&nbsp;[]bar",
-	[["delete",""]],
-	"foo []bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo  []bar",
-	[["delete",""]],
-	"foo[]bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo []&nbsp; bar",
-	[["delete",""]],
-	"foo[]&nbsp; bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo &nbsp;[] bar",
-	[["delete",""]],
-	"foo&nbsp;[] bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo &nbsp; []bar",
-	[["delete",""]],
-	"foo&nbsp; []bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo []<span>&nbsp;</span> bar",
-	[["delete",""]],
-	"foo[]<span>&nbsp;</span> bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo <span>&nbsp;</span>[] bar",
-	[["delete",""]],
-	"foo&nbsp;{} bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo <span>&nbsp;</span> []bar",
-	[["delete",""]],
-	"foo&nbsp;<span> </span>{}bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<b>foo </b>&nbsp;[]bar",
-	[["delete",""]],
-	"<b>foo </b>{}bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<b>foo&nbsp;</b> []bar",
-	[["delete",""]],
-	"<b>foo </b>{}bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<b>foo&nbsp;</b>&nbsp;[]bar",
-	[["delete",""]],
-	"<b>foo </b>{}bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<b>foo </b> []bar",
-	[["delete",""]],
-	"<b>foo[]</b>bar",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo </p><p>[] bar</p>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"<p>foo{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["<p>foo </p><p>[] bar</p>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"<p>foo{}bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<pre>foo &nbsp;[]</pre>",
-	[["delete",""]],
-	"<pre>foo []</pre>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<pre>&nbsp;[] foo</pre>",
-	[["delete",""]],
-	"<pre>{} foo</pre>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<pre>foo &nbsp;[]bar</pre>",
-	[["delete",""]],
-	"<pre>foo []bar</pre>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<pre>foo&nbsp; []bar</pre>",
-	[["delete",""]],
-	"<pre>foo&nbsp;[]bar</pre>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<pre>foo  []bar</pre>",
-	[["delete",""]],
-	"<pre>foo []bar</pre>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre>foo &nbsp;[]</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre\">foo []</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre>&nbsp;[] foo</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre\">{} foo</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre>foo &nbsp;[]bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre\">foo []bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre>foo&nbsp; []bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre\">foo&nbsp;[]bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre>foo  []bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre\">foo []bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-wrap>foo &nbsp;[]</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-wrap\">foo []</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-wrap>&nbsp;[] foo</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-wrap\">{} foo</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-wrap\">foo []bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-wrap>foo&nbsp; []bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-wrap\">foo&nbsp;[]bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-wrap>foo  []bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-wrap\">foo []bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-line>foo &nbsp;[]</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-line\">foo&nbsp;[]</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-line>&nbsp;[] foo</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-line\">{}&nbsp;foo</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-line>foo &nbsp;[]bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-line\">foo []bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-line>foo&nbsp; []bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-line\">foo []bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:pre-line>foo  []bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:pre-line\">foo[]bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:nowrap>foo &nbsp;[]</div>",
-	[["delete",""]],
-	"<div style=\"white-space:nowrap\">foo&nbsp;[]</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:nowrap>&nbsp;[] foo</div>",
-	[["delete",""]],
-	"<div style=\"white-space:nowrap\">{}&nbsp;foo</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:nowrap>foo &nbsp;[]bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:nowrap\">foo []bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:nowrap>foo&nbsp; []bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:nowrap\">foo []bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<div style=white-space:nowrap>foo  []bar</div>",
-	[["delete",""]],
-	"<div style=\"white-space:nowrap\">foo[]bar</div>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<table><tr><td>[]bar</table>baz",
-	[["delete",""]],
-	"foo<table><tbody><tr><td>[]bar</td></tr></tbody></table>baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<table><tr><td>bar</table>[]baz",
-	[["delete",""]],
-	"foo{<table><tbody><tr><td>bar</td></tr></tbody></table>}baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo<table><tr><td>[]bar</table><p>baz",
-	[["delete",""]],
-	"<p>foo</p><table><tbody><tr><td>[]bar</td></tr></tbody></table><p>baz</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo<table><tr><td>bar</table><p>[]baz",
-	[["delete",""]],
-	"<p>foo</p>{<table><tbody><tr><td>bar</td></tr></tbody></table>}<p>baz</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<table><tr><td>foo<td>[]bar</table>",
-	[["delete",""]],
-	"<table><tbody><tr><td>foo</td><td>{}bar</td></tr></tbody></table>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<table><tr><td>foo<tr><td>[]bar</table>",
-	[["delete",""]],
-	"<table><tbody><tr><td>foo</td></tr><tr><td>{}bar</td></tr></tbody></table>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<br><table><tr><td>[]bar</table>baz",
-	[["delete",""]],
-	"foo<table><tbody><tr><td>[]bar</td></tr></tbody></table>baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<table><tr><td>bar<br></table>[]baz",
-	[["delete",""]],
-	"foo{<table><tbody><tr><td>bar<br></td></tr></tbody></table>}baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo<br><table><tr><td>[]bar</table><p>baz",
-	[["delete",""]],
-	"<p>foo<br></p><table><tbody><tr><td>[]bar</td></tr></tbody></table><p>baz</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo<table><tr><td>bar<br></table><p>[]baz",
-	[["delete",""]],
-	"<p>foo</p>{<table><tbody><tr><td>bar<br></td></tr></tbody></table>}<p>baz</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<table><tr><td>foo<br><td>[]bar</table>",
-	[["delete",""]],
-	"<table><tbody><tr><td>foo</td><td>{}bar</td></tr></tbody></table>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<table><tr><td>foo<br><tr><td>[]bar</table>",
-	[["delete",""]],
-	"<table><tbody><tr><td>foo</td></tr><tr><td>{}bar</td></tr></tbody></table>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<br><br><table><tr><td>[]bar</table>baz",
-	[["delete",""]],
-	"foo<br><br><table><tbody><tr><td>[]bar</td></tr></tbody></table>baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<table><tr><td>bar<br><br></table>[]baz",
-	[["delete",""]],
-	"foo{<table><tbody><tr><td>bar<br><br></td></tr></tbody></table>}baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo<br><br><table><tr><td>[]bar</table><p>baz",
-	[["delete",""]],
-	"<p>foo<br><br></p><table><tbody><tr><td>[]bar</td></tr></tbody></table><p>baz</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<p>foo<table><tr><td>bar<br><br></table><p>[]baz",
-	[["delete",""]],
-	"<p>foo</p>{<table><tbody><tr><td>bar<br><br></td></tr></tbody></table>}<p>baz</p>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<table><tr><td>foo<br><br><td>[]bar</table>",
-	[["delete",""]],
-	"<table><tbody><tr><td>foo<br><br></td><td>{}bar</td></tr></tbody></table>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<table><tr><td>foo<br><br><tr><td>[]bar</table>",
-	[["delete",""]],
-	"<table><tbody><tr><td>foo<br><br></td></tr><tr><td>{}bar</td></tr></tbody></table>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<hr><table><tr><td>[]bar</table>baz",
-	[["delete",""]],
-	"foo<hr><table><tbody><tr><td>[]bar</td></tr></tbody></table>baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<table><tr><td>bar<hr></table>[]baz",
-	[["delete",""]],
-	"foo{<table><tbody><tr><td>bar<hr></td></tr></tbody></table>}baz",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<table><tr><td>foo<hr><td>[]bar</table>",
-	[["delete",""]],
-	"<table><tbody><tr><td>foo<hr></td><td>{}bar</td></tr></tbody></table>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<table><tr><td>foo<hr><tr><td>[]bar</table>",
-	[["delete",""]],
-	"<table><tbody><tr><td>foo<hr></td></tr><tr><td>{}bar</td></tr></tbody></table>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<ol><li>[]bar<li>baz</ol>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo<div>[]bar</div><ol><li>baz</li></ol>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<ol><li>[]bar<li>baz</ol>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo<p>[]bar</p><ol><li>baz</li></ol>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["foo<br><ol><li>[]bar<li>baz</ol>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo<div>[]bar</div><ol><li>baz</li></ol>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<br><ol><li>[]bar<li>baz</ol>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo<p>[]bar</p><ol><li>baz</li></ol>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["foo<br><br><ol><li>[]bar<li>baz</ol>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo<br><br><div>[]bar</div><ol><li>baz</li></ol>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<br><br><ol><li>[]bar<li>baz</ol>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo<br><br><p>[]bar</p><ol><li>baz</li></ol>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo<li>[]bar</ol>",
-	[["delete",""]],
-	"<ol><li>foo<br>[]bar</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo<br><li>[]bar</ol>",
-	[["delete",""]],
-	"<ol><li>foo<br>[]bar</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo<br><br><li>[]bar</ol>",
-	[["delete",""]],
-	"<ol><li>foo<br><br>[]bar</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo<li>[]bar<br>baz</ol>",
-	[["delete",""]],
-	"<ol><li>foo<br>[]bar<br>baz</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo<br>bar<li>[]baz</ol>",
-	[["delete",""]],
-	"<ol><li>foo<br>bar<br>[]baz</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li><p>foo</p>{}bar</ol>",
-	[["delete",""]],
-	"<ol><li><p>foo{}bar</p></li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li><p>foo<li>[]bar</ol>",
-	[["delete",""]],
-	"<ol><li><p>foo</p>[]bar</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo<li><p>[]bar</ol>",
-	[["delete",""]],
-	"<ol><li>foo<p>[]bar</p></li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li><p>foo<li><p>[]bar</ol>",
-	[["delete",""]],
-	"<ol><li><p>foo</p><p>[]bar</p></li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo<ul><li>[]bar</ul></ol>",
-	[["delete",""]],
-	"<ol><li>foo</li><li>[]bar</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<ol><ol><li>[]bar</ol></ol>",
-	[["delete",""]],
-	"foo<ol><li>[]bar</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["foo<div><ol><li>[]bar</ol></div>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo<div><div>[]bar</div></div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<div><ol><li>[]bar</ol></div>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo<div><p>[]bar</p></div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["foo<dl><dt>[]bar<dd>baz</dl>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo<div>[]bar</div><dl><dd>baz</dd></dl>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<dl><dt>[]bar<dd>baz</dl>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo<p>[]bar</p><dl><dd>baz</dd></dl>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["foo<dl><dd>[]bar</dl>",
-	[["defaultparagraphseparator","div"],["delete",""]],
-	"foo<div>[]bar</div>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"p",false,false,"div"],"delete":[false,false,"",false,false,""]}],
-["foo<dl><dd>[]bar</dl>",
-	[["defaultparagraphseparator","p"],["delete",""]],
-	"foo<p>[]bar</p>",
-	[true,true],
-	{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"delete":[false,false,"",false,false,""]}],
-["<dl><dt>foo<dd>[]bar</dl>",
-	[["delete",""]],
-	"<dl><dt>foo<br>[]bar</dt></dl>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<dl><dt>foo<dt>[]bar<dd>baz</dl>",
-	[["delete",""]],
-	"<dl><dt>foo<br>[]bar</dt><dd>baz</dd></dl>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<dl><dt>foo<dd>bar<dd>[]baz</dl>",
-	[["delete",""]],
-	"<dl><dt>foo</dt><dd>bar<br>[]baz</dd></dl>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo</ol>[]bar",
-	[["delete",""]],
-	"<ol><li>foo{}bar</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],
-["<ol><li>foo<br></ol>[]bar",
-	[["delete",""]],
-	"<ol><li>foo{}bar</li></ol>",
-	[true],
-	{"delete":[false,false,"",false,false,""]}],