gecko/dom/base/nsXMLHttpRequest.cpp
Birunthan Mohanathas b11c47cb70 Bug 946065 - Part 12: Move content/base/ to dom/ and flatten subdirectories. r=peterv
--HG--
rename : content/base/src/Attr.cpp => dom/base/Attr.cpp
rename : content/base/src/Attr.h => dom/base/Attr.h
rename : content/base/src/AutocompleteFieldList.h => dom/base/AutocompleteFieldList.h
rename : content/base/public/BlobSet.h => dom/base/BlobSet.h
rename : content/base/public/CORSMode.h => dom/base/CORSMode.h
rename : content/base/src/ChildIterator.cpp => dom/base/ChildIterator.cpp
rename : content/base/src/ChildIterator.h => dom/base/ChildIterator.h
rename : content/base/src/Comment.cpp => dom/base/Comment.cpp
rename : content/base/src/Comment.h => dom/base/Comment.h
rename : content/base/src/DOMImplementation.cpp => dom/base/DOMImplementation.cpp
rename : content/base/src/DOMImplementation.h => dom/base/DOMImplementation.h
rename : content/base/src/DOMMatrix.cpp => dom/base/DOMMatrix.cpp
rename : content/base/src/DOMMatrix.h => dom/base/DOMMatrix.h
rename : content/base/src/DOMParser.cpp => dom/base/DOMParser.cpp
rename : content/base/src/DOMParser.h => dom/base/DOMParser.h
rename : content/base/src/DOMPoint.cpp => dom/base/DOMPoint.cpp
rename : content/base/src/DOMPoint.h => dom/base/DOMPoint.h
rename : content/base/src/DOMQuad.cpp => dom/base/DOMQuad.cpp
rename : content/base/src/DOMQuad.h => dom/base/DOMQuad.h
rename : content/base/src/DOMRect.cpp => dom/base/DOMRect.cpp
rename : content/base/src/DOMRect.h => dom/base/DOMRect.h
rename : content/base/src/DOMStringList.cpp => dom/base/DOMStringList.cpp
rename : content/base/src/DOMStringList.h => dom/base/DOMStringList.h
rename : content/base/src/DirectionalityUtils.cpp => dom/base/DirectionalityUtils.cpp
rename : content/base/public/DirectionalityUtils.h => dom/base/DirectionalityUtils.h
rename : content/base/src/DocumentFragment.cpp => dom/base/DocumentFragment.cpp
rename : content/base/src/DocumentFragment.h => dom/base/DocumentFragment.h
rename : content/base/src/DocumentType.cpp => dom/base/DocumentType.cpp
rename : content/base/src/DocumentType.h => dom/base/DocumentType.h
rename : content/base/src/Element.cpp => dom/base/Element.cpp
rename : content/base/public/Element.h => dom/base/Element.h
rename : content/base/public/ElementInlines.h => dom/base/ElementInlines.h
rename : content/base/src/EventSource.cpp => dom/base/EventSource.cpp
rename : content/base/src/EventSource.h => dom/base/EventSource.h
rename : content/base/src/FeedWriterEnabled.h => dom/base/FeedWriterEnabled.h
rename : content/base/src/File.cpp => dom/base/File.cpp
rename : content/base/public/File.h => dom/base/File.h
rename : content/base/src/FileIOObject.cpp => dom/base/FileIOObject.cpp
rename : content/base/src/FileIOObject.h => dom/base/FileIOObject.h
rename : content/base/src/FragmentOrElement.cpp => dom/base/FragmentOrElement.cpp
rename : content/base/public/FragmentOrElement.h => dom/base/FragmentOrElement.h
rename : content/base/public/FromParser.h => dom/base/FromParser.h
rename : content/base/public/HTMLSplitOnSpacesTokenizer.h => dom/base/HTMLSplitOnSpacesTokenizer.h
rename : content/base/src/ImportManager.cpp => dom/base/ImportManager.cpp
rename : content/base/src/ImportManager.h => dom/base/ImportManager.h
rename : content/base/src/Link.cpp => dom/base/Link.cpp
rename : content/base/src/Link.h => dom/base/Link.h
rename : content/base/src/MultipartFileImpl.cpp => dom/base/MultipartFileImpl.cpp
rename : content/base/src/MultipartFileImpl.h => dom/base/MultipartFileImpl.h
rename : content/base/src/NodeIterator.cpp => dom/base/NodeIterator.cpp
rename : content/base/src/NodeIterator.h => dom/base/NodeIterator.h
rename : content/base/src/ResponsiveImageSelector.cpp => dom/base/ResponsiveImageSelector.cpp
rename : content/base/src/ResponsiveImageSelector.h => dom/base/ResponsiveImageSelector.h
rename : content/base/src/ShadowRoot.cpp => dom/base/ShadowRoot.cpp
rename : content/base/src/ShadowRoot.h => dom/base/ShadowRoot.h
rename : content/base/src/StyleSheetList.cpp => dom/base/StyleSheetList.cpp
rename : content/base/src/StyleSheetList.h => dom/base/StyleSheetList.h
rename : content/base/src/Text.cpp => dom/base/Text.cpp
rename : content/base/src/Text.h => dom/base/Text.h
rename : content/base/src/ThirdPartyUtil.cpp => dom/base/ThirdPartyUtil.cpp
rename : content/base/src/ThirdPartyUtil.h => dom/base/ThirdPartyUtil.h
rename : content/base/src/TreeWalker.cpp => dom/base/TreeWalker.cpp
rename : content/base/src/TreeWalker.h => dom/base/TreeWalker.h
rename : content/base/src/WebSocket.cpp => dom/base/WebSocket.cpp
rename : content/base/src/WebSocket.h => dom/base/WebSocket.h
rename : content/base/src/contentAreaDropListener.js => dom/base/contentAreaDropListener.js
rename : content/base/src/contentAreaDropListener.manifest => dom/base/contentAreaDropListener.manifest
rename : content/base/crashtests/1024428-1.html => dom/base/crashtests/1024428-1.html
rename : content/base/crashtests/1026714.html => dom/base/crashtests/1026714.html
rename : content/base/crashtests/1027461-1.html => dom/base/crashtests/1027461-1.html
rename : content/base/crashtests/1027461-inner.xul => dom/base/crashtests/1027461-inner.xul
rename : content/base/crashtests/116848-1.html => dom/base/crashtests/116848-1.html
rename : content/base/crashtests/149320-1.html => dom/base/crashtests/149320-1.html
rename : content/base/crashtests/205225-1.html => dom/base/crashtests/205225-1.html
rename : content/base/crashtests/231475-1.html => dom/base/crashtests/231475-1.html
rename : content/base/crashtests/293388-1.html => dom/base/crashtests/293388-1.html
rename : content/base/crashtests/308120-1.xul => dom/base/crashtests/308120-1.xul
rename : content/base/crashtests/324871-1.html => dom/base/crashtests/324871-1.html
rename : content/base/crashtests/325730-1.html => dom/base/crashtests/325730-1.html
rename : content/base/crashtests/326618-1.html => dom/base/crashtests/326618-1.html
rename : content/base/crashtests/326646-1.html => dom/base/crashtests/326646-1.html
rename : content/base/crashtests/326778-1.xul => dom/base/crashtests/326778-1.xul
rename : content/base/crashtests/326865-1.html => dom/base/crashtests/326865-1.html
rename : content/base/crashtests/327694.html => dom/base/crashtests/327694.html
rename : content/base/crashtests/330925-1.xhtml => dom/base/crashtests/330925-1.xhtml
rename : content/base/crashtests/336381-1.xhtml => dom/base/crashtests/336381-1.xhtml
rename : content/base/crashtests/336715-1.xhtml => dom/base/crashtests/336715-1.xhtml
rename : content/base/crashtests/338391-1.xhtml => dom/base/crashtests/338391-1.xhtml
rename : content/base/crashtests/340733-1.html => dom/base/crashtests/340733-1.html
rename : content/base/crashtests/343730-1.xhtml => dom/base/crashtests/343730-1.xhtml
rename : content/base/crashtests/343850-1.xhtml => dom/base/crashtests/343850-1.xhtml
rename : content/base/crashtests/343889-1.html => dom/base/crashtests/343889-1.html
rename : content/base/crashtests/344434-1.xhtml => dom/base/crashtests/344434-1.xhtml
rename : content/base/crashtests/344882-1.html => dom/base/crashtests/344882-1.html
rename : content/base/crashtests/345837-1.xhtml => dom/base/crashtests/345837-1.xhtml
rename : content/base/crashtests/348049-1.xhtml => dom/base/crashtests/348049-1.xhtml
rename : content/base/crashtests/349355-1.html => dom/base/crashtests/349355-1.html
rename : content/base/crashtests/354645-1.xul => dom/base/crashtests/354645-1.xul
rename : content/base/crashtests/360599-1.html => dom/base/crashtests/360599-1.html
rename : content/base/crashtests/366200-1.xhtml => dom/base/crashtests/366200-1.xhtml
rename : content/base/crashtests/371466-1.xhtml => dom/base/crashtests/371466-1.xhtml
rename : content/base/crashtests/377360-1.xhtml => dom/base/crashtests/377360-1.xhtml
rename : content/base/crashtests/377960-1.html => dom/base/crashtests/377960-1.html
rename : content/base/crashtests/377960-2.html => dom/base/crashtests/377960-2.html
rename : content/base/crashtests/384663-1-inner.xul => dom/base/crashtests/384663-1-inner.xul
rename : content/base/crashtests/384663-1.html => dom/base/crashtests/384663-1.html
rename : content/base/crashtests/386000-1.html => dom/base/crashtests/386000-1.html
rename : content/base/crashtests/386794-1.html => dom/base/crashtests/386794-1.html
rename : content/base/crashtests/387460-1-inner.xhtml => dom/base/crashtests/387460-1-inner.xhtml
rename : content/base/crashtests/387460-1.html => dom/base/crashtests/387460-1.html
rename : content/base/crashtests/395469-1.xhtml => dom/base/crashtests/395469-1.xhtml
rename : content/base/crashtests/395469-2.xhtml => dom/base/crashtests/395469-2.xhtml
rename : content/base/crashtests/398088-1.xul => dom/base/crashtests/398088-1.xul
rename : content/base/crashtests/399712-1.html => dom/base/crashtests/399712-1.html
rename : content/base/crashtests/400763-1.html => dom/base/crashtests/400763-1.html
rename : content/base/crashtests/401993-1.html => dom/base/crashtests/401993-1.html
rename : content/base/crashtests/401993-1.xml => dom/base/crashtests/401993-1.xml
rename : content/base/crashtests/407818.html => dom/base/crashtests/407818.html
rename : content/base/crashtests/410860-1.xml => dom/base/crashtests/410860-1.xml
rename : content/base/crashtests/411882-1.xhtml => dom/base/crashtests/411882-1.xhtml
rename : content/base/crashtests/416734-1.html => dom/base/crashtests/416734-1.html
rename : content/base/crashtests/418928-1.html => dom/base/crashtests/418928-1.html
rename : content/base/crashtests/420620-1.html => dom/base/crashtests/420620-1.html
rename : content/base/crashtests/424276-1.html => dom/base/crashtests/424276-1.html
rename : content/base/crashtests/426987-1.html => dom/base/crashtests/426987-1.html
rename : content/base/crashtests/43040-1.html => dom/base/crashtests/43040-1.html
rename : content/base/crashtests/443538-1.svg => dom/base/crashtests/443538-1.svg
rename : content/base/crashtests/448615-1.html => dom/base/crashtests/448615-1.html
rename : content/base/crashtests/450383-1.html => dom/base/crashtests/450383-1.html
rename : content/base/crashtests/450385-1.html => dom/base/crashtests/450385-1.html
rename : content/base/crashtests/458637-1-inner.xhtml => dom/base/crashtests/458637-1-inner.xhtml
rename : content/base/crashtests/458637-1.html => dom/base/crashtests/458637-1.html
rename : content/base/crashtests/467392.html => dom/base/crashtests/467392.html
rename : content/base/crashtests/472593-1.html => dom/base/crashtests/472593-1.html
rename : content/base/crashtests/474041-1.svg => dom/base/crashtests/474041-1.svg
rename : content/base/crashtests/483818-1.html => dom/base/crashtests/483818-1.html
rename : content/base/crashtests/490760-1.xhtml => dom/base/crashtests/490760-1.xhtml
rename : content/base/crashtests/493281-1.html => dom/base/crashtests/493281-1.html
rename : content/base/crashtests/493281-2.html => dom/base/crashtests/493281-2.html
rename : content/base/crashtests/494810-1.html => dom/base/crashtests/494810-1.html
rename : content/base/crashtests/509536-1.html => dom/base/crashtests/509536-1.html
rename : content/base/crashtests/522516-1.html => dom/base/crashtests/522516-1.html
rename : content/base/crashtests/529670.html => dom/base/crashtests/529670.html
rename : content/base/crashtests/535926-1.html => dom/base/crashtests/535926-1.html
rename : content/base/crashtests/543645.html => dom/base/crashtests/543645.html
rename : content/base/crashtests/551631-1.html => dom/base/crashtests/551631-1.html
rename : content/base/crashtests/552651.html => dom/base/crashtests/552651.html
rename : content/base/crashtests/552651.xml => dom/base/crashtests/552651.xml
rename : content/base/crashtests/554230-1.xhtml => dom/base/crashtests/554230-1.xhtml
rename : content/base/crashtests/558973.html => dom/base/crashtests/558973.html
rename : content/base/crashtests/561981-1-iframe.xhtml => dom/base/crashtests/561981-1-iframe.xhtml
rename : content/base/crashtests/561981-1.html => dom/base/crashtests/561981-1.html
rename : content/base/crashtests/561981-2-iframe.xhtml => dom/base/crashtests/561981-2-iframe.xhtml
rename : content/base/crashtests/561981-2.html => dom/base/crashtests/561981-2.html
rename : content/base/crashtests/564079-1.html => dom/base/crashtests/564079-1.html
rename : content/base/crashtests/564114.html => dom/base/crashtests/564114.html
rename : content/base/crashtests/565125-1.html => dom/base/crashtests/565125-1.html
rename : content/base/crashtests/575462.svg => dom/base/crashtests/575462.svg
rename : content/base/crashtests/582601.html => dom/base/crashtests/582601.html
rename : content/base/crashtests/590395-1.html => dom/base/crashtests/590395-1.html
rename : content/base/crashtests/593302-1.html => dom/base/crashtests/593302-1.html
rename : content/base/crashtests/593302-2.html => dom/base/crashtests/593302-2.html
rename : content/base/crashtests/595606-1.html => dom/base/crashtests/595606-1.html
rename : content/base/crashtests/595606-2.html => dom/base/crashtests/595606-2.html
rename : content/base/crashtests/604262-1.html => dom/base/crashtests/604262-1.html
rename : content/base/crashtests/605672-1.svg => dom/base/crashtests/605672-1.svg
rename : content/base/crashtests/606729-1.html => dom/base/crashtests/606729-1.html
rename : content/base/crashtests/610571-1.html => dom/base/crashtests/610571-1.html
rename : content/base/crashtests/628599-1.html => dom/base/crashtests/628599-1.html
rename : content/base/crashtests/637214-1.svg => dom/base/crashtests/637214-1.svg
rename : content/base/crashtests/637214-2.svg => dom/base/crashtests/637214-2.svg
rename : content/base/crashtests/642022-1.html => dom/base/crashtests/642022-1.html
rename : content/base/crashtests/646184.html => dom/base/crashtests/646184.html
rename : content/base/crashtests/658845-1.svg => dom/base/crashtests/658845-1.svg
rename : content/base/crashtests/667336-1.html => dom/base/crashtests/667336-1.html
rename : content/base/crashtests/679459.html => dom/base/crashtests/679459.html
rename : content/base/crashtests/679689-1.html => dom/base/crashtests/679689-1.html
rename : content/base/crashtests/682463.html => dom/base/crashtests/682463.html
rename : content/base/crashtests/693212.xhtml => dom/base/crashtests/693212.xhtml
rename : content/base/crashtests/698974-1.html => dom/base/crashtests/698974-1.html
rename : content/base/crashtests/700090-1.html => dom/base/crashtests/700090-1.html
rename : content/base/crashtests/700090-2.html => dom/base/crashtests/700090-2.html
rename : content/base/crashtests/700512-worker.js => dom/base/crashtests/700512-worker.js
rename : content/base/crashtests/700512.html => dom/base/crashtests/700512.html
rename : content/base/crashtests/709384.html => dom/base/crashtests/709384.html
rename : content/base/crashtests/709954.html => dom/base/crashtests/709954.html
rename : content/base/crashtests/713417-2.html => dom/base/crashtests/713417-2.html
rename : content/base/crashtests/713417.html => dom/base/crashtests/713417.html
rename : content/base/crashtests/715056.html => dom/base/crashtests/715056.html
rename : content/base/crashtests/741163-1.html => dom/base/crashtests/741163-1.html
rename : content/base/crashtests/752226-1.html => dom/base/crashtests/752226-1.html
rename : content/base/crashtests/752226-2.html => dom/base/crashtests/752226-2.html
rename : content/base/crashtests/766426.html => dom/base/crashtests/766426.html
rename : content/base/crashtests/771639.html => dom/base/crashtests/771639.html
rename : content/base/crashtests/786854.html => dom/base/crashtests/786854.html
rename : content/base/crashtests/815043.html => dom/base/crashtests/815043.html
rename : content/base/crashtests/815276.html => dom/base/crashtests/815276.html
rename : content/base/crashtests/815477.html => dom/base/crashtests/815477.html
rename : content/base/crashtests/815500.html => dom/base/crashtests/815500.html
rename : content/base/crashtests/816253.html => dom/base/crashtests/816253.html
rename : content/base/crashtests/819014.html => dom/base/crashtests/819014.html
rename : content/base/crashtests/822691.html => dom/base/crashtests/822691.html
rename : content/base/crashtests/822723.html => dom/base/crashtests/822723.html
rename : content/base/crashtests/824719.html => dom/base/crashtests/824719.html
rename : content/base/crashtests/827190.html => dom/base/crashtests/827190.html
rename : content/base/crashtests/828054.html => dom/base/crashtests/828054.html
rename : content/base/crashtests/828903-iframe.html => dom/base/crashtests/828903-iframe.html
rename : content/base/crashtests/828903.html => dom/base/crashtests/828903.html
rename : content/base/crashtests/829428.html => dom/base/crashtests/829428.html
rename : content/base/crashtests/830098.html => dom/base/crashtests/830098.html
rename : content/base/crashtests/831287.html => dom/base/crashtests/831287.html
rename : content/base/crashtests/832644.html => dom/base/crashtests/832644.html
rename : content/base/crashtests/836890.html => dom/base/crashtests/836890.html
rename : content/base/crashtests/838489-1.html => dom/base/crashtests/838489-1.html
rename : content/base/crashtests/838489-2.html => dom/base/crashtests/838489-2.html
rename : content/base/crashtests/841205.html => dom/base/crashtests/841205.html
rename : content/base/crashtests/844404.html => dom/base/crashtests/844404.html
rename : content/base/crashtests/845093-1.html => dom/base/crashtests/845093-1.html
rename : content/base/crashtests/845093-2.html => dom/base/crashtests/845093-2.html
rename : content/base/crashtests/847127.html => dom/base/crashtests/847127.html
rename : content/base/crashtests/849601.html => dom/base/crashtests/849601.html
rename : content/base/crashtests/849727.html => dom/base/crashtests/849727.html
rename : content/base/crashtests/849732.html => dom/base/crashtests/849732.html
rename : content/base/crashtests/851353-1.html => dom/base/crashtests/851353-1.html
rename : content/base/crashtests/863950.html => dom/base/crashtests/863950.html
rename : content/base/crashtests/864448.html => dom/base/crashtests/864448.html
rename : content/base/crashtests/930250.html => dom/base/crashtests/930250.html
rename : content/base/crashtests/942979.html => dom/base/crashtests/942979.html
rename : content/base/crashtests/978646.html => dom/base/crashtests/978646.html
rename : content/base/crashtests/xhr_abortinprogress.html => dom/base/crashtests/xhr_abortinprogress.html
rename : content/base/crashtests/xhr_empty_datauri.html => dom/base/crashtests/xhr_empty_datauri.html
rename : content/base/crashtests/xhr_html_nullresponse.html => dom/base/crashtests/xhr_html_nullresponse.html
rename : content/base/src/messageWakeupService.js => dom/base/messageWakeupService.js
rename : content/base/src/messageWakeupService.manifest => dom/base/messageWakeupService.manifest
rename : content/base/src/mozAutoDocUpdate.h => dom/base/mozAutoDocUpdate.h
rename : content/base/public/mozFlushType.h => dom/base/mozFlushType.h
rename : content/base/src/nsAtomListUtils.cpp => dom/base/nsAtomListUtils.cpp
rename : content/base/src/nsAtomListUtils.h => dom/base/nsAtomListUtils.h
rename : content/base/src/nsAttrAndChildArray.cpp => dom/base/nsAttrAndChildArray.cpp
rename : content/base/src/nsAttrAndChildArray.h => dom/base/nsAttrAndChildArray.h
rename : content/base/src/nsAttrName.h => dom/base/nsAttrName.h
rename : content/base/src/nsAttrValue.cpp => dom/base/nsAttrValue.cpp
rename : content/base/src/nsAttrValue.h => dom/base/nsAttrValue.h
rename : content/base/src/nsAttrValueInlines.h => dom/base/nsAttrValueInlines.h
rename : content/base/src/nsAttrValueOrString.cpp => dom/base/nsAttrValueOrString.cpp
rename : content/base/src/nsAttrValueOrString.h => dom/base/nsAttrValueOrString.h
rename : content/base/src/nsCCUncollectableMarker.cpp => dom/base/nsCCUncollectableMarker.cpp
rename : content/base/src/nsCCUncollectableMarker.h => dom/base/nsCCUncollectableMarker.h
rename : content/base/src/nsCSPContext.cpp => dom/base/nsCSPContext.cpp
rename : content/base/src/nsCSPContext.h => dom/base/nsCSPContext.h
rename : content/base/src/nsCSPParser.cpp => dom/base/nsCSPParser.cpp
rename : content/base/src/nsCSPParser.h => dom/base/nsCSPParser.h
rename : content/base/src/nsCSPService.cpp => dom/base/nsCSPService.cpp
rename : content/base/src/nsCSPService.h => dom/base/nsCSPService.h
rename : content/base/src/nsCSPUtils.cpp => dom/base/nsCSPUtils.cpp
rename : content/base/src/nsCSPUtils.h => dom/base/nsCSPUtils.h
rename : content/base/public/nsCaseTreatment.h => dom/base/nsCaseTreatment.h
rename : content/base/src/nsContentAreaDragDrop.cpp => dom/base/nsContentAreaDragDrop.cpp
rename : content/base/src/nsContentAreaDragDrop.h => dom/base/nsContentAreaDragDrop.h
rename : content/base/public/nsContentCID.h => dom/base/nsContentCID.h
rename : content/base/public/nsContentCreatorFunctions.h => dom/base/nsContentCreatorFunctions.h
rename : content/base/src/nsContentIterator.cpp => dom/base/nsContentIterator.cpp
rename : content/base/src/nsContentList.cpp => dom/base/nsContentList.cpp
rename : content/base/src/nsContentList.h => dom/base/nsContentList.h
rename : content/base/src/nsContentListDeclarations.h => dom/base/nsContentListDeclarations.h
rename : content/base/src/nsContentPolicy.cpp => dom/base/nsContentPolicy.cpp
rename : content/base/src/nsContentPolicy.h => dom/base/nsContentPolicy.h
rename : content/base/public/nsContentPolicyUtils.h => dom/base/nsContentPolicyUtils.h
rename : content/base/src/nsContentSink.cpp => dom/base/nsContentSink.cpp
rename : content/base/src/nsContentSink.h => dom/base/nsContentSink.h
rename : content/base/public/nsContentTypeParser.h => dom/base/nsContentTypeParser.h
rename : content/base/src/nsContentUtils.cpp => dom/base/nsContentUtils.cpp
rename : content/base/public/nsContentUtils.h => dom/base/nsContentUtils.h
rename : content/base/src/nsCopySupport.cpp => dom/base/nsCopySupport.cpp
rename : content/base/public/nsCopySupport.h => dom/base/nsCopySupport.h
rename : content/base/src/nsCrossSiteListenerProxy.cpp => dom/base/nsCrossSiteListenerProxy.cpp
rename : content/base/src/nsCrossSiteListenerProxy.h => dom/base/nsCrossSiteListenerProxy.h
rename : content/base/src/nsDOMAttributeMap.cpp => dom/base/nsDOMAttributeMap.cpp
rename : content/base/src/nsDOMAttributeMap.h => dom/base/nsDOMAttributeMap.h
rename : content/base/src/nsDOMCaretPosition.cpp => dom/base/nsDOMCaretPosition.cpp
rename : content/base/src/nsDOMCaretPosition.h => dom/base/nsDOMCaretPosition.h
rename : content/base/src/nsDOMDataChannel.cpp => dom/base/nsDOMDataChannel.cpp
rename : content/base/src/nsDOMDataChannel.h => dom/base/nsDOMDataChannel.h
rename : content/base/src/nsDOMDataChannelDeclarations.h => dom/base/nsDOMDataChannelDeclarations.h
rename : content/base/src/nsDOMFileReader.cpp => dom/base/nsDOMFileReader.cpp
rename : content/base/src/nsDOMFileReader.h => dom/base/nsDOMFileReader.h
rename : content/base/src/nsDOMMutationObserver.cpp => dom/base/nsDOMMutationObserver.cpp
rename : content/base/src/nsDOMMutationObserver.h => dom/base/nsDOMMutationObserver.h
rename : content/base/src/nsDOMSerializer.cpp => dom/base/nsDOMSerializer.cpp
rename : content/base/src/nsDOMSerializer.h => dom/base/nsDOMSerializer.h
rename : content/base/src/nsDOMSettableTokenList.cpp => dom/base/nsDOMSettableTokenList.cpp
rename : content/base/src/nsDOMSettableTokenList.h => dom/base/nsDOMSettableTokenList.h
rename : content/base/src/nsDOMTokenList.cpp => dom/base/nsDOMTokenList.cpp
rename : content/base/src/nsDOMTokenList.h => dom/base/nsDOMTokenList.h
rename : content/base/src/nsDataDocumentContentPolicy.cpp => dom/base/nsDataDocumentContentPolicy.cpp
rename : content/base/src/nsDataDocumentContentPolicy.h => dom/base/nsDataDocumentContentPolicy.h
rename : content/base/public/nsDeprecatedOperationList.h => dom/base/nsDeprecatedOperationList.h
rename : content/base/public/nsDocElementCreatedNotificationRunner.h => dom/base/nsDocElementCreatedNotificationRunner.h
rename : content/base/src/nsDocument.cpp => dom/base/nsDocument.cpp
rename : content/base/src/nsDocument.h => dom/base/nsDocument.h
rename : content/base/src/nsDocumentEncoder.cpp => dom/base/nsDocumentEncoder.cpp
rename : content/base/src/nsElementFrameLoaderOwner.cpp => dom/base/nsElementFrameLoaderOwner.cpp
rename : content/base/src/nsElementFrameLoaderOwner.h => dom/base/nsElementFrameLoaderOwner.h
rename : content/base/src/nsFormData.cpp => dom/base/nsFormData.cpp
rename : content/base/src/nsFormData.h => dom/base/nsFormData.h
rename : content/base/src/nsFrameLoader.cpp => dom/base/nsFrameLoader.cpp
rename : content/base/src/nsFrameLoader.h => dom/base/nsFrameLoader.h
rename : content/base/src/nsFrameMessageManager.cpp => dom/base/nsFrameMessageManager.cpp
rename : content/base/src/nsFrameMessageManager.h => dom/base/nsFrameMessageManager.h
rename : content/base/src/nsGenConImageContent.cpp => dom/base/nsGenConImageContent.cpp
rename : content/base/src/nsGenericDOMDataNode.cpp => dom/base/nsGenericDOMDataNode.cpp
rename : content/base/src/nsGenericDOMDataNode.h => dom/base/nsGenericDOMDataNode.h
rename : content/base/src/nsGkAtomList.h => dom/base/nsGkAtomList.h
rename : content/base/src/nsGkAtoms.cpp => dom/base/nsGkAtoms.cpp
rename : content/base/src/nsGkAtoms.h => dom/base/nsGkAtoms.h
rename : content/base/src/nsHTMLContentSerializer.cpp => dom/base/nsHTMLContentSerializer.cpp
rename : content/base/src/nsHTMLContentSerializer.h => dom/base/nsHTMLContentSerializer.h
rename : content/base/src/nsHostObjectProtocolHandler.cpp => dom/base/nsHostObjectProtocolHandler.cpp
rename : content/base/public/nsHostObjectProtocolHandler.h => dom/base/nsHostObjectProtocolHandler.h
rename : content/base/src/nsHostObjectURI.cpp => dom/base/nsHostObjectURI.cpp
rename : content/base/src/nsHostObjectURI.h => dom/base/nsHostObjectURI.h
rename : content/base/public/nsIAttribute.h => dom/base/nsIAttribute.h
rename : content/base/public/nsIContent.h => dom/base/nsIContent.h
rename : content/base/public/nsIContentInlines.h => dom/base/nsIContentInlines.h
rename : content/base/public/nsIContentIterator.h => dom/base/nsIContentIterator.h
rename : content/base/public/nsIContentPolicy.idl => dom/base/nsIContentPolicy.idl
rename : content/base/public/nsIContentSecurityPolicy.idl => dom/base/nsIContentSecurityPolicy.idl
rename : content/base/public/nsIContentSerializer.h => dom/base/nsIContentSerializer.h
rename : content/base/public/nsIDOMDataChannel.idl => dom/base/nsIDOMDataChannel.idl
rename : content/base/public/nsIDOMFile.idl => dom/base/nsIDOMFile.idl
rename : content/base/public/nsIDOMFileList.idl => dom/base/nsIDOMFileList.idl
rename : content/base/public/nsIDOMFileReader.idl => dom/base/nsIDOMFileReader.idl
rename : content/base/public/nsIDOMFormData.idl => dom/base/nsIDOMFormData.idl
rename : content/base/public/nsIDOMParser.idl => dom/base/nsIDOMParser.idl
rename : content/base/public/nsIDOMSerializer.idl => dom/base/nsIDOMSerializer.idl
rename : content/base/public/nsIDocument.h => dom/base/nsIDocument.h
rename : content/base/public/nsIDocumentEncoder.idl => dom/base/nsIDocumentEncoder.idl
rename : content/base/public/nsIDocumentInlines.h => dom/base/nsIDocumentInlines.h
rename : content/base/public/nsIDocumentObserver.h => dom/base/nsIDocumentObserver.h
rename : content/base/public/nsIDroppedLinkHandler.idl => dom/base/nsIDroppedLinkHandler.idl
rename : content/base/public/nsIFrameLoader.idl => dom/base/nsIFrameLoader.idl
rename : content/base/public/nsIImageLoadingContent.idl => dom/base/nsIImageLoadingContent.idl
rename : content/base/public/nsIMessageManager.idl => dom/base/nsIMessageManager.idl
rename : content/base/public/nsIMutationObserver.h => dom/base/nsIMutationObserver.h
rename : content/base/src/nsINode.cpp => dom/base/nsINode.cpp
rename : content/base/public/nsINode.h => dom/base/nsINode.h
rename : content/base/public/nsINodeList.h => dom/base/nsINodeList.h
rename : content/base/public/nsIObjectLoadingContent.idl => dom/base/nsIObjectLoadingContent.idl
rename : content/base/public/nsIScriptElement.h => dom/base/nsIScriptElement.h
rename : content/base/public/nsIScriptLoaderObserver.idl => dom/base/nsIScriptLoaderObserver.idl
rename : content/base/public/nsISelection.idl => dom/base/nsISelection.idl
rename : content/base/public/nsISelectionController.idl => dom/base/nsISelectionController.idl
rename : content/base/public/nsISelectionDisplay.idl => dom/base/nsISelectionDisplay.idl
rename : content/base/public/nsISelectionListener.idl => dom/base/nsISelectionListener.idl
rename : content/base/public/nsISelectionPrivate.idl => dom/base/nsISelectionPrivate.idl
rename : content/base/public/nsIStyleSheetLinkingElement.h => dom/base/nsIStyleSheetLinkingElement.h
rename : content/base/public/nsIXMLHttpRequest.idl => dom/base/nsIXMLHttpRequest.idl
rename : content/base/src/nsImageLoadingContent.cpp => dom/base/nsImageLoadingContent.cpp
rename : content/base/src/nsImageLoadingContent.h => dom/base/nsImageLoadingContent.h
rename : content/base/src/nsInProcessTabChildGlobal.cpp => dom/base/nsInProcessTabChildGlobal.cpp
rename : content/base/src/nsInProcessTabChildGlobal.h => dom/base/nsInProcessTabChildGlobal.h
rename : content/base/src/nsLineBreaker.cpp => dom/base/nsLineBreaker.cpp
rename : content/base/public/nsLineBreaker.h => dom/base/nsLineBreaker.h
rename : content/base/src/nsMappedAttributeElement.cpp => dom/base/nsMappedAttributeElement.cpp
rename : content/base/src/nsMappedAttributeElement.h => dom/base/nsMappedAttributeElement.h
rename : content/base/src/nsMappedAttributes.cpp => dom/base/nsMappedAttributes.cpp
rename : content/base/src/nsMappedAttributes.h => dom/base/nsMappedAttributes.h
rename : content/base/src/nsMixedContentBlocker.cpp => dom/base/nsMixedContentBlocker.cpp
rename : content/base/src/nsMixedContentBlocker.h => dom/base/nsMixedContentBlocker.h
rename : content/base/src/nsNameSpaceManager.cpp => dom/base/nsNameSpaceManager.cpp
rename : content/base/public/nsNameSpaceManager.h => dom/base/nsNameSpaceManager.h
rename : content/base/src/nsNoDataProtocolContentPolicy.cpp => dom/base/nsNoDataProtocolContentPolicy.cpp
rename : content/base/src/nsNoDataProtocolContentPolicy.h => dom/base/nsNoDataProtocolContentPolicy.h
rename : content/base/src/nsNodeInfoManager.cpp => dom/base/nsNodeInfoManager.cpp
rename : content/base/src/nsNodeInfoManager.h => dom/base/nsNodeInfoManager.h
rename : content/base/src/nsNodeUtils.cpp => dom/base/nsNodeUtils.cpp
rename : content/base/src/nsNodeUtils.h => dom/base/nsNodeUtils.h
rename : content/base/src/nsObjectLoadingContent.cpp => dom/base/nsObjectLoadingContent.cpp
rename : content/base/src/nsObjectLoadingContent.h => dom/base/nsObjectLoadingContent.h
rename : content/base/src/nsPlainTextSerializer.cpp => dom/base/nsPlainTextSerializer.cpp
rename : content/base/src/nsPlainTextSerializer.h => dom/base/nsPlainTextSerializer.h
rename : content/base/src/nsPropertyTable.cpp => dom/base/nsPropertyTable.cpp
rename : content/base/src/nsPropertyTable.h => dom/base/nsPropertyTable.h
rename : content/base/src/nsRange.cpp => dom/base/nsRange.cpp
rename : content/base/src/nsRange.h => dom/base/nsRange.h
rename : content/base/src/nsReferencedElement.cpp => dom/base/nsReferencedElement.cpp
rename : content/base/public/nsReferencedElement.h => dom/base/nsReferencedElement.h
rename : content/base/src/nsSandboxFlags.h => dom/base/nsSandboxFlags.h
rename : content/base/src/nsScriptElement.cpp => dom/base/nsScriptElement.cpp
rename : content/base/src/nsScriptElement.h => dom/base/nsScriptElement.h
rename : content/base/src/nsScriptLoader.cpp => dom/base/nsScriptLoader.cpp
rename : content/base/src/nsScriptLoader.h => dom/base/nsScriptLoader.h
rename : content/base/src/nsStubDocumentObserver.cpp => dom/base/nsStubDocumentObserver.cpp
rename : content/base/src/nsStubDocumentObserver.h => dom/base/nsStubDocumentObserver.h
rename : content/base/src/nsStubMutationObserver.cpp => dom/base/nsStubMutationObserver.cpp
rename : content/base/src/nsStubMutationObserver.h => dom/base/nsStubMutationObserver.h
rename : content/base/src/nsStyleLinkElement.cpp => dom/base/nsStyleLinkElement.cpp
rename : content/base/src/nsStyleLinkElement.h => dom/base/nsStyleLinkElement.h
rename : content/base/src/nsStyledElement.cpp => dom/base/nsStyledElement.cpp
rename : content/base/src/nsStyledElement.h => dom/base/nsStyledElement.h
rename : content/base/src/nsSyncLoadService.cpp => dom/base/nsSyncLoadService.cpp
rename : content/base/src/nsSyncLoadService.h => dom/base/nsSyncLoadService.h
rename : content/base/src/nsTextFragment.cpp => dom/base/nsTextFragment.cpp
rename : content/base/src/nsTextFragment.h => dom/base/nsTextFragment.h
rename : content/base/src/nsTextFragmentImpl.h => dom/base/nsTextFragmentImpl.h
rename : content/base/src/nsTextFragmentSSE2.cpp => dom/base/nsTextFragmentSSE2.cpp
rename : content/base/src/nsTextNode.cpp => dom/base/nsTextNode.cpp
rename : content/base/src/nsTextNode.h => dom/base/nsTextNode.h
rename : content/base/src/nsTraversal.cpp => dom/base/nsTraversal.cpp
rename : content/base/src/nsTraversal.h => dom/base/nsTraversal.h
rename : content/base/src/nsTreeSanitizer.cpp => dom/base/nsTreeSanitizer.cpp
rename : content/base/public/nsTreeSanitizer.h => dom/base/nsTreeSanitizer.h
rename : content/base/src/nsViewportInfo.cpp => dom/base/nsViewportInfo.cpp
rename : content/base/public/nsViewportInfo.h => dom/base/nsViewportInfo.h
rename : content/base/src/nsXHTMLContentSerializer.cpp => dom/base/nsXHTMLContentSerializer.cpp
rename : content/base/src/nsXHTMLContentSerializer.h => dom/base/nsXHTMLContentSerializer.h
rename : content/base/src/nsXMLContentSerializer.cpp => dom/base/nsXMLContentSerializer.cpp
rename : content/base/src/nsXMLContentSerializer.h => dom/base/nsXMLContentSerializer.h
rename : content/base/src/nsXMLHttpRequest.cpp => dom/base/nsXMLHttpRequest.cpp
rename : content/base/src/nsXMLHttpRequest.h => dom/base/nsXMLHttpRequest.h
rename : content/base/src/nsXMLNameSpaceMap.cpp => dom/base/nsXMLNameSpaceMap.cpp
rename : content/base/public/nsXMLNameSpaceMap.h => dom/base/nsXMLNameSpaceMap.h
rename : content/base/test/345339_iframe.html => dom/base/test/345339_iframe.html
rename : content/base/test/Ahem.ttf => dom/base/test/Ahem.ttf
rename : content/base/test/TestCSPParser.cpp => dom/base/test/TestCSPParser.cpp
rename : content/base/test/TestGetURL.cpp => dom/base/test/TestGetURL.cpp
rename : content/base/test/TestNativeXMLHttpRequest.cpp => dom/base/test/TestNativeXMLHttpRequest.cpp
rename : content/base/test/TestPlainTextSerializer.cpp => dom/base/test/TestPlainTextSerializer.cpp
rename : content/base/test/accesscontrol.resource => dom/base/test/accesscontrol.resource
rename : content/base/test/accesscontrol.resource^headers^ => dom/base/test/accesscontrol.resource^headers^
rename : content/base/test/badContentType.eventsource => dom/base/test/badContentType.eventsource
rename : content/base/test/badContentType.eventsource^headers^ => dom/base/test/badContentType.eventsource^headers^
rename : content/base/test/badHTTPResponseCode.eventsource => dom/base/test/badHTTPResponseCode.eventsource
rename : content/base/test/badHTTPResponseCode.eventsource^headers^ => dom/base/test/badHTTPResponseCode.eventsource^headers^
rename : content/base/test/badMessageEvent.eventsource => dom/base/test/badMessageEvent.eventsource
rename : content/base/test/badMessageEvent.eventsource^headers^ => dom/base/test/badMessageEvent.eventsource^headers^
rename : content/base/test/badMessageEvent2.eventsource => dom/base/test/badMessageEvent2.eventsource
rename : content/base/test/badMessageEvent2.eventsource^headers^ => dom/base/test/badMessageEvent2.eventsource^headers^
rename : content/base/test/browser.ini => dom/base/test/browser.ini
rename : content/base/test/browser_bug1058164.js => dom/base/test/browser_bug1058164.js
rename : content/base/test/browser_bug593387.js => dom/base/test/browser_bug593387.js
rename : content/base/test/browser_bug902350.js => dom/base/test/browser_bug902350.js
rename : content/base/test/browser_state_notifications.js => dom/base/test/browser_state_notifications.js
rename : content/base/test/bug282547.sjs => dom/base/test/bug282547.sjs
rename : content/base/test/bug298064-subframe.html => dom/base/test/bug298064-subframe.html
rename : content/base/test/bug313646.txt => dom/base/test/bug313646.txt
rename : content/base/test/bug382113_object.html => dom/base/test/bug382113_object.html
rename : content/base/test/bug419132.html => dom/base/test/bug419132.html
rename : content/base/test/bug426308-redirect.sjs => dom/base/test/bug426308-redirect.sjs
rename : content/base/test/bug435425.sjs => dom/base/test/bug435425.sjs
rename : content/base/test/bug435425_redirect.sjs => dom/base/test/bug435425_redirect.sjs
rename : content/base/test/bug444322.js => dom/base/test/bug444322.js
rename : content/base/test/bug444322.txt => dom/base/test/bug444322.txt
rename : content/base/test/bug444546.sjs => dom/base/test/bug444546.sjs
rename : content/base/test/bug455629-helper.svg => dom/base/test/bug455629-helper.svg
rename : content/base/test/bug457746.sjs => dom/base/test/bug457746.sjs
rename : content/base/test/bug461735-post-redirect.js => dom/base/test/bug461735-post-redirect.js
rename : content/base/test/bug461735-redirect1.sjs => dom/base/test/bug461735-redirect1.sjs
rename : content/base/test/bug461735-redirect2.sjs => dom/base/test/bug461735-redirect2.sjs
rename : content/base/test/bug466080.sjs => dom/base/test/bug466080.sjs
rename : content/base/test/bug466409-empty.css => dom/base/test/bug466409-empty.css
rename : content/base/test/bug466409-page.html => dom/base/test/bug466409-page.html
rename : content/base/test/bug475156.sjs => dom/base/test/bug475156.sjs
rename : content/base/test/bug482935.sjs => dom/base/test/bug482935.sjs
rename : content/base/test/bug540854.sjs => dom/base/test/bug540854.sjs
rename : content/base/test/bug578096LoadChromeScript.js => dom/base/test/bug578096LoadChromeScript.js
rename : content/base/test/bug638112-response.txt => dom/base/test/bug638112-response.txt
rename : content/base/test/bug638112.sjs => dom/base/test/bug638112.sjs
rename : content/base/test/bug682592-subframe-ref.html => dom/base/test/bug682592-subframe-ref.html
rename : content/base/test/bug682592-subframe.html => dom/base/test/bug682592-subframe.html
rename : content/base/test/bug696301-script-1.js => dom/base/test/bug696301-script-1.js
rename : content/base/test/bug696301-script-1.js^headers^ => dom/base/test/bug696301-script-1.js^headers^
rename : content/base/test/bug696301-script-2.js => dom/base/test/bug696301-script-2.js
rename : content/base/test/bug803225_test_mailto.html => dom/base/test/bug803225_test_mailto.html
rename : content/base/test/bug819051.sjs => dom/base/test/bug819051.sjs
rename : content/base/test/chrome/blockNoPlugins.xml => dom/base/test/chrome/blockNoPlugins.xml
rename : content/base/test/chrome/blockPluginHard.xml => dom/base/test/chrome/blockPluginHard.xml
rename : content/base/test/chrome/bug421622-referer.sjs => dom/base/test/chrome/bug421622-referer.sjs
rename : content/base/test/chrome/chrome.ini => dom/base/test/chrome/chrome.ini
rename : content/base/test/chrome/cpows_child.js => dom/base/test/chrome/cpows_child.js
rename : content/base/test/chrome/cpows_parent.xul => dom/base/test/chrome/cpows_parent.xul
rename : content/base/test/chrome/file_bug391728.html => dom/base/test/chrome/file_bug391728.html
rename : content/base/test/chrome/file_bug391728_2.html => dom/base/test/chrome/file_bug391728_2.html
rename : content/base/test/chrome/file_bug549682.xul => dom/base/test/chrome/file_bug549682.xul
rename : content/base/test/chrome/file_bug616841.xul => dom/base/test/chrome/file_bug616841.xul
rename : content/base/test/chrome/file_bug816340.xul => dom/base/test/chrome/file_bug816340.xul
rename : content/base/test/chrome/file_bug990812-1.xul => dom/base/test/chrome/file_bug990812-1.xul
rename : content/base/test/chrome/file_bug990812-2.xul => dom/base/test/chrome/file_bug990812-2.xul
rename : content/base/test/chrome/file_bug990812-3.xul => dom/base/test/chrome/file_bug990812-3.xul
rename : content/base/test/chrome/file_bug990812-4.xul => dom/base/test/chrome/file_bug990812-4.xul
rename : content/base/test/chrome/file_bug990812-5.xul => dom/base/test/chrome/file_bug990812-5.xul
rename : content/base/test/chrome/file_bug990812.xul => dom/base/test/chrome/file_bug990812.xul
rename : content/base/test/chrome/fileconstructor_file.png => dom/base/test/chrome/fileconstructor_file.png
rename : content/base/test/chrome/frame_bug814638.xul => dom/base/test/chrome/frame_bug814638.xul
rename : content/base/test/chrome/host_bug814638.xul => dom/base/test/chrome/host_bug814638.xul
rename : content/base/test/chrome/mochitest.ini => dom/base/test/chrome/mochitest.ini
rename : content/base/test/chrome/nochrome_bug765993.html => dom/base/test/chrome/nochrome_bug765993.html
rename : content/base/test/chrome/nochrome_bug765993.js => dom/base/test/chrome/nochrome_bug765993.js
rename : content/base/test/chrome/nochrome_bug765993.js^headers^ => dom/base/test/chrome/nochrome_bug765993.js^headers^
rename : content/base/test/chrome/test_bug1063837.xul => dom/base/test/chrome/test_bug1063837.xul
rename : content/base/test/chrome/test_bug206691.xul => dom/base/test/chrome/test_bug206691.xul
rename : content/base/test/chrome/test_bug339494.xul => dom/base/test/chrome/test_bug339494.xul
rename : content/base/test/chrome/test_bug357450.xul => dom/base/test/chrome/test_bug357450.xul
rename : content/base/test/chrome/test_bug380418.html => dom/base/test/chrome/test_bug380418.html
rename : content/base/test/chrome/test_bug380418.html^headers^ => dom/base/test/chrome/test_bug380418.html^headers^
rename : content/base/test/chrome/test_bug383430.html => dom/base/test/chrome/test_bug383430.html
rename : content/base/test/chrome/test_bug391728.html => dom/base/test/chrome/test_bug391728.html
rename : content/base/test/chrome/test_bug421622.xul => dom/base/test/chrome/test_bug421622.xul
rename : content/base/test/chrome/test_bug429785.xul => dom/base/test/chrome/test_bug429785.xul
rename : content/base/test/chrome/test_bug430050.xul => dom/base/test/chrome/test_bug430050.xul
rename : content/base/test/chrome/test_bug467123.xul => dom/base/test/chrome/test_bug467123.xul
rename : content/base/test/chrome/test_bug549682.xul => dom/base/test/chrome/test_bug549682.xul
rename : content/base/test/chrome/test_bug571390.xul => dom/base/test/chrome/test_bug571390.xul
rename : content/base/test/chrome/test_bug574596.html => dom/base/test/chrome/test_bug574596.html
rename : content/base/test/chrome/test_bug599295.html => dom/base/test/chrome/test_bug599295.html
rename : content/base/test/chrome/test_bug616841.xul => dom/base/test/chrome/test_bug616841.xul
rename : content/base/test/chrome/test_bug635835.xul => dom/base/test/chrome/test_bug635835.xul
rename : content/base/test/chrome/test_bug650776.html => dom/base/test/chrome/test_bug650776.html
rename : content/base/test/chrome/test_bug650784.html => dom/base/test/chrome/test_bug650784.html
rename : content/base/test/chrome/test_bug682305.html => dom/base/test/chrome/test_bug682305.html
rename : content/base/test/chrome/test_bug683852.xul => dom/base/test/chrome/test_bug683852.xul
rename : content/base/test/chrome/test_bug750096.html => dom/base/test/chrome/test_bug750096.html
rename : content/base/test/chrome/test_bug752226-3.xul => dom/base/test/chrome/test_bug752226-3.xul
rename : content/base/test/chrome/test_bug752226-4.xul => dom/base/test/chrome/test_bug752226-4.xul
rename : content/base/test/chrome/test_bug765993.html => dom/base/test/chrome/test_bug765993.html
rename : content/base/test/chrome/test_bug780199.xul => dom/base/test/chrome/test_bug780199.xul
rename : content/base/test/chrome/test_bug780529.xul => dom/base/test/chrome/test_bug780529.xul
rename : content/base/test/chrome/test_bug800386.xul => dom/base/test/chrome/test_bug800386.xul
rename : content/base/test/chrome/test_bug814638.xul => dom/base/test/chrome/test_bug814638.xul
rename : content/base/test/chrome/test_bug816340.xul => dom/base/test/chrome/test_bug816340.xul
rename : content/base/test/chrome/test_bug914381.html => dom/base/test/chrome/test_bug914381.html
rename : content/base/test/chrome/test_bug990812.xul => dom/base/test/chrome/test_bug990812.xul
rename : content/base/test/chrome/test_cpows.xul => dom/base/test/chrome/test_cpows.xul
rename : content/base/test/chrome/test_document_register.xul => dom/base/test/chrome/test_document_register.xul
rename : content/base/test/chrome/test_domparsing.xul => dom/base/test/chrome/test_domparsing.xul
rename : content/base/test/chrome/test_fileconstructor.xul => dom/base/test/chrome/test_fileconstructor.xul
rename : content/base/test/chrome/test_fileconstructor_tempfile.xul => dom/base/test/chrome/test_fileconstructor_tempfile.xul
rename : content/base/test/chrome/test_title.xul => dom/base/test/chrome/test_title.xul
rename : content/base/test/chrome/title_window.xul => dom/base/test/chrome/title_window.xul
rename : content/base/test/copypaste.js => dom/base/test/copypaste.js
rename : content/base/test/csp/chrome.ini => dom/base/test/csp/chrome.ini
rename : content/base/test/csp/file_CSP.css => dom/base/test/csp/file_CSP.css
rename : content/base/test/csp/file_CSP.sjs => dom/base/test/csp/file_CSP.sjs
rename : content/base/test/csp/file_CSP_bug663567.xsl => dom/base/test/csp/file_CSP_bug663567.xsl
rename : content/base/test/csp/file_CSP_bug663567_allows.xml => dom/base/test/csp/file_CSP_bug663567_allows.xml
rename : content/base/test/csp/file_CSP_bug663567_allows.xml^headers^ => dom/base/test/csp/file_CSP_bug663567_allows.xml^headers^
rename : content/base/test/csp/file_CSP_bug663567_blocks.xml => dom/base/test/csp/file_CSP_bug663567_blocks.xml
rename : content/base/test/csp/file_CSP_bug663567_blocks.xml^headers^ => dom/base/test/csp/file_CSP_bug663567_blocks.xml^headers^
rename : content/base/test/csp/file_CSP_bug802872.html => dom/base/test/csp/file_CSP_bug802872.html
rename : content/base/test/csp/file_CSP_bug802872.html^headers^ => dom/base/test/csp/file_CSP_bug802872.html^headers^
rename : content/base/test/csp/file_CSP_bug802872.js => dom/base/test/csp/file_CSP_bug802872.js
rename : content/base/test/csp/file_CSP_bug802872.sjs => dom/base/test/csp/file_CSP_bug802872.sjs
rename : content/base/test/csp/file_CSP_bug885433_allows.html => dom/base/test/csp/file_CSP_bug885433_allows.html
rename : content/base/test/csp/file_CSP_bug885433_allows.html^headers^ => dom/base/test/csp/file_CSP_bug885433_allows.html^headers^
rename : content/base/test/csp/file_CSP_bug885433_blocks.html => dom/base/test/csp/file_CSP_bug885433_blocks.html
rename : content/base/test/csp/file_CSP_bug885433_blocks.html^headers^ => dom/base/test/csp/file_CSP_bug885433_blocks.html^headers^
rename : content/base/test/csp/file_CSP_bug888172.html => dom/base/test/csp/file_CSP_bug888172.html
rename : content/base/test/csp/file_CSP_bug888172.sjs => dom/base/test/csp/file_CSP_bug888172.sjs
rename : content/base/test/csp/file_CSP_bug909029_none.html => dom/base/test/csp/file_CSP_bug909029_none.html
rename : content/base/test/csp/file_CSP_bug909029_none.html^headers^ => dom/base/test/csp/file_CSP_bug909029_none.html^headers^
rename : content/base/test/csp/file_CSP_bug909029_star.html => dom/base/test/csp/file_CSP_bug909029_star.html
rename : content/base/test/csp/file_CSP_bug909029_star.html^headers^ => dom/base/test/csp/file_CSP_bug909029_star.html^headers^
rename : content/base/test/csp/file_CSP_bug910139.sjs => dom/base/test/csp/file_CSP_bug910139.sjs
rename : content/base/test/csp/file_CSP_bug910139.xml => dom/base/test/csp/file_CSP_bug910139.xml
rename : content/base/test/csp/file_CSP_bug910139.xsl => dom/base/test/csp/file_CSP_bug910139.xsl
rename : content/base/test/csp/file_CSP_bug941404.html => dom/base/test/csp/file_CSP_bug941404.html
rename : content/base/test/csp/file_CSP_bug941404_xhr.html => dom/base/test/csp/file_CSP_bug941404_xhr.html
rename : content/base/test/csp/file_CSP_bug941404_xhr.html^headers^ => dom/base/test/csp/file_CSP_bug941404_xhr.html^headers^
rename : content/base/test/csp/file_CSP_evalscript_main.html => dom/base/test/csp/file_CSP_evalscript_main.html
rename : content/base/test/csp/file_CSP_evalscript_main.html^headers^ => dom/base/test/csp/file_CSP_evalscript_main.html^headers^
rename : content/base/test/csp/file_CSP_evalscript_main.js => dom/base/test/csp/file_CSP_evalscript_main.js
rename : content/base/test/csp/file_CSP_evalscript_main_allowed.html => dom/base/test/csp/file_CSP_evalscript_main_allowed.html
rename : content/base/test/csp/file_CSP_evalscript_main_allowed.html^headers^ => dom/base/test/csp/file_CSP_evalscript_main_allowed.html^headers^
rename : content/base/test/csp/file_CSP_evalscript_main_allowed.js => dom/base/test/csp/file_CSP_evalscript_main_allowed.js
rename : content/base/test/csp/file_CSP_frameancestors.sjs => dom/base/test/csp/file_CSP_frameancestors.sjs
rename : content/base/test/csp/file_CSP_frameancestors_main.html => dom/base/test/csp/file_CSP_frameancestors_main.html
rename : content/base/test/csp/file_CSP_frameancestors_main.js => dom/base/test/csp/file_CSP_frameancestors_main.js
rename : content/base/test/csp/file_CSP_inlinescript_main.html => dom/base/test/csp/file_CSP_inlinescript_main.html
rename : content/base/test/csp/file_CSP_inlinescript_main.html^headers^ => dom/base/test/csp/file_CSP_inlinescript_main.html^headers^
rename : content/base/test/csp/file_CSP_inlinescript_main_allowed.html => dom/base/test/csp/file_CSP_inlinescript_main_allowed.html
rename : content/base/test/csp/file_CSP_inlinescript_main_allowed.html^headers^ => dom/base/test/csp/file_CSP_inlinescript_main_allowed.html^headers^
rename : content/base/test/csp/file_CSP_inlinestyle_main.html => dom/base/test/csp/file_CSP_inlinestyle_main.html
rename : content/base/test/csp/file_CSP_inlinestyle_main.html^headers^ => dom/base/test/csp/file_CSP_inlinestyle_main.html^headers^
rename : content/base/test/csp/file_CSP_inlinestyle_main_allowed.html => dom/base/test/csp/file_CSP_inlinestyle_main_allowed.html
rename : content/base/test/csp/file_CSP_inlinestyle_main_allowed.html^headers^ => dom/base/test/csp/file_CSP_inlinestyle_main_allowed.html^headers^
rename : content/base/test/csp/file_CSP_main.html => dom/base/test/csp/file_CSP_main.html
rename : content/base/test/csp/file_CSP_main.html^headers^ => dom/base/test/csp/file_CSP_main.html^headers^
rename : content/base/test/csp/file_CSP_main.js => dom/base/test/csp/file_CSP_main.js
rename : content/base/test/csp/file_base-uri.html => dom/base/test/csp/file_base-uri.html
rename : content/base/test/csp/file_bug836922_npolicies.html => dom/base/test/csp/file_bug836922_npolicies.html
rename : content/base/test/csp/file_bug836922_npolicies.html^headers^ => dom/base/test/csp/file_bug836922_npolicies.html^headers^
rename : content/base/test/csp/file_bug836922_npolicies_ro_violation.sjs => dom/base/test/csp/file_bug836922_npolicies_ro_violation.sjs
rename : content/base/test/csp/file_bug836922_npolicies_violation.sjs => dom/base/test/csp/file_bug836922_npolicies_violation.sjs
rename : content/base/test/csp/file_bug886164.html => dom/base/test/csp/file_bug886164.html
rename : content/base/test/csp/file_bug886164.html^headers^ => dom/base/test/csp/file_bug886164.html^headers^
rename : content/base/test/csp/file_bug886164_2.html => dom/base/test/csp/file_bug886164_2.html
rename : content/base/test/csp/file_bug886164_2.html^headers^ => dom/base/test/csp/file_bug886164_2.html^headers^
rename : content/base/test/csp/file_bug886164_3.html => dom/base/test/csp/file_bug886164_3.html
rename : content/base/test/csp/file_bug886164_3.html^headers^ => dom/base/test/csp/file_bug886164_3.html^headers^
rename : content/base/test/csp/file_bug886164_4.html => dom/base/test/csp/file_bug886164_4.html
rename : content/base/test/csp/file_bug886164_4.html^headers^ => dom/base/test/csp/file_bug886164_4.html^headers^
rename : content/base/test/csp/file_bug886164_5.html => dom/base/test/csp/file_bug886164_5.html
rename : content/base/test/csp/file_bug886164_5.html^headers^ => dom/base/test/csp/file_bug886164_5.html^headers^
rename : content/base/test/csp/file_bug886164_6.html => dom/base/test/csp/file_bug886164_6.html
rename : content/base/test/csp/file_bug886164_6.html^headers^ => dom/base/test/csp/file_bug886164_6.html^headers^
rename : content/base/test/csp/file_connect-src.html => dom/base/test/csp/file_connect-src.html
rename : content/base/test/csp/file_csp_bug768029.html => dom/base/test/csp/file_csp_bug768029.html
rename : content/base/test/csp/file_csp_bug768029.sjs => dom/base/test/csp/file_csp_bug768029.sjs
rename : content/base/test/csp/file_csp_bug773891.html => dom/base/test/csp/file_csp_bug773891.html
rename : content/base/test/csp/file_csp_bug773891.sjs => dom/base/test/csp/file_csp_bug773891.sjs
rename : content/base/test/csp/file_csp_invalid_source_expression.html => dom/base/test/csp/file_csp_invalid_source_expression.html
rename : content/base/test/csp/file_csp_path_matching.html => dom/base/test/csp/file_csp_path_matching.html
rename : content/base/test/csp/file_csp_path_matching.js => dom/base/test/csp/file_csp_path_matching.js
rename : content/base/test/csp/file_csp_path_matching_redirect.html => dom/base/test/csp/file_csp_path_matching_redirect.html
rename : content/base/test/csp/file_csp_path_matching_redirect_server.sjs => dom/base/test/csp/file_csp_path_matching_redirect_server.sjs
rename : content/base/test/csp/file_csp_redirects_main.html => dom/base/test/csp/file_csp_redirects_main.html
rename : content/base/test/csp/file_csp_redirects_page.sjs => dom/base/test/csp/file_csp_redirects_page.sjs
rename : content/base/test/csp/file_csp_redirects_resource.sjs => dom/base/test/csp/file_csp_redirects_resource.sjs
rename : content/base/test/csp/file_csp_report.html => dom/base/test/csp/file_csp_report.html
rename : content/base/test/csp/file_csp_testserver.sjs => dom/base/test/csp/file_csp_testserver.sjs
rename : content/base/test/csp/file_hash_source.html => dom/base/test/csp/file_hash_source.html
rename : content/base/test/csp/file_hash_source.html^headers^ => dom/base/test/csp/file_hash_source.html^headers^
rename : content/base/test/csp/file_leading_wildcard.html => dom/base/test/csp/file_leading_wildcard.html
rename : content/base/test/csp/file_multi_policy_injection_bypass.html => dom/base/test/csp/file_multi_policy_injection_bypass.html
rename : content/base/test/csp/file_multi_policy_injection_bypass.html^headers^ => dom/base/test/csp/file_multi_policy_injection_bypass.html^headers^
rename : content/base/test/csp/file_multi_policy_injection_bypass_2.html => dom/base/test/csp/file_multi_policy_injection_bypass_2.html
rename : content/base/test/csp/file_multi_policy_injection_bypass_2.html^headers^ => dom/base/test/csp/file_multi_policy_injection_bypass_2.html^headers^
rename : content/base/test/csp/file_nonce_source.html => dom/base/test/csp/file_nonce_source.html
rename : content/base/test/csp/file_nonce_source.html^headers^ => dom/base/test/csp/file_nonce_source.html^headers^
rename : content/base/test/csp/file_policyuri_regression_from_multipolicy.html => dom/base/test/csp/file_policyuri_regression_from_multipolicy.html
rename : content/base/test/csp/file_policyuri_regression_from_multipolicy.html^headers^ => dom/base/test/csp/file_policyuri_regression_from_multipolicy.html^headers^
rename : content/base/test/csp/file_policyuri_regression_from_multipolicy_policy => dom/base/test/csp/file_policyuri_regression_from_multipolicy_policy
rename : content/base/test/csp/file_redirect_content.sjs => dom/base/test/csp/file_redirect_content.sjs
rename : content/base/test/csp/file_redirect_report.sjs => dom/base/test/csp/file_redirect_report.sjs
rename : content/base/test/csp/file_report_uri_missing_in_report_only_header.html => dom/base/test/csp/file_report_uri_missing_in_report_only_header.html
rename : content/base/test/csp/file_report_uri_missing_in_report_only_header.html^headers^ => dom/base/test/csp/file_report_uri_missing_in_report_only_header.html^headers^
rename : content/base/test/csp/file_self_none_as_hostname_confusion.html => dom/base/test/csp/file_self_none_as_hostname_confusion.html
rename : content/base/test/csp/file_self_none_as_hostname_confusion.html^headers^ => dom/base/test/csp/file_self_none_as_hostname_confusion.html^headers^
rename : content/base/test/csp/file_subframe_run_js_if_allowed.html => dom/base/test/csp/file_subframe_run_js_if_allowed.html
rename : content/base/test/csp/file_subframe_run_js_if_allowed.html^headers^ => dom/base/test/csp/file_subframe_run_js_if_allowed.html^headers^
rename : content/base/test/csp/mochitest.ini => dom/base/test/csp/mochitest.ini
rename : content/base/test/csp/test_301_redirect.html => dom/base/test/csp/test_301_redirect.html
rename : content/base/test/csp/test_302_redirect.html => dom/base/test/csp/test_302_redirect.html
rename : content/base/test/csp/test_303_redirect.html => dom/base/test/csp/test_303_redirect.html
rename : content/base/test/csp/test_307_redirect.html => dom/base/test/csp/test_307_redirect.html
rename : content/base/test/csp/test_CSP.html => dom/base/test/csp/test_CSP.html
rename : content/base/test/csp/test_CSP_bug663567.html => dom/base/test/csp/test_CSP_bug663567.html
rename : content/base/test/csp/test_CSP_bug802872.html => dom/base/test/csp/test_CSP_bug802872.html
rename : content/base/test/csp/test_CSP_bug885433.html => dom/base/test/csp/test_CSP_bug885433.html
rename : content/base/test/csp/test_CSP_bug888172.html => dom/base/test/csp/test_CSP_bug888172.html
rename : content/base/test/csp/test_CSP_bug909029.html => dom/base/test/csp/test_CSP_bug909029.html
rename : content/base/test/csp/test_CSP_bug910139.html => dom/base/test/csp/test_CSP_bug910139.html
rename : content/base/test/csp/test_CSP_bug941404.html => dom/base/test/csp/test_CSP_bug941404.html
rename : content/base/test/csp/test_CSP_evalscript.html => dom/base/test/csp/test_CSP_evalscript.html
rename : content/base/test/csp/test_CSP_frameancestors.html => dom/base/test/csp/test_CSP_frameancestors.html
rename : content/base/test/csp/test_CSP_inlinescript.html => dom/base/test/csp/test_CSP_inlinescript.html
rename : content/base/test/csp/test_CSP_inlinestyle.html => dom/base/test/csp/test_CSP_inlinestyle.html
rename : content/base/test/csp/test_base-uri.html => dom/base/test/csp/test_base-uri.html
rename : content/base/test/csp/test_bug836922_npolicies.html => dom/base/test/csp/test_bug836922_npolicies.html
rename : content/base/test/csp/test_bug886164.html => dom/base/test/csp/test_bug886164.html
rename : content/base/test/csp/test_bug949549.html => dom/base/test/csp/test_bug949549.html
rename : content/base/test/csp/test_connect-src.html => dom/base/test/csp/test_connect-src.html
rename : content/base/test/csp/test_csp_bug768029.html => dom/base/test/csp/test_csp_bug768029.html
rename : content/base/test/csp/test_csp_bug773891.html => dom/base/test/csp/test_csp_bug773891.html
rename : content/base/test/csp/test_csp_invalid_source_expression.html => dom/base/test/csp/test_csp_invalid_source_expression.html
rename : content/base/test/csp/test_csp_path_matching.html => dom/base/test/csp/test_csp_path_matching.html
rename : content/base/test/csp/test_csp_path_matching_redirect.html => dom/base/test/csp/test_csp_path_matching_redirect.html
rename : content/base/test/csp/test_csp_redirects.html => dom/base/test/csp/test_csp_redirects.html
rename : content/base/test/csp/test_csp_report.html => dom/base/test/csp/test_csp_report.html
rename : content/base/test/csp/test_hash_source.html => dom/base/test/csp/test_hash_source.html
rename : content/base/test/csp/test_leading_wildcard.html => dom/base/test/csp/test_leading_wildcard.html
rename : content/base/test/csp/test_multi_policy_injection_bypass.html => dom/base/test/csp/test_multi_policy_injection_bypass.html
rename : content/base/test/csp/test_nonce_source.html => dom/base/test/csp/test_nonce_source.html
rename : content/base/test/csp/test_policyuri_regression_from_multipolicy.html => dom/base/test/csp/test_policyuri_regression_from_multipolicy.html
rename : content/base/test/csp/test_report_uri_missing_in_report_only_header.html => dom/base/test/csp/test_report_uri_missing_in_report_only_header.html
rename : content/base/test/csp/test_self_none_as_hostname_confusion.html => dom/base/test/csp/test_self_none_as_hostname_confusion.html
rename : content/base/test/csp/test_subframe_run_js_if_allowed.html => dom/base/test/csp/test_subframe_run_js_if_allowed.html
rename : content/base/test/delayedServerEvents.sjs => dom/base/test/delayedServerEvents.sjs
rename : content/base/test/eventsource.resource => dom/base/test/eventsource.resource
rename : content/base/test/eventsource.resource^headers^ => dom/base/test/eventsource.resource^headers^
rename : content/base/test/eventsource_redirect.resource => dom/base/test/eventsource_redirect.resource
rename : content/base/test/eventsource_redirect.resource^headers^ => dom/base/test/eventsource_redirect.resource^headers^
rename : content/base/test/eventsource_redirect_to.resource => dom/base/test/eventsource_redirect_to.resource
rename : content/base/test/eventsource_redirect_to.resource^headers^ => dom/base/test/eventsource_redirect_to.resource^headers^
rename : content/base/test/fake_plugin.tst => dom/base/test/fake_plugin.tst
rename : content/base/test/file_CrossSiteXHR_cache_server.sjs => dom/base/test/file_CrossSiteXHR_cache_server.sjs
rename : content/base/test/file_CrossSiteXHR_inner.html => dom/base/test/file_CrossSiteXHR_inner.html
rename : content/base/test/file_CrossSiteXHR_inner.jar => dom/base/test/file_CrossSiteXHR_inner.jar
rename : content/base/test/file_CrossSiteXHR_inner_data.sjs => dom/base/test/file_CrossSiteXHR_inner_data.sjs
rename : content/base/test/file_CrossSiteXHR_server.sjs => dom/base/test/file_CrossSiteXHR_server.sjs
rename : content/base/test/file_XHRDocURI.html => dom/base/test/file_XHRDocURI.html
rename : content/base/test/file_XHRDocURI.html^headers^ => dom/base/test/file_XHRDocURI.html^headers^
rename : content/base/test/file_XHRDocURI.sjs => dom/base/test/file_XHRDocURI.sjs
rename : content/base/test/file_XHRDocURI.text => dom/base/test/file_XHRDocURI.text
rename : content/base/test/file_XHRDocURI.text^headers^ => dom/base/test/file_XHRDocURI.text^headers^
rename : content/base/test/file_XHRDocURI.xml => dom/base/test/file_XHRDocURI.xml
rename : content/base/test/file_XHRDocURI.xml^headers^ => dom/base/test/file_XHRDocURI.xml^headers^
rename : content/base/test/file_XHRResponseURL.js => dom/base/test/file_XHRResponseURL.js
rename : content/base/test/file_XHRResponseURL.sjs => dom/base/test/file_XHRResponseURL.sjs
rename : content/base/test/file_XHRResponseURL.text => dom/base/test/file_XHRResponseURL.text
rename : content/base/test/file_XHRResponseURL.text^headers^ => dom/base/test/file_XHRResponseURL.text^headers^
rename : content/base/test/file_XHRResponseURL_nocors.text => dom/base/test/file_XHRResponseURL_nocors.text
rename : content/base/test/file_XHRSendData.sjs => dom/base/test/file_XHRSendData.sjs
rename : content/base/test/file_XHRSendData_doc.xml => dom/base/test/file_XHRSendData_doc.xml
rename : content/base/test/file_XHRSendData_doc.xml^headers^ => dom/base/test/file_XHRSendData_doc.xml^headers^
rename : content/base/test/file_XHR_anon.sjs => dom/base/test/file_XHR_anon.sjs
rename : content/base/test/file_XHR_binary1.bin => dom/base/test/file_XHR_binary1.bin
rename : content/base/test/file_XHR_binary1.bin^headers^ => dom/base/test/file_XHR_binary1.bin^headers^
rename : content/base/test/file_XHR_binary2.bin => dom/base/test/file_XHR_binary2.bin
rename : content/base/test/file_XHR_fail1.txt => dom/base/test/file_XHR_fail1.txt
rename : content/base/test/file_XHR_fail1.txt^headers^ => dom/base/test/file_XHR_fail1.txt^headers^
rename : content/base/test/file_XHR_fail1b.txt => dom/base/test/file_XHR_fail1b.txt
rename : content/base/test/file_XHR_header.sjs => dom/base/test/file_XHR_header.sjs
rename : content/base/test/file_XHR_pass1.xml => dom/base/test/file_XHR_pass1.xml
rename : content/base/test/file_XHR_pass2.txt => dom/base/test/file_XHR_pass2.txt
rename : content/base/test/file_XHR_pass3.txt => dom/base/test/file_XHR_pass3.txt
rename : content/base/test/file_XHR_pass3.txt^headers^ => dom/base/test/file_XHR_pass3.txt^headers^
rename : content/base/test/file_XHR_system_redirect.html => dom/base/test/file_XHR_system_redirect.html
rename : content/base/test/file_XHR_system_redirect.html^headers^ => dom/base/test/file_XHR_system_redirect.html^headers^
rename : content/base/test/file_XHR_timeout.sjs => dom/base/test/file_XHR_timeout.sjs
rename : content/base/test/file_base_xbl.xml => dom/base/test/file_base_xbl.xml
rename : content/base/test/file_bug1008126_worker.js => dom/base/test/file_bug1008126_worker.js
rename : content/base/test/file_bug1011748_OK.sjs => dom/base/test/file_bug1011748_OK.sjs
rename : content/base/test/file_bug1011748_redirect.sjs => dom/base/test/file_bug1011748_redirect.sjs
rename : content/base/test/file_bug28293.sjs => dom/base/test/file_bug28293.sjs
rename : content/base/test/file_bug326337.xml => dom/base/test/file_bug326337.xml
rename : content/base/test/file_bug326337_inner.html => dom/base/test/file_bug326337_inner.html
rename : content/base/test/file_bug326337_outer.html => dom/base/test/file_bug326337_outer.html
rename : content/base/test/file_bug416317.xhtml => dom/base/test/file_bug416317.xhtml
rename : content/base/test/file_bug426646-1.html => dom/base/test/file_bug426646-1.html
rename : content/base/test/file_bug426646-2.html => dom/base/test/file_bug426646-2.html
rename : content/base/test/file_bug428847-1.xhtml => dom/base/test/file_bug428847-1.xhtml
rename : content/base/test/file_bug428847-2.xhtml => dom/base/test/file_bug428847-2.xhtml
rename : content/base/test/file_bug498897.css => dom/base/test/file_bug498897.css
rename : content/base/test/file_bug498897.html => dom/base/test/file_bug498897.html
rename : content/base/test/file_bug498897.html^headers^ => dom/base/test/file_bug498897.html^headers^
rename : content/base/test/file_bug503473-frame.sjs => dom/base/test/file_bug503473-frame.sjs
rename : content/base/test/file_bug503481.sjs => dom/base/test/file_bug503481.sjs
rename : content/base/test/file_bug503481b_inner.html => dom/base/test/file_bug503481b_inner.html
rename : content/base/test/file_bug541937.html => dom/base/test/file_bug541937.html
rename : content/base/test/file_bug541937.xhtml => dom/base/test/file_bug541937.xhtml
rename : content/base/test/file_bug557892.html => dom/base/test/file_bug557892.html
rename : content/base/test/file_bug562137.txt => dom/base/test/file_bug562137.txt
rename : content/base/test/file_bug590812-ref.xhtml => dom/base/test/file_bug590812-ref.xhtml
rename : content/base/test/file_bug590812.xml => dom/base/test/file_bug590812.xml
rename : content/base/test/file_bug590870.html => dom/base/test/file_bug590870.html
rename : content/base/test/file_bug601803a.html => dom/base/test/file_bug601803a.html
rename : content/base/test/file_bug601803b.html => dom/base/test/file_bug601803b.html
rename : content/base/test/file_bug604660-1.xml => dom/base/test/file_bug604660-1.xml
rename : content/base/test/file_bug604660-2.xsl => dom/base/test/file_bug604660-2.xsl
rename : content/base/test/file_bug604660-3.js => dom/base/test/file_bug604660-3.js
rename : content/base/test/file_bug604660-4.js => dom/base/test/file_bug604660-4.js
rename : content/base/test/file_bug604660-5.xml => dom/base/test/file_bug604660-5.xml
rename : content/base/test/file_bug604660-6.xsl => dom/base/test/file_bug604660-6.xsl
rename : content/base/test/file_bug622088.sjs => dom/base/test/file_bug622088.sjs
rename : content/base/test/file_bug622088_inner.html => dom/base/test/file_bug622088_inner.html
rename : content/base/test/file_bug675121.sjs => dom/base/test/file_bug675121.sjs
rename : content/base/test/file_bug687859-16.js => dom/base/test/file_bug687859-16.js
rename : content/base/test/file_bug687859-16.js^headers^ => dom/base/test/file_bug687859-16.js^headers^
rename : content/base/test/file_bug687859-bom.js => dom/base/test/file_bug687859-bom.js
rename : content/base/test/file_bug687859-bom.js^headers^ => dom/base/test/file_bug687859-bom.js^headers^
rename : content/base/test/file_bug687859-charset.js => dom/base/test/file_bug687859-charset.js
rename : content/base/test/file_bug687859-http.js => dom/base/test/file_bug687859-http.js
rename : content/base/test/file_bug687859-http.js^headers^ => dom/base/test/file_bug687859-http.js^headers^
rename : content/base/test/file_bug687859-inherit.js => dom/base/test/file_bug687859-inherit.js
rename : content/base/test/file_bug692434.xml => dom/base/test/file_bug692434.xml
rename : content/base/test/file_bug707142_baseline.json => dom/base/test/file_bug707142_baseline.json
rename : content/base/test/file_bug707142_bom.json => dom/base/test/file_bug707142_bom.json
rename : content/base/test/file_bug707142_utf-16.json => dom/base/test/file_bug707142_utf-16.json
rename : content/base/test/file_bug708620-2.html => dom/base/test/file_bug708620-2.html
rename : content/base/test/file_bug708620.html => dom/base/test/file_bug708620.html
rename : content/base/test/file_bug782342.txt => dom/base/test/file_bug782342.txt
rename : content/base/test/file_bug787778.sjs => dom/base/test/file_bug787778.sjs
rename : content/base/test/file_bug804395.jar => dom/base/test/file_bug804395.jar
rename : content/base/test/file_bug869432.eventsource => dom/base/test/file_bug869432.eventsource
rename : content/base/test/file_bug869432.eventsource^headers^ => dom/base/test/file_bug869432.eventsource^headers^
rename : content/base/test/file_bug902350.html => dom/base/test/file_bug902350.html
rename : content/base/test/file_bug902350_frame.html => dom/base/test/file_bug902350_frame.html
rename : content/base/test/file_bug907892.html => dom/base/test/file_bug907892.html
rename : content/base/test/file_bug945152.jar => dom/base/test/file_bug945152.jar
rename : content/base/test/file_bug945152_worker.js => dom/base/test/file_bug945152_worker.js
rename : content/base/test/file_general_document.html => dom/base/test/file_general_document.html
rename : content/base/test/file_html_in_xhr.html => dom/base/test/file_html_in_xhr.html
rename : content/base/test/file_html_in_xhr.sjs => dom/base/test/file_html_in_xhr.sjs
rename : content/base/test/file_html_in_xhr2.html => dom/base/test/file_html_in_xhr2.html
rename : content/base/test/file_html_in_xhr3.html => dom/base/test/file_html_in_xhr3.html
rename : content/base/test/file_htmlserializer_1.html => dom/base/test/file_htmlserializer_1.html
rename : content/base/test/file_htmlserializer_1_bodyonly.html => dom/base/test/file_htmlserializer_1_bodyonly.html
rename : content/base/test/file_htmlserializer_1_format.html => dom/base/test/file_htmlserializer_1_format.html
rename : content/base/test/file_htmlserializer_1_linebreak.html => dom/base/test/file_htmlserializer_1_linebreak.html
rename : content/base/test/file_htmlserializer_1_links.html => dom/base/test/file_htmlserializer_1_links.html
rename : content/base/test/file_htmlserializer_1_nested_body.html => dom/base/test/file_htmlserializer_1_nested_body.html
rename : content/base/test/file_htmlserializer_1_no_body.html => dom/base/test/file_htmlserializer_1_no_body.html
rename : content/base/test/file_htmlserializer_1_noflag.html => dom/base/test/file_htmlserializer_1_noflag.html
rename : content/base/test/file_htmlserializer_1_noformatpre.html => dom/base/test/file_htmlserializer_1_noformatpre.html
rename : content/base/test/file_htmlserializer_1_raw.html => dom/base/test/file_htmlserializer_1_raw.html
rename : content/base/test/file_htmlserializer_1_sibling_body.html => dom/base/test/file_htmlserializer_1_sibling_body.html
rename : content/base/test/file_htmlserializer_1_sibling_body_only_body.html => dom/base/test/file_htmlserializer_1_sibling_body_only_body.html
rename : content/base/test/file_htmlserializer_1_wrap.html => dom/base/test/file_htmlserializer_1_wrap.html
rename : content/base/test/file_htmlserializer_2.html => dom/base/test/file_htmlserializer_2.html
rename : content/base/test/file_htmlserializer_2_basic.html => dom/base/test/file_htmlserializer_2_basic.html
rename : content/base/test/file_htmlserializer_2_enthtml.html => dom/base/test/file_htmlserializer_2_enthtml.html
rename : content/base/test/file_htmlserializer_2_entw3c.html => dom/base/test/file_htmlserializer_2_entw3c.html
rename : content/base/test/file_htmlserializer_2_latin1.html => dom/base/test/file_htmlserializer_2_latin1.html
rename : content/base/test/file_htmlserializer_ipv6.html => dom/base/test/file_htmlserializer_ipv6.html
rename : content/base/test/file_htmlserializer_ipv6_out.html => dom/base/test/file_htmlserializer_ipv6_out.html
rename : content/base/test/file_mixed_content_frameNavigation.html => dom/base/test/file_mixed_content_frameNavigation.html
rename : content/base/test/file_mixed_content_frameNavigation_blankTarget.html => dom/base/test/file_mixed_content_frameNavigation_blankTarget.html
rename : content/base/test/file_mixed_content_frameNavigation_grandchild.html => dom/base/test/file_mixed_content_frameNavigation_grandchild.html
rename : content/base/test/file_mixed_content_frameNavigation_innermost.html => dom/base/test/file_mixed_content_frameNavigation_innermost.html
rename : content/base/test/file_mixed_content_frameNavigation_secure.html => dom/base/test/file_mixed_content_frameNavigation_secure.html
rename : content/base/test/file_mixed_content_frameNavigation_secure_grandchild.html => dom/base/test/file_mixed_content_frameNavigation_secure_grandchild.html
rename : content/base/test/file_mixed_content_main.html => dom/base/test/file_mixed_content_main.html
rename : content/base/test/file_mixed_content_main_bug803225.html => dom/base/test/file_mixed_content_main_bug803225.html
rename : content/base/test/file_mixed_content_main_bug803225_websocket_wsh.py => dom/base/test/file_mixed_content_main_bug803225_websocket_wsh.py
rename : content/base/test/file_mixed_content_server.sjs => dom/base/test/file_mixed_content_server.sjs
rename : content/base/test/file_mozfiledataurl_audio.ogg => dom/base/test/file_mozfiledataurl_audio.ogg
rename : content/base/test/file_mozfiledataurl_doc.html => dom/base/test/file_mozfiledataurl_doc.html
rename : content/base/test/file_mozfiledataurl_img.jpg => dom/base/test/file_mozfiledataurl_img.jpg
rename : content/base/test/file_mozfiledataurl_inner.html => dom/base/test/file_mozfiledataurl_inner.html
rename : content/base/test/file_mozfiledataurl_text.txt => dom/base/test/file_mozfiledataurl_text.txt
rename : content/base/test/file_restrictedEventSource.sjs => dom/base/test/file_restrictedEventSource.sjs
rename : content/base/test/file_websocket_basic_wsh.py => dom/base/test/file_websocket_basic_wsh.py
rename : content/base/test/file_websocket_hello_wsh.py => dom/base/test/file_websocket_hello_wsh.py
rename : content/base/test/file_websocket_http_resource.txt => dom/base/test/file_websocket_http_resource.txt
rename : content/base/test/file_websocket_wsh.py => dom/base/test/file_websocket_wsh.py
rename : content/base/test/file_x-frame-options_main.html => dom/base/test/file_x-frame-options_main.html
rename : content/base/test/file_x-frame-options_page.sjs => dom/base/test/file_x-frame-options_page.sjs
rename : content/base/test/file_xhtmlserializer_1.xhtml => dom/base/test/file_xhtmlserializer_1.xhtml
rename : content/base/test/file_xhtmlserializer_1_bodyonly.xhtml => dom/base/test/file_xhtmlserializer_1_bodyonly.xhtml
rename : content/base/test/file_xhtmlserializer_1_format.xhtml => dom/base/test/file_xhtmlserializer_1_format.xhtml
rename : content/base/test/file_xhtmlserializer_1_linebreak.xhtml => dom/base/test/file_xhtmlserializer_1_linebreak.xhtml
rename : content/base/test/file_xhtmlserializer_1_links.xhtml => dom/base/test/file_xhtmlserializer_1_links.xhtml
rename : content/base/test/file_xhtmlserializer_1_nested_body.xhtml => dom/base/test/file_xhtmlserializer_1_nested_body.xhtml
rename : content/base/test/file_xhtmlserializer_1_no_body.xhtml => dom/base/test/file_xhtmlserializer_1_no_body.xhtml
rename : content/base/test/file_xhtmlserializer_1_noflag.xhtml => dom/base/test/file_xhtmlserializer_1_noflag.xhtml
rename : content/base/test/file_xhtmlserializer_1_noformatpre.xhtml => dom/base/test/file_xhtmlserializer_1_noformatpre.xhtml
rename : content/base/test/file_xhtmlserializer_1_raw.xhtml => dom/base/test/file_xhtmlserializer_1_raw.xhtml
rename : content/base/test/file_xhtmlserializer_1_sibling_body.xhtml => dom/base/test/file_xhtmlserializer_1_sibling_body.xhtml
rename : content/base/test/file_xhtmlserializer_1_sibling_body_only_body.xhtml => dom/base/test/file_xhtmlserializer_1_sibling_body_only_body.xhtml
rename : content/base/test/file_xhtmlserializer_1_wrap.xhtml => dom/base/test/file_xhtmlserializer_1_wrap.xhtml
rename : content/base/test/file_xhtmlserializer_2.xhtml => dom/base/test/file_xhtmlserializer_2.xhtml
rename : content/base/test/file_xhtmlserializer_2_basic.xhtml => dom/base/test/file_xhtmlserializer_2_basic.xhtml
rename : content/base/test/file_xhtmlserializer_2_enthtml.xhtml => dom/base/test/file_xhtmlserializer_2_enthtml.xhtml
rename : content/base/test/file_xhtmlserializer_2_entw3c.xhtml => dom/base/test/file_xhtmlserializer_2_entw3c.xhtml
rename : content/base/test/file_xhtmlserializer_2_latin1.xhtml => dom/base/test/file_xhtmlserializer_2_latin1.xhtml
rename : content/base/test/fileutils.js => dom/base/test/fileutils.js
rename : content/base/test/forRemoval.resource => dom/base/test/forRemoval.resource
rename : content/base/test/forRemoval.resource^headers^ => dom/base/test/forRemoval.resource^headers^
rename : content/base/test/formReset.html => dom/base/test/formReset.html
rename : content/base/test/invalid_accesscontrol.resource => dom/base/test/invalid_accesscontrol.resource
rename : content/base/test/invalid_accesscontrol.resource^headers^ => dom/base/test/invalid_accesscontrol.resource^headers^
rename : content/base/test/mochitest-child-permissions.ini => dom/base/test/mochitest-child-permissions.ini
rename : content/base/test/moz.build => dom/base/test/moz.build
rename : content/base/test/mutationobserver_dialog.html => dom/base/test/mutationobserver_dialog.html
rename : content/base/test/progressserver.sjs => dom/base/test/progressserver.sjs
rename : content/base/test/reftest/mixed-bmp-png.ico => dom/base/test/reftest/mixed-bmp-png.ico
rename : content/base/test/reftest/reftest.list => dom/base/test/reftest/reftest.list
rename : content/base/test/reftest/test_bug920877-ref.html => dom/base/test/reftest/test_bug920877-ref.html
rename : content/base/test/reftest/test_bug920877.html => dom/base/test/reftest/test_bug920877.html
rename : content/base/test/responseIdentical.sjs => dom/base/test/responseIdentical.sjs
rename : content/base/test/script-1_bug597345.sjs => dom/base/test/script-1_bug597345.sjs
rename : content/base/test/script-2_bug597345.js => dom/base/test/script-2_bug597345.js
rename : content/base/test/script_bug602838.sjs => dom/base/test/script_bug602838.sjs
rename : content/base/test/send_gzip_content.sjs => dom/base/test/send_gzip_content.sjs
rename : content/base/test/somedatas.resource => dom/base/test/somedatas.resource
rename : content/base/test/somedatas.resource^headers^ => dom/base/test/somedatas.resource^headers^
rename : content/base/test/test_CrossSiteXHR.html => dom/base/test/test_CrossSiteXHR.html
rename : content/base/test/test_CrossSiteXHR_cache.html => dom/base/test/test_CrossSiteXHR_cache.html
rename : content/base/test/test_CrossSiteXHR_origin.html => dom/base/test/test_CrossSiteXHR_origin.html
rename : content/base/test/test_DOMException.html => dom/base/test/test_DOMException.html
rename : content/base/test/test_EventSource_redirects.html => dom/base/test/test_EventSource_redirects.html
rename : content/base/test/test_NodeIterator_basics_filters.xhtml => dom/base/test/test_NodeIterator_basics_filters.xhtml
rename : content/base/test/test_NodeIterator_mutations_1.xhtml => dom/base/test/test_NodeIterator_mutations_1.xhtml
rename : content/base/test/test_NodeIterator_mutations_2.html => dom/base/test/test_NodeIterator_mutations_2.html
rename : content/base/test/test_NodeIterator_mutations_3.html => dom/base/test/test_NodeIterator_mutations_3.html
rename : content/base/test/test_XHR.html => dom/base/test/test_XHR.html
rename : content/base/test/test_XHRDocURI.html => dom/base/test/test_XHRDocURI.html
rename : content/base/test/test_XHRResponseURL.html => dom/base/test/test_XHRResponseURL.html
rename : content/base/test/test_XHRSendData.html => dom/base/test/test_XHRSendData.html
rename : content/base/test/test_XHR_anon.html => dom/base/test/test_XHR_anon.html
rename : content/base/test/test_XHR_header.html => dom/base/test/test_XHR_header.html
rename : content/base/test/test_XHR_onuploadprogress.html => dom/base/test/test_XHR_onuploadprogress.html
rename : content/base/test/test_XHR_parameters.html => dom/base/test/test_XHR_parameters.html
rename : content/base/test/test_XHR_system.html => dom/base/test/test_XHR_system.html
rename : content/base/test/test_XHR_timeout.html => dom/base/test/test_XHR_timeout.html
rename : content/base/test/test_XHR_timeout.js => dom/base/test/test_XHR_timeout.js
rename : content/base/test/test_base.xhtml => dom/base/test/test_base.xhtml
rename : content/base/test/test_blobconstructor.html => dom/base/test/test_blobconstructor.html
rename : content/base/test/test_bug1008126.html => dom/base/test/test_bug1008126.html
rename : content/base/test/test_bug1011748.html => dom/base/test/test_bug1011748.html
rename : content/base/test/test_bug1025933.html => dom/base/test/test_bug1025933.html
rename : content/base/test/test_bug1057176.html => dom/base/test/test_bug1057176.html
rename : content/base/test/test_bug1081686.html => dom/base/test/test_bug1081686.html
rename : content/base/test/test_bug166235.html => dom/base/test/test_bug166235.html
rename : content/base/test/test_bug199959.html => dom/base/test/test_bug199959.html
rename : content/base/test/test_bug218236.html => dom/base/test/test_bug218236.html
rename : content/base/test/test_bug218277.html => dom/base/test/test_bug218277.html
rename : content/base/test/test_bug238409.html => dom/base/test/test_bug238409.html
rename : content/base/test/test_bug254337.html => dom/base/test/test_bug254337.html
rename : content/base/test/test_bug270145.xhtml => dom/base/test/test_bug270145.xhtml
rename : content/base/test/test_bug276037-1.html => dom/base/test/test_bug276037-1.html
rename : content/base/test/test_bug276037-2.xhtml => dom/base/test/test_bug276037-2.xhtml
rename : content/base/test/test_bug282547.html => dom/base/test/test_bug282547.html
rename : content/base/test/test_bug28293.html => dom/base/test/test_bug28293.html
rename : content/base/test/test_bug28293.xhtml => dom/base/test/test_bug28293.xhtml
rename : content/base/test/test_bug298064.html => dom/base/test/test_bug298064.html
rename : content/base/test/test_bug300992.html => dom/base/test/test_bug300992.html
rename : content/base/test/test_bug311681.xml => dom/base/test/test_bug311681.xml
rename : content/base/test/test_bug313646.html => dom/base/test/test_bug313646.html
rename : content/base/test/test_bug320799.html => dom/base/test/test_bug320799.html
rename : content/base/test/test_bug322317.html => dom/base/test/test_bug322317.html
rename : content/base/test/test_bug326337.html => dom/base/test/test_bug326337.html
rename : content/base/test/test_bug330925.xhtml => dom/base/test/test_bug330925.xhtml
rename : content/base/test/test_bug331959.html => dom/base/test/test_bug331959.html
rename : content/base/test/test_bug333198.html => dom/base/test/test_bug333198.html
rename : content/base/test/test_bug333673.html => dom/base/test/test_bug333673.html
rename : content/base/test/test_bug337631.html => dom/base/test/test_bug337631.html
rename : content/base/test/test_bug338541.xhtml => dom/base/test/test_bug338541.xhtml
rename : content/base/test/test_bug338583.html => dom/base/test/test_bug338583.html
rename : content/base/test/test_bug338679.html => dom/base/test/test_bug338679.html
rename : content/base/test/test_bug339494.html => dom/base/test/test_bug339494.html
rename : content/base/test/test_bug339494.xhtml => dom/base/test/test_bug339494.xhtml
rename : content/base/test/test_bug340571.html => dom/base/test/test_bug340571.html
rename : content/base/test/test_bug343596.html => dom/base/test/test_bug343596.html
rename : content/base/test/test_bug345339.html => dom/base/test/test_bug345339.html
rename : content/base/test/test_bug346485.html => dom/base/test/test_bug346485.html
rename : content/base/test/test_bug352728.html => dom/base/test/test_bug352728.html
rename : content/base/test/test_bug352728.xhtml => dom/base/test/test_bug352728.xhtml
rename : content/base/test/test_bug353334.html => dom/base/test/test_bug353334.html
rename : content/base/test/test_bug355026.html => dom/base/test/test_bug355026.html
rename : content/base/test/test_bug357450.html => dom/base/test/test_bug357450.html
rename : content/base/test/test_bug357450.js => dom/base/test/test_bug357450.js
rename : content/base/test/test_bug357450.xhtml => dom/base/test/test_bug357450.xhtml
rename : content/base/test/test_bug357450_svg.xhtml => dom/base/test/test_bug357450_svg.xhtml
rename : content/base/test/test_bug357509.html => dom/base/test/test_bug357509.html
rename : content/base/test/test_bug358660.html => dom/base/test/test_bug358660.html
rename : content/base/test/test_bug362391.xhtml => dom/base/test/test_bug362391.xhtml
rename : content/base/test/test_bug364092.xhtml => dom/base/test/test_bug364092.xhtml
rename : content/base/test/test_bug364413.xhtml => dom/base/test/test_bug364413.xhtml
rename : content/base/test/test_bug366944.html => dom/base/test/test_bug366944.html
rename : content/base/test/test_bug366946.html => dom/base/test/test_bug366946.html
rename : content/base/test/test_bug367164.html => dom/base/test/test_bug367164.html
rename : content/base/test/test_bug368972.html => dom/base/test/test_bug368972.html
rename : content/base/test/test_bug371576-2.html => dom/base/test/test_bug371576-2.html
rename : content/base/test/test_bug371576-3.html => dom/base/test/test_bug371576-3.html
rename : content/base/test/test_bug371576-4.html => dom/base/test/test_bug371576-4.html
rename : content/base/test/test_bug371576-5.html => dom/base/test/test_bug371576-5.html
rename : content/base/test/test_bug372086.html => dom/base/test/test_bug372086.html
rename : content/base/test/test_bug372964-2.html => dom/base/test/test_bug372964-2.html
rename : content/base/test/test_bug372964.html => dom/base/test/test_bug372964.html
rename : content/base/test/test_bug373181.xhtml => dom/base/test/test_bug373181.xhtml
rename : content/base/test/test_bug375314.html => dom/base/test/test_bug375314.html
rename : content/base/test/test_bug378969.html => dom/base/test/test_bug378969.html
rename : content/base/test/test_bug380418.html => dom/base/test/test_bug380418.html
rename : content/base/test/test_bug380418.html^headers^ => dom/base/test/test_bug380418.html^headers^
rename : content/base/test/test_bug382113.html => dom/base/test/test_bug382113.html
rename : content/base/test/test_bug382871.html => dom/base/test/test_bug382871.html
rename : content/base/test/test_bug384003.xhtml => dom/base/test/test_bug384003.xhtml
rename : content/base/test/test_bug390219.html => dom/base/test/test_bug390219.html
rename : content/base/test/test_bug390735.html => dom/base/test/test_bug390735.html
rename : content/base/test/test_bug392318.html => dom/base/test/test_bug392318.html
rename : content/base/test/test_bug392511.html => dom/base/test/test_bug392511.html
rename : content/base/test/test_bug393968.html => dom/base/test/test_bug393968.html
rename : content/base/test/test_bug395915.html => dom/base/test/test_bug395915.html
rename : content/base/test/test_bug397234.html => dom/base/test/test_bug397234.html
rename : content/base/test/test_bug398243.html => dom/base/test/test_bug398243.html
rename : content/base/test/test_bug401662.html => dom/base/test/test_bug401662.html
rename : content/base/test/test_bug402150.html => dom/base/test/test_bug402150.html
rename : content/base/test/test_bug402150.html^headers^ => dom/base/test/test_bug402150.html^headers^
rename : content/base/test/test_bug403841.html => dom/base/test/test_bug403841.html
rename : content/base/test/test_bug403852.html => dom/base/test/test_bug403852.html
rename : content/base/test/test_bug403868.xml => dom/base/test/test_bug403868.xml
rename : content/base/test/test_bug405182.html => dom/base/test/test_bug405182.html
rename : content/base/test/test_bug409380.html => dom/base/test/test_bug409380.html
rename : content/base/test/test_bug410229.html => dom/base/test/test_bug410229.html
rename : content/base/test/test_bug413974.html => dom/base/test/test_bug413974.html
rename : content/base/test/test_bug414190.html => dom/base/test/test_bug414190.html
rename : content/base/test/test_bug415860.html => dom/base/test/test_bug415860.html
rename : content/base/test/test_bug416317-1.html => dom/base/test/test_bug416317-1.html
rename : content/base/test/test_bug416317-2.html => dom/base/test/test_bug416317-2.html
rename : content/base/test/test_bug416383.html => dom/base/test/test_bug416383.html
rename : content/base/test/test_bug417255.html => dom/base/test/test_bug417255.html
rename : content/base/test/test_bug417384.html => dom/base/test/test_bug417384.html
rename : content/base/test/test_bug418214.html => dom/base/test/test_bug418214.html
rename : content/base/test/test_bug419132.html => dom/base/test/test_bug419132.html
rename : content/base/test/test_bug419527.xhtml => dom/base/test/test_bug419527.xhtml
rename : content/base/test/test_bug420609.xhtml => dom/base/test/test_bug420609.xhtml
rename : content/base/test/test_bug420700.html => dom/base/test/test_bug420700.html
rename : content/base/test/test_bug421602.html => dom/base/test/test_bug421602.html
rename : content/base/test/test_bug422403-1.html => dom/base/test/test_bug422403-1.html
rename : content/base/test/test_bug422403-2.xhtml => dom/base/test/test_bug422403-2.xhtml
rename : content/base/test/test_bug422537.html => dom/base/test/test_bug422537.html
rename : content/base/test/test_bug424212.html => dom/base/test/test_bug424212.html
rename : content/base/test/test_bug424359-1.html => dom/base/test/test_bug424359-1.html
rename : content/base/test/test_bug424359-2.html => dom/base/test/test_bug424359-2.html
rename : content/base/test/test_bug425013.html => dom/base/test/test_bug425013.html
rename : content/base/test/test_bug426308.html => dom/base/test/test_bug426308.html
rename : content/base/test/test_bug426646.html => dom/base/test/test_bug426646.html
rename : content/base/test/test_bug428847.html => dom/base/test/test_bug428847.html
rename : content/base/test/test_bug429157.html => dom/base/test/test_bug429157.html
rename : content/base/test/test_bug431082.html => dom/base/test/test_bug431082.html
rename : content/base/test/test_bug431701.html => dom/base/test/test_bug431701.html
rename : content/base/test/test_bug431833.html => dom/base/test/test_bug431833.html
rename : content/base/test/test_bug433533.html => dom/base/test/test_bug433533.html
rename : content/base/test/test_bug433662.html => dom/base/test/test_bug433662.html
rename : content/base/test/test_bug435425.html => dom/base/test/test_bug435425.html
rename : content/base/test/test_bug438519.html => dom/base/test/test_bug438519.html
rename : content/base/test/test_bug444030.xhtml => dom/base/test/test_bug444030.xhtml
rename : content/base/test/test_bug444322.html => dom/base/test/test_bug444322.html
rename : content/base/test/test_bug444546.html => dom/base/test/test_bug444546.html
rename : content/base/test/test_bug444722.html => dom/base/test/test_bug444722.html
rename : content/base/test/test_bug448993.html => dom/base/test/test_bug448993.html
rename : content/base/test/test_bug450160.html => dom/base/test/test_bug450160.html
rename : content/base/test/test_bug451376.html => dom/base/test/test_bug451376.html
rename : content/base/test/test_bug453521.html => dom/base/test/test_bug453521.html
rename : content/base/test/test_bug453736.html => dom/base/test/test_bug453736.html
rename : content/base/test/test_bug454325.html => dom/base/test/test_bug454325.html
rename : content/base/test/test_bug454326.html => dom/base/test/test_bug454326.html
rename : content/base/test/test_bug455472.html => dom/base/test/test_bug455472.html
rename : content/base/test/test_bug455629.html => dom/base/test/test_bug455629.html
rename : content/base/test/test_bug456262.html => dom/base/test/test_bug456262.html
rename : content/base/test/test_bug457746.html => dom/base/test/test_bug457746.html
rename : content/base/test/test_bug459424.html => dom/base/test/test_bug459424.html
rename : content/base/test/test_bug461555.html => dom/base/test/test_bug461555.html
rename : content/base/test/test_bug461735.html => dom/base/test/test_bug461735.html
rename : content/base/test/test_bug465767.html => dom/base/test/test_bug465767.html
rename : content/base/test/test_bug466080.html => dom/base/test/test_bug466080.html
rename : content/base/test/test_bug466409.html => dom/base/test/test_bug466409.html
rename : content/base/test/test_bug466751.xhtml => dom/base/test/test_bug466751.xhtml
rename : content/base/test/test_bug469020.html => dom/base/test/test_bug469020.html
rename : content/base/test/test_bug469304.html => dom/base/test/test_bug469304.html
rename : content/base/test/test_bug473162-1.html => dom/base/test/test_bug473162-1.html
rename : content/base/test/test_bug473162-2.html => dom/base/test/test_bug473162-2.html
rename : content/base/test/test_bug475156.html => dom/base/test/test_bug475156.html
rename : content/base/test/test_bug482935.html => dom/base/test/test_bug482935.html
rename : content/base/test/test_bug484396.html => dom/base/test/test_bug484396.html
rename : content/base/test/test_bug493881.html => dom/base/test/test_bug493881.html
rename : content/base/test/test_bug493881.js => dom/base/test/test_bug493881.js
rename : content/base/test/test_bug498240.html => dom/base/test/test_bug498240.html
rename : content/base/test/test_bug498433.html => dom/base/test/test_bug498433.html
rename : content/base/test/test_bug498897.html => dom/base/test/test_bug498897.html
rename : content/base/test/test_bug499656.html => dom/base/test/test_bug499656.html
rename : content/base/test/test_bug499656.xhtml => dom/base/test/test_bug499656.xhtml
rename : content/base/test/test_bug500937.html => dom/base/test/test_bug500937.html
rename : content/base/test/test_bug503473.html => dom/base/test/test_bug503473.html
rename : content/base/test/test_bug503481.html => dom/base/test/test_bug503481.html
rename : content/base/test/test_bug503481b.html => dom/base/test/test_bug503481b.html
rename : content/base/test/test_bug505783.html => dom/base/test/test_bug505783.html
rename : content/base/test/test_bug51034.html => dom/base/test/test_bug51034.html
rename : content/base/test/test_bug513194.html => dom/base/test/test_bug513194.html
rename : content/base/test/test_bug5141.html => dom/base/test/test_bug5141.html
rename : content/base/test/test_bug514487.html => dom/base/test/test_bug514487.html
rename : content/base/test/test_bug515401.html => dom/base/test/test_bug515401.html
rename : content/base/test/test_bug518104.html => dom/base/test/test_bug518104.html
rename : content/base/test/test_bug527896.html => dom/base/test/test_bug527896.html
rename : content/base/test/test_bug540854.html => dom/base/test/test_bug540854.html
rename : content/base/test/test_bug541937.html => dom/base/test/test_bug541937.html
rename : content/base/test/test_bug544642.html => dom/base/test/test_bug544642.html
rename : content/base/test/test_bug545644.html => dom/base/test/test_bug545644.html
rename : content/base/test/test_bug545644.xhtml => dom/base/test/test_bug545644.xhtml
rename : content/base/test/test_bug548463.html => dom/base/test/test_bug548463.html
rename : content/base/test/test_bug553896.xhtml => dom/base/test/test_bug553896.xhtml
rename : content/base/test/test_bug557892.html => dom/base/test/test_bug557892.html
rename : content/base/test/test_bug558726.html => dom/base/test/test_bug558726.html
rename : content/base/test/test_bug559526.html => dom/base/test/test_bug559526.html
rename : content/base/test/test_bug560780.html => dom/base/test/test_bug560780.html
rename : content/base/test/test_bug562137.html => dom/base/test/test_bug562137.html
rename : content/base/test/test_bug562169-1.html => dom/base/test/test_bug562169-1.html
rename : content/base/test/test_bug562169-2.html => dom/base/test/test_bug562169-2.html
rename : content/base/test/test_bug562652.html => dom/base/test/test_bug562652.html
rename : content/base/test/test_bug564047.html => dom/base/test/test_bug564047.html
rename : content/base/test/test_bug564863.xhtml => dom/base/test/test_bug564863.xhtml
rename : content/base/test/test_bug567350.html => dom/base/test/test_bug567350.html
rename : content/base/test/test_bug578096.html => dom/base/test/test_bug578096.html
rename : content/base/test/test_bug585978.html => dom/base/test/test_bug585978.html
rename : content/base/test/test_bug587931.html => dom/base/test/test_bug587931.html
rename : content/base/test/test_bug588990.html => dom/base/test/test_bug588990.html
rename : content/base/test/test_bug590812.html => dom/base/test/test_bug590812.html
rename : content/base/test/test_bug590870.html => dom/base/test/test_bug590870.html
rename : content/base/test/test_bug592366.html => dom/base/test/test_bug592366.html
rename : content/base/test/test_bug592829.html => dom/base/test/test_bug592829.html
rename : content/base/test/test_bug597345.html => dom/base/test/test_bug597345.html
rename : content/base/test/test_bug599588.html => dom/base/test/test_bug599588.html
rename : content/base/test/test_bug601803.html => dom/base/test/test_bug601803.html
rename : content/base/test/test_bug602838.html => dom/base/test/test_bug602838.html
rename : content/base/test/test_bug604592.html => dom/base/test/test_bug604592.html
rename : content/base/test/test_bug604660.html => dom/base/test/test_bug604660.html
rename : content/base/test/test_bug605982.html => dom/base/test/test_bug605982.html
rename : content/base/test/test_bug606729.html => dom/base/test/test_bug606729.html
rename : content/base/test/test_bug614058.html => dom/base/test/test_bug614058.html
rename : content/base/test/test_bug614583.html => dom/base/test/test_bug614583.html
rename : content/base/test/test_bug622088.html => dom/base/test/test_bug622088.html
rename : content/base/test/test_bug622117.html => dom/base/test/test_bug622117.html
rename : content/base/test/test_bug622246.html => dom/base/test/test_bug622246.html
rename : content/base/test/test_bug625722.html => dom/base/test/test_bug625722.html
rename : content/base/test/test_bug626262.html => dom/base/test/test_bug626262.html
rename : content/base/test/test_bug628938.html => dom/base/test/test_bug628938.html
rename : content/base/test/test_bug631615.html => dom/base/test/test_bug631615.html
rename : content/base/test/test_bug638112.html => dom/base/test/test_bug638112.html
rename : content/base/test/test_bug647518.html => dom/base/test/test_bug647518.html
rename : content/base/test/test_bug650001.html => dom/base/test/test_bug650001.html
rename : content/base/test/test_bug656283.html => dom/base/test/test_bug656283.html
rename : content/base/test/test_bug664916.html => dom/base/test/test_bug664916.html
rename : content/base/test/test_bug666604.html => dom/base/test/test_bug666604.html
rename : content/base/test/test_bug675121.html => dom/base/test/test_bug675121.html
rename : content/base/test/test_bug675166.html => dom/base/test/test_bug675166.html
rename : content/base/test/test_bug682463.html => dom/base/test/test_bug682463.html
rename : content/base/test/test_bug682554.html => dom/base/test/test_bug682554.html
rename : content/base/test/test_bug682592.html => dom/base/test/test_bug682592.html
rename : content/base/test/test_bug684671.html => dom/base/test/test_bug684671.html
rename : content/base/test/test_bug685798.html => dom/base/test/test_bug685798.html
rename : content/base/test/test_bug686449.xhtml => dom/base/test/test_bug686449.xhtml
rename : content/base/test/test_bug687859.html => dom/base/test/test_bug687859.html
rename : content/base/test/test_bug690056.html => dom/base/test/test_bug690056.html
rename : content/base/test/test_bug692434.html => dom/base/test/test_bug692434.html
rename : content/base/test/test_bug693615.html => dom/base/test/test_bug693615.html
rename : content/base/test/test_bug693875.html => dom/base/test/test_bug693875.html
rename : content/base/test/test_bug694754.xhtml => dom/base/test/test_bug694754.xhtml
rename : content/base/test/test_bug696301-1.html => dom/base/test/test_bug696301-1.html
rename : content/base/test/test_bug696301-2.html => dom/base/test/test_bug696301-2.html
rename : content/base/test/test_bug698381.html => dom/base/test/test_bug698381.html
rename : content/base/test/test_bug698384.html => dom/base/test/test_bug698384.html
rename : content/base/test/test_bug704063.html => dom/base/test/test_bug704063.html
rename : content/base/test/test_bug707142.html => dom/base/test/test_bug707142.html
rename : content/base/test/test_bug708620.html => dom/base/test/test_bug708620.html
rename : content/base/test/test_bug711047.html => dom/base/test/test_bug711047.html
rename : content/base/test/test_bug711180.html => dom/base/test/test_bug711180.html
rename : content/base/test/test_bug719533.html => dom/base/test/test_bug719533.html
rename : content/base/test/test_bug726364.html => dom/base/test/test_bug726364.html
rename : content/base/test/test_bug737087.html => dom/base/test/test_bug737087.html
rename : content/base/test/test_bug737565.html => dom/base/test/test_bug737565.html
rename : content/base/test/test_bug737612.html => dom/base/test/test_bug737612.html
rename : content/base/test/test_bug738108.html => dom/base/test/test_bug738108.html
rename : content/base/test/test_bug744830.html => dom/base/test/test_bug744830.html
rename : content/base/test/test_bug749367.html => dom/base/test/test_bug749367.html
rename : content/base/test/test_bug753278.html => dom/base/test/test_bug753278.html
rename : content/base/test/test_bug761120.html => dom/base/test/test_bug761120.html
rename : content/base/test/test_bug782342.html => dom/base/test/test_bug782342.html
rename : content/base/test/test_bug787778.html => dom/base/test/test_bug787778.html
rename : content/base/test/test_bug789856.html => dom/base/test/test_bug789856.html
rename : content/base/test/test_bug804395.html => dom/base/test/test_bug804395.html
rename : content/base/test/test_bug809003.html => dom/base/test/test_bug809003.html
rename : content/base/test/test_bug810494.html => dom/base/test/test_bug810494.html
rename : content/base/test/test_bug811701.html => dom/base/test/test_bug811701.html
rename : content/base/test/test_bug811701.xhtml => dom/base/test/test_bug811701.xhtml
rename : content/base/test/test_bug813919.html => dom/base/test/test_bug813919.html
rename : content/base/test/test_bug814576.html => dom/base/test/test_bug814576.html
rename : content/base/test/test_bug819051.html => dom/base/test/test_bug819051.html
rename : content/base/test/test_bug820909.html => dom/base/test/test_bug820909.html
rename : content/base/test/test_bug827160.html => dom/base/test/test_bug827160.html
rename : content/base/test/test_bug840098.html => dom/base/test/test_bug840098.html
rename : content/base/test/test_bug864595.html => dom/base/test/test_bug864595.html
rename : content/base/test/test_bug868999.html => dom/base/test/test_bug868999.html
rename : content/base/test/test_bug869000.html => dom/base/test/test_bug869000.html
rename : content/base/test/test_bug869002.html => dom/base/test/test_bug869002.html
rename : content/base/test/test_bug869006.html => dom/base/test/test_bug869006.html
rename : content/base/test/test_bug876282.html => dom/base/test/test_bug876282.html
rename : content/base/test/test_bug890580.html => dom/base/test/test_bug890580.html
rename : content/base/test/test_bug891952.html => dom/base/test/test_bug891952.html
rename : content/base/test/test_bug894874.html => dom/base/test/test_bug894874.html
rename : content/base/test/test_bug895239.html => dom/base/test/test_bug895239.html
rename : content/base/test/test_bug895974.html => dom/base/test/test_bug895974.html
rename : content/base/test/test_bug902847.html => dom/base/test/test_bug902847.html
rename : content/base/test/test_bug907892.html => dom/base/test/test_bug907892.html
rename : content/base/test/test_bug922681.html => dom/base/test/test_bug922681.html
rename : content/base/test/test_bug927196.html => dom/base/test/test_bug927196.html
rename : content/base/test/test_bug945152.html => dom/base/test/test_bug945152.html
rename : content/base/test/test_bug982153.html => dom/base/test/test_bug982153.html
rename : content/base/test/test_caretPositionFromPoint.html => dom/base/test/test_caretPositionFromPoint.html
rename : content/base/test/test_child_process_shutdown_message.html => dom/base/test/test_child_process_shutdown_message.html
rename : content/base/test/test_classList.html => dom/base/test/test_classList.html
rename : content/base/test/test_copyimage.html => dom/base/test/test_copyimage.html
rename : content/base/test/test_copypaste.html => dom/base/test/test_copypaste.html
rename : content/base/test/test_copypaste.xhtml => dom/base/test/test_copypaste.xhtml
rename : content/base/test/test_copypaste.xul => dom/base/test/test_copypaste.xul
rename : content/base/test/test_createHTMLDocument.html => dom/base/test/test_createHTMLDocument.html
rename : content/base/test/test_declare_stylesheet_obsolete.html => dom/base/test/test_declare_stylesheet_obsolete.html
rename : content/base/test/test_document_constructor.html => dom/base/test/test_document_constructor.html
rename : content/base/test/test_domparser_null_char.html => dom/base/test/test_domparser_null_char.html
rename : content/base/test/test_domparsing.html => dom/base/test/test_domparsing.html
rename : content/base/test/test_element.matches.html => dom/base/test/test_element.matches.html
rename : content/base/test/test_elementTraversal.html => dom/base/test/test_elementTraversal.html
rename : content/base/test/test_element_closest.html => dom/base/test/test_element_closest.html
rename : content/base/test/test_encodeToStringWithMaxLength.html => dom/base/test/test_encodeToStringWithMaxLength.html
rename : content/base/test/test_file_from_blob.html => dom/base/test/test_file_from_blob.html
rename : content/base/test/test_fileapi.html => dom/base/test/test_fileapi.html
rename : content/base/test/test_fileapi_slice.html => dom/base/test/test_fileapi_slice.html
rename : content/base/test/test_getElementById.html => dom/base/test/test_getElementById.html
rename : content/base/test/test_html_colors_quirks.html => dom/base/test/test_html_colors_quirks.html
rename : content/base/test/test_html_colors_standards.html => dom/base/test/test_html_colors_standards.html
rename : content/base/test/test_html_in_xhr.html => dom/base/test/test_html_in_xhr.html
rename : content/base/test/test_htmlcopyencoder.html => dom/base/test/test_htmlcopyencoder.html
rename : content/base/test/test_htmlcopyencoder.xhtml => dom/base/test/test_htmlcopyencoder.xhtml
rename : content/base/test/test_ipc_messagemanager_blob.html => dom/base/test/test_ipc_messagemanager_blob.html
rename : content/base/test/test_messagemanager_assertpermission.html => dom/base/test/test_messagemanager_assertpermission.html
rename : content/base/test/test_messagemanager_principal.html => dom/base/test/test_messagemanager_principal.html
rename : content/base/test/test_messagemanager_send_principal.html => dom/base/test/test_messagemanager_send_principal.html
rename : content/base/test/test_meta_viewport0.html => dom/base/test/test_meta_viewport0.html
rename : content/base/test/test_meta_viewport1.html => dom/base/test/test_meta_viewport1.html
rename : content/base/test/test_meta_viewport2.html => dom/base/test/test_meta_viewport2.html
rename : content/base/test/test_meta_viewport3.html => dom/base/test/test_meta_viewport3.html
rename : content/base/test/test_meta_viewport4.html => dom/base/test/test_meta_viewport4.html
rename : content/base/test/test_meta_viewport5.html => dom/base/test/test_meta_viewport5.html
rename : content/base/test/test_meta_viewport6.html => dom/base/test/test_meta_viewport6.html
rename : content/base/test/test_mixed_content_blocker.html => dom/base/test/test_mixed_content_blocker.html
rename : content/base/test/test_mixed_content_blocker_bug803225.html => dom/base/test/test_mixed_content_blocker_bug803225.html
rename : content/base/test/test_mixed_content_blocker_frameNavigation.html => dom/base/test/test_mixed_content_blocker_frameNavigation.html
rename : content/base/test/test_mozMatchesSelector.html => dom/base/test/test_mozMatchesSelector.html
rename : content/base/test/test_mozfiledataurl.html => dom/base/test/test_mozfiledataurl.html
rename : content/base/test/test_mutationobservers.html => dom/base/test/test_mutationobservers.html
rename : content/base/test/test_nodelist_holes.html => dom/base/test/test_nodelist_holes.html
rename : content/base/test/test_object.html => dom/base/test/test_object.html
rename : content/base/test/test_plugin_freezing.html => dom/base/test/test_plugin_freezing.html
rename : content/base/test/test_processing_instruction_update_stylesheet.xhtml => dom/base/test/test_processing_instruction_update_stylesheet.xhtml
rename : content/base/test/test_progress_events_for_gzip_data.html => dom/base/test/test_progress_events_for_gzip_data.html
rename : content/base/test/test_range_bounds.html => dom/base/test/test_range_bounds.html
rename : content/base/test/test_reentrant_flush.html => dom/base/test/test_reentrant_flush.html
rename : content/base/test/test_sync_xhr_timer.xhtml => dom/base/test/test_sync_xhr_timer.xhtml
rename : content/base/test/test_text_wholeText.html => dom/base/test/test_text_wholeText.html
rename : content/base/test/test_textnode_normalize_in_selection.html => dom/base/test/test_textnode_normalize_in_selection.html
rename : content/base/test/test_textnode_split_in_selection.html => dom/base/test/test_textnode_split_in_selection.html
rename : content/base/test/test_title.html => dom/base/test/test_title.html
rename : content/base/test/test_treewalker_nextsibling.xml => dom/base/test/test_treewalker_nextsibling.xml
rename : content/base/test/test_user_select.html => dom/base/test/test_user_select.html
rename : content/base/test/test_viewport_scroll.html => dom/base/test/test_viewport_scroll.html
rename : content/base/test/test_viewsource_forbidden_in_object.html => dom/base/test/test_viewsource_forbidden_in_object.html
rename : content/base/test/test_w3element_traversal.html => dom/base/test/test_w3element_traversal.html
rename : content/base/test/test_w3element_traversal.xhtml => dom/base/test/test_w3element_traversal.xhtml
rename : content/base/test/test_w3element_traversal_svg.html => dom/base/test/test_w3element_traversal_svg.html
rename : content/base/test/test_warning_for_blocked_cross_site_request.html => dom/base/test/test_warning_for_blocked_cross_site_request.html
rename : content/base/test/test_websocket.html => dom/base/test/test_websocket.html
rename : content/base/test/test_websocket_basic.html => dom/base/test/test_websocket_basic.html
rename : content/base/test/test_websocket_hello.html => dom/base/test/test_websocket_hello.html
rename : content/base/test/test_x-frame-options.html => dom/base/test/test_x-frame-options.html
rename : content/base/test/test_xbl_userdata.xhtml => dom/base/test/test_xbl_userdata.xhtml
rename : content/base/test/test_xhr_abort_after_load.html => dom/base/test/test_xhr_abort_after_load.html
rename : content/base/test/test_xhr_forbidden_headers.html => dom/base/test/test_xhr_forbidden_headers.html
rename : content/base/test/test_xhr_progressevents.html => dom/base/test/test_xhr_progressevents.html
rename : content/base/test/test_xhr_send_readystate.html => dom/base/test/test_xhr_send_readystate.html
rename : content/base/test/test_xhr_withCredentials.html => dom/base/test/test_xhr_withCredentials.html
rename : content/base/test/unit/1_original.xml => dom/base/test/unit/1_original.xml
rename : content/base/test/unit/1_result.xml => dom/base/test/unit/1_result.xml
rename : content/base/test/unit/2_original.xml => dom/base/test/unit/2_original.xml
rename : content/base/test/unit/2_result_1.xml => dom/base/test/unit/2_result_1.xml
rename : content/base/test/unit/2_result_2.xml => dom/base/test/unit/2_result_2.xml
rename : content/base/test/unit/2_result_3.xml => dom/base/test/unit/2_result_3.xml
rename : content/base/test/unit/2_result_4.xml => dom/base/test/unit/2_result_4.xml
rename : content/base/test/unit/3_original.xml => dom/base/test/unit/3_original.xml
rename : content/base/test/unit/3_result.xml => dom/base/test/unit/3_result.xml
rename : content/base/test/unit/3_result_2.xml => dom/base/test/unit/3_result_2.xml
rename : content/base/test/unit/4_original.xml => dom/base/test/unit/4_original.xml
rename : content/base/test/unit/4_result_1.xml => dom/base/test/unit/4_result_1.xml
rename : content/base/test/unit/4_result_2.xml => dom/base/test/unit/4_result_2.xml
rename : content/base/test/unit/4_result_3.xml => dom/base/test/unit/4_result_3.xml
rename : content/base/test/unit/4_result_4.xml => dom/base/test/unit/4_result_4.xml
rename : content/base/test/unit/4_result_5.xml => dom/base/test/unit/4_result_5.xml
rename : content/base/test/unit/4_result_6.xml => dom/base/test/unit/4_result_6.xml
rename : content/base/test/unit/head_utilities.js => dom/base/test/unit/head_utilities.js
rename : content/base/test/unit/test_bug553888.js => dom/base/test/unit/test_bug553888.js
rename : content/base/test/unit/test_bug737966.js => dom/base/test/unit/test_bug737966.js
rename : content/base/test/unit/test_cspreports.js => dom/base/test/unit/test_cspreports.js
rename : content/base/test/unit/test_error_codes.js => dom/base/test/unit/test_error_codes.js
rename : content/base/test/unit/test_thirdpartyutil.js => dom/base/test/unit/test_thirdpartyutil.js
rename : content/base/test/unit/test_xhr_document.js => dom/base/test/unit/test_xhr_document.js
rename : content/base/test/unit/test_xhr_standalone.js => dom/base/test/unit/test_xhr_standalone.js
rename : content/base/test/unit/test_xmlserializer.js => dom/base/test/unit/test_xmlserializer.js
rename : content/base/test/unit/xpcshell.ini => dom/base/test/unit/xpcshell.ini
rename : content/base/test/unit_ipc/test_bug553888_wrap.js => dom/base/test/unit_ipc/test_bug553888_wrap.js
rename : content/base/test/unit_ipc/test_xhr_document_ipc.js => dom/base/test/unit_ipc/test_xhr_document_ipc.js
rename : content/base/test/unit_ipc/xpcshell.ini => dom/base/test/unit_ipc/xpcshell.ini
rename : content/base/test/variable_style_sheet.sjs => dom/base/test/variable_style_sheet.sjs
rename : content/base/test/viewport_helpers.js => dom/base/test/viewport_helpers.js
rename : content/base/test/w3element_traversal.svg => dom/base/test/w3element_traversal.svg
rename : content/base/test/websocket_hybi/file_binary-frames_wsh.py => dom/base/test/websocket_hybi/file_binary-frames_wsh.py
rename : content/base/test/websocket_hybi/file_check-binary-messages_wsh.py => dom/base/test/websocket_hybi/file_check-binary-messages_wsh.py
rename : content/base/test/websocket_hybi/mochitest.ini => dom/base/test/websocket_hybi/mochitest.ini
rename : content/base/test/websocket_hybi/test_receive-arraybuffer.html => dom/base/test/websocket_hybi/test_receive-arraybuffer.html
rename : content/base/test/websocket_hybi/test_receive-blob.html => dom/base/test/websocket_hybi/test_receive-blob.html
rename : content/base/test/websocket_hybi/test_send-arraybuffer.html => dom/base/test/websocket_hybi/test_send-arraybuffer.html
rename : content/base/test/websocket_hybi/test_send-blob.html => dom/base/test/websocket_hybi/test_send-blob.html
rename : content/base/test/wholeTexty-helper.xml => dom/base/test/wholeTexty-helper.xml
2014-10-25 20:25:22 +03:00

4126 lines
126 KiB
C++

/* -*- 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 "nsXMLHttpRequest.h"
#ifndef XP_WIN
#include <unistd.h>
#endif
#include "mozilla/ArrayUtils.h"
#include "mozilla/dom/BlobSet.h"
#include "mozilla/dom/File.h"
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/LoadInfo.h"
#include "mozilla/MemoryReporting.h"
#include "nsIDOMDocument.h"
#include "mozilla/dom/ProgressEvent.h"
#include "nsIJARChannel.h"
#include "nsIJARURI.h"
#include "nsLayoutCID.h"
#include "nsReadableUtils.h"
#include "nsIURI.h"
#include "nsILoadGroup.h"
#include "nsNetUtil.h"
#include "nsStreamUtils.h"
#include "nsThreadUtils.h"
#include "nsIUploadChannel.h"
#include "nsIUploadChannel2.h"
#include "nsIDOMSerializer.h"
#include "nsXPCOM.h"
#include "nsIDOMEventListener.h"
#include "nsIScriptSecurityManager.h"
#include "nsIDOMWindow.h"
#include "nsIVariant.h"
#include "nsVariant.h"
#include "nsIScriptError.h"
#include "nsIStreamConverterService.h"
#include "nsICachingChannel.h"
#include "nsContentUtils.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIContentPolicy.h"
#include "nsContentPolicyUtils.h"
#include "nsError.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsIHTMLDocument.h"
#include "nsIStorageStream.h"
#include "nsIPromptFactory.h"
#include "nsIWindowWatcher.h"
#include "nsIConsoleService.h"
#include "nsIContentSecurityPolicy.h"
#include "nsAsyncRedirectVerifyHelper.h"
#include "nsStringBuffer.h"
#include "nsIFileChannel.h"
#include "mozilla/Telemetry.h"
#include "jsfriendapi.h"
#include "GeckoProfiler.h"
#include "mozilla/dom/EncodingUtils.h"
#include "nsIUnicodeDecoder.h"
#include "mozilla/dom/XMLHttpRequestBinding.h"
#include "mozilla/Attributes.h"
#include "nsIPermissionManager.h"
#include "nsMimeTypes.h"
#include "nsIHttpChannelInternal.h"
#include "nsCharSeparatedTokenizer.h"
#include "nsFormData.h"
#include "nsStreamListenerWrapper.h"
#include "xpcjsid.h"
#include "nsITimedChannel.h"
#include "nsWrapperCacheInlines.h"
#include "nsZipArchive.h"
#include "mozilla/Preferences.h"
#include "private/pprio.h"
using namespace mozilla;
using namespace mozilla::dom;
// Maximum size that we'll grow an ArrayBuffer instead of doubling,
// once doubling reaches this threshold
#define XML_HTTP_REQUEST_ARRAYBUFFER_MAX_GROWTH (32*1024*1024)
// start at 32k to avoid lots of doubling right at the start
#define XML_HTTP_REQUEST_ARRAYBUFFER_MIN_SIZE (32*1024)
// the maximum Content-Length that we'll preallocate. 1GB. Must fit
// in an int32_t!
#define XML_HTTP_REQUEST_MAX_CONTENT_LENGTH_PREALLOCATE (1*1024*1024*1024LL)
#define LOAD_STR "load"
#define ERROR_STR "error"
#define ABORT_STR "abort"
#define TIMEOUT_STR "timeout"
#define LOADSTART_STR "loadstart"
#define PROGRESS_STR "progress"
#define READYSTATE_STR "readystatechange"
#define LOADEND_STR "loadend"
// CIDs
// State
#define XML_HTTP_REQUEST_UNSENT (1 << 0) // 0 UNSENT
#define XML_HTTP_REQUEST_OPENED (1 << 1) // 1 OPENED
#define XML_HTTP_REQUEST_HEADERS_RECEIVED (1 << 2) // 2 HEADERS_RECEIVED
#define XML_HTTP_REQUEST_LOADING (1 << 3) // 3 LOADING
#define XML_HTTP_REQUEST_DONE (1 << 4) // 4 DONE
#define XML_HTTP_REQUEST_SENT (1 << 5) // Internal, OPENED in IE and external view
// The above states are mutually exclusive, change with ChangeState() only.
// The states below can be combined.
#define XML_HTTP_REQUEST_ABORTED (1 << 7) // Internal
#define XML_HTTP_REQUEST_ASYNC (1 << 8) // Internal
#define XML_HTTP_REQUEST_PARSEBODY (1 << 9) // Internal
#define XML_HTTP_REQUEST_SYNCLOOPING (1 << 10) // Internal
#define XML_HTTP_REQUEST_BACKGROUND (1 << 13) // Internal
#define XML_HTTP_REQUEST_USE_XSITE_AC (1 << 14) // Internal
#define XML_HTTP_REQUEST_NEED_AC_PREFLIGHT (1 << 15) // Internal
#define XML_HTTP_REQUEST_AC_WITH_CREDENTIALS (1 << 16) // Internal
#define XML_HTTP_REQUEST_TIMED_OUT (1 << 17) // Internal
#define XML_HTTP_REQUEST_DELETED (1 << 18) // Internal
#define XML_HTTP_REQUEST_LOADSTATES \
(XML_HTTP_REQUEST_UNSENT | \
XML_HTTP_REQUEST_OPENED | \
XML_HTTP_REQUEST_HEADERS_RECEIVED | \
XML_HTTP_REQUEST_LOADING | \
XML_HTTP_REQUEST_DONE | \
XML_HTTP_REQUEST_SENT)
#define NS_BADCERTHANDLER_CONTRACTID \
"@mozilla.org/content/xmlhttprequest-bad-cert-handler;1"
#define NS_PROGRESS_EVENT_INTERVAL 50
#define IMPL_CSTRING_GETTER(_name) \
NS_IMETHODIMP \
nsXMLHttpRequest::_name(nsACString& aOut) \
{ \
nsCString tmp; \
_name(tmp); \
aOut = tmp; \
return NS_OK; \
}
NS_IMPL_ISUPPORTS(nsXHRParseEndListener, nsIDOMEventListener)
class nsResumeTimeoutsEvent : public nsRunnable
{
public:
explicit nsResumeTimeoutsEvent(nsPIDOMWindow* aWindow) : mWindow(aWindow) {}
NS_IMETHOD Run()
{
mWindow->ResumeTimeouts(false);
return NS_OK;
}
private:
nsCOMPtr<nsPIDOMWindow> mWindow;
};
// This helper function adds the given load flags to the request's existing
// load flags.
static void AddLoadFlags(nsIRequest *request, nsLoadFlags newFlags)
{
nsLoadFlags flags;
request->GetLoadFlags(&flags);
flags |= newFlags;
request->SetLoadFlags(flags);
}
//-----------------------------------------------------------------------------
// XMLHttpRequestAuthPrompt
//-----------------------------------------------------------------------------
class XMLHttpRequestAuthPrompt : public nsIAuthPrompt
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIAUTHPROMPT
XMLHttpRequestAuthPrompt();
protected:
virtual ~XMLHttpRequestAuthPrompt();
};
NS_IMPL_ISUPPORTS(XMLHttpRequestAuthPrompt, nsIAuthPrompt)
XMLHttpRequestAuthPrompt::XMLHttpRequestAuthPrompt()
{
MOZ_COUNT_CTOR(XMLHttpRequestAuthPrompt);
}
XMLHttpRequestAuthPrompt::~XMLHttpRequestAuthPrompt()
{
MOZ_COUNT_DTOR(XMLHttpRequestAuthPrompt);
}
NS_IMETHODIMP
XMLHttpRequestAuthPrompt::Prompt(const char16_t* aDialogTitle,
const char16_t* aText,
const char16_t* aPasswordRealm,
uint32_t aSavePassword,
const char16_t* aDefaultText,
char16_t** aResult,
bool* aRetval)
{
*aRetval = false;
return NS_OK;
}
NS_IMETHODIMP
XMLHttpRequestAuthPrompt::PromptUsernameAndPassword(const char16_t* aDialogTitle,
const char16_t* aDialogText,
const char16_t* aPasswordRealm,
uint32_t aSavePassword,
char16_t** aUser,
char16_t** aPwd,
bool* aRetval)
{
*aRetval = false;
return NS_OK;
}
NS_IMETHODIMP
XMLHttpRequestAuthPrompt::PromptPassword(const char16_t* aDialogTitle,
const char16_t* aText,
const char16_t* aPasswordRealm,
uint32_t aSavePassword,
char16_t** aPwd,
bool* aRetval)
{
*aRetval = false;
return NS_OK;
}
/////////////////////////////////////////////
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXHREventTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXHREventTarget,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXHREventTarget,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXHREventTarget)
NS_INTERFACE_MAP_ENTRY(nsIXMLHttpRequestEventTarget)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(nsXHREventTarget, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsXHREventTarget, DOMEventTargetHelper)
void
nsXHREventTarget::DisconnectFromOwner()
{
DOMEventTargetHelper::DisconnectFromOwner();
}
/////////////////////////////////////////////
NS_INTERFACE_MAP_BEGIN(nsXMLHttpRequestUpload)
NS_INTERFACE_MAP_ENTRY(nsIXMLHttpRequestUpload)
NS_INTERFACE_MAP_END_INHERITING(nsXHREventTarget)
NS_IMPL_ADDREF_INHERITED(nsXMLHttpRequestUpload, nsXHREventTarget)
NS_IMPL_RELEASE_INHERITED(nsXMLHttpRequestUpload, nsXHREventTarget)
/* virtual */ JSObject*
nsXMLHttpRequestUpload::WrapObject(JSContext* aCx)
{
return XMLHttpRequestUploadBinding::Wrap(aCx, this);
}
/////////////////////////////////////////////
//
//
/////////////////////////////////////////////
bool
nsXMLHttpRequest::sDontWarnAboutSyncXHR = false;
nsXMLHttpRequest::nsXMLHttpRequest()
: mResponseBodyDecodedPos(0),
mResponseType(XML_HTTP_RESPONSE_TYPE_DEFAULT),
mRequestObserver(nullptr), mState(XML_HTTP_REQUEST_UNSENT),
mUploadTransferred(0), mUploadTotal(0), mUploadComplete(true),
mProgressSinceLastProgressEvent(false),
mRequestSentTime(0), mTimeoutMilliseconds(0),
mErrorLoad(false), mWaitingForOnStopRequest(false),
mProgressTimerIsActive(false),
mIsHtml(false),
mWarnAboutSyncHtml(false),
mLoadLengthComputable(false), mLoadTotal(0),
mIsSystem(false),
mIsAnon(false),
mFirstStartRequestSeen(false),
mInLoadProgressEvent(false),
mResultJSON(JSVAL_VOID),
mResultArrayBuffer(nullptr),
mIsMappedArrayBuffer(false),
mXPCOMifier(nullptr)
{
#ifdef DEBUG
StaticAssertions();
#endif
}
nsXMLHttpRequest::~nsXMLHttpRequest()
{
mState |= XML_HTTP_REQUEST_DELETED;
if (mState & (XML_HTTP_REQUEST_SENT |
XML_HTTP_REQUEST_LOADING)) {
Abort();
}
NS_ABORT_IF_FALSE(!(mState & XML_HTTP_REQUEST_SYNCLOOPING), "we rather crash than hang");
mState &= ~XML_HTTP_REQUEST_SYNCLOOPING;
mResultJSON = JSVAL_VOID;
mResultArrayBuffer = nullptr;
mozilla::DropJSObjects(this);
}
void
nsXMLHttpRequest::RootJSResultObjects()
{
mozilla::HoldJSObjects(this);
}
/**
* This Init method is called from the factory constructor.
*/
nsresult
nsXMLHttpRequest::Init()
{
nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager();
nsCOMPtr<nsIPrincipal> subjectPrincipal;
if (secMan) {
secMan->GetSystemPrincipal(getter_AddRefs(subjectPrincipal));
}
NS_ENSURE_STATE(subjectPrincipal);
// Instead of grabbing some random global from the context stack,
// let's use the default one (junk scope) for now.
// We should move away from this Init...
Construct(subjectPrincipal, xpc::NativeGlobal(xpc::PrivilegedJunkScope()));
return NS_OK;
}
/**
* This Init method should only be called by C++ consumers.
*/
NS_IMETHODIMP
nsXMLHttpRequest::Init(nsIPrincipal* aPrincipal,
nsIScriptContext* aScriptContext,
nsIGlobalObject* aGlobalObject,
nsIURI* aBaseURI)
{
NS_ENSURE_ARG_POINTER(aPrincipal);
if (nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aGlobalObject)) {
if (win->IsOuterWindow()) {
// Must be bound to inner window, innerize if necessary.
nsCOMPtr<nsIGlobalObject> inner = do_QueryInterface(
win->GetCurrentInnerWindow());
aGlobalObject = inner.get();
}
}
Construct(aPrincipal, aGlobalObject, aBaseURI);
return NS_OK;
}
void
nsXMLHttpRequest::InitParameters(bool aAnon, bool aSystem)
{
if (!aAnon && !aSystem) {
return;
}
// Check for permissions.
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(GetOwner());
if (!window || !window->GetDocShell()) {
return;
}
// Chrome is always allowed access, so do the permission check only
// for non-chrome pages.
if (!IsSystemXHR() && aSystem) {
nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
if (!doc) {
return;
}
nsCOMPtr<nsIPrincipal> principal = doc->NodePrincipal();
nsCOMPtr<nsIPermissionManager> permMgr =
services::GetPermissionManager();
if (!permMgr)
return;
uint32_t permission;
nsresult rv =
permMgr->TestPermissionFromPrincipal(principal, "systemXHR", &permission);
if (NS_FAILED(rv) || permission != nsIPermissionManager::ALLOW_ACTION) {
return;
}
}
SetParameters(aAnon, aSystem);
}
void
nsXMLHttpRequest::ResetResponse()
{
mResponseXML = nullptr;
mResponseBody.Truncate();
mResponseText.Truncate();
mResponseBlob = nullptr;
mDOMFile = nullptr;
mBlobSet = nullptr;
mResultArrayBuffer = nullptr;
mArrayBufferBuilder.reset();
mResultJSON = JSVAL_VOID;
mDataAvailable = 0;
mLoadTransferred = 0;
mResponseBodyDecodedPos = 0;
}
void
nsXMLHttpRequest::SetRequestObserver(nsIRequestObserver* aObserver)
{
mRequestObserver = aObserver;
}
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXMLHttpRequest)
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsXMLHttpRequest)
bool isBlack = tmp->IsBlack();
if (isBlack || tmp->mWaitingForOnStopRequest) {
if (tmp->mListenerManager) {
tmp->mListenerManager->MarkForCC();
}
if (!isBlack && tmp->PreservingWrapper()) {
// This marks the wrapper black.
tmp->GetWrapper();
}
return true;
}
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsXMLHttpRequest)
return tmp->
IsBlackAndDoesNotNeedTracing(static_cast<DOMEventTargetHelper*>(tmp));
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsXMLHttpRequest)
return tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXMLHttpRequest,
nsXHREventTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContext)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChannel)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mResponseXML)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCORSPreflightChannel)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXMLParserStreamListener)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mResponseBlob)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDOMFile)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotificationCallbacks)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChannelEventSink)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mProgressEventSink)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mUpload)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXMLHttpRequest,
nsXHREventTarget)
tmp->mResultArrayBuffer = nullptr;
tmp->mArrayBufferBuilder.reset();
tmp->mResultJSON = JSVAL_VOID;
NS_IMPL_CYCLE_COLLECTION_UNLINK(mContext)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mChannel)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mResponseXML)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCORSPreflightChannel)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mXMLParserStreamListener)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mResponseBlob)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDOMFile)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mNotificationCallbacks)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mChannelEventSink)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mProgressEventSink)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mUpload)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(nsXMLHttpRequest,
nsXHREventTarget)
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResultArrayBuffer)
NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResultJSON)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
// QueryInterface implementation for nsXMLHttpRequest
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXMLHttpRequest)
NS_INTERFACE_MAP_ENTRY(nsIXMLHttpRequest)
NS_INTERFACE_MAP_ENTRY(nsIJSXMLHttpRequest)
NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
NS_INTERFACE_MAP_ENTRY(nsIProgressEventSink)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsISizeOfEventTarget)
NS_INTERFACE_MAP_END_INHERITING(nsXHREventTarget)
NS_IMPL_ADDREF_INHERITED(nsXMLHttpRequest, nsXHREventTarget)
NS_IMPL_RELEASE_INHERITED(nsXMLHttpRequest, nsXHREventTarget)
NS_IMPL_EVENT_HANDLER(nsXMLHttpRequest, readystatechange)
void
nsXMLHttpRequest::DisconnectFromOwner()
{
nsXHREventTarget::DisconnectFromOwner();
Abort();
}
size_t
nsXMLHttpRequest::SizeOfEventTargetIncludingThis(
MallocSizeOf aMallocSizeOf) const
{
size_t n = aMallocSizeOf(this);
n += mResponseBody.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
// Why is this safe? Because no-one else will report this string. The
// other possible sharers of this string are as follows.
//
// - The JS engine could hold copies if the JS code holds references, e.g.
// |var text = XHR.responseText|. However, those references will be via JS
// external strings, for which the JS memory reporter does *not* report the
// chars.
//
// - Binary extensions, but they're *extremely* unlikely to do any memory
// reporting.
//
n += mResponseText.SizeOfExcludingThisEvenIfShared(aMallocSizeOf);
return n;
// Measurement of the following members may be added later if DMD finds it is
// worthwhile:
// - lots
}
/* readonly attribute nsIChannel channel; */
NS_IMETHODIMP
nsXMLHttpRequest::GetChannel(nsIChannel **aChannel)
{
NS_ENSURE_ARG_POINTER(aChannel);
NS_IF_ADDREF(*aChannel = mChannel);
return NS_OK;
}
static void LogMessage(const char* aWarning, nsPIDOMWindow* aWindow)
{
nsCOMPtr<nsIDocument> doc;
if (aWindow) {
doc = aWindow->GetExtantDoc();
}
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM"), doc,
nsContentUtils::eDOM_PROPERTIES,
aWarning);
}
/* readonly attribute nsIDOMDocument responseXML; */
NS_IMETHODIMP
nsXMLHttpRequest::GetResponseXML(nsIDOMDocument **aResponseXML)
{
ErrorResult rv;
nsIDocument* responseXML = GetResponseXML(rv);
if (rv.Failed()) {
return rv.ErrorCode();
}
if (!responseXML) {
*aResponseXML = nullptr;
return NS_OK;
}
return CallQueryInterface(responseXML, aResponseXML);
}
nsIDocument*
nsXMLHttpRequest::GetResponseXML(ErrorResult& aRv)
{
if (mResponseType != XML_HTTP_RESPONSE_TYPE_DEFAULT &&
mResponseType != XML_HTTP_RESPONSE_TYPE_DOCUMENT) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
if (mWarnAboutSyncHtml) {
mWarnAboutSyncHtml = false;
LogMessage("HTMLSyncXHRWarning", GetOwner());
}
return (XML_HTTP_REQUEST_DONE & mState) ? mResponseXML : nullptr;
}
/*
* This piece copied from XMLDocument, we try to get the charset
* from HTTP headers.
*/
nsresult
nsXMLHttpRequest::DetectCharset()
{
mResponseCharset.Truncate();
mDecoder = nullptr;
if (mResponseType != XML_HTTP_RESPONSE_TYPE_DEFAULT &&
mResponseType != XML_HTTP_RESPONSE_TYPE_TEXT &&
mResponseType != XML_HTTP_RESPONSE_TYPE_JSON &&
mResponseType != XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT) {
return NS_OK;
}
nsAutoCString charsetVal;
bool ok = mChannel &&
NS_SUCCEEDED(mChannel->GetContentCharset(charsetVal)) &&
EncodingUtils::FindEncodingForLabel(charsetVal, mResponseCharset);
if (!ok || mResponseCharset.IsEmpty()) {
// MS documentation states UTF-8 is default for responseText
mResponseCharset.AssignLiteral("UTF-8");
}
if (mResponseType == XML_HTTP_RESPONSE_TYPE_JSON &&
!mResponseCharset.EqualsLiteral("UTF-8")) {
// The XHR spec says only UTF-8 is supported for responseType == "json"
LogMessage("JSONCharsetWarning", GetOwner());
mResponseCharset.AssignLiteral("UTF-8");
}
mDecoder = EncodingUtils::DecoderForEncoding(mResponseCharset);
return NS_OK;
}
nsresult
nsXMLHttpRequest::AppendToResponseText(const char * aSrcBuffer,
uint32_t aSrcBufferLen)
{
NS_ENSURE_STATE(mDecoder);
int32_t destBufferLen;
nsresult rv = mDecoder->GetMaxLength(aSrcBuffer, aSrcBufferLen,
&destBufferLen);
NS_ENSURE_SUCCESS(rv, rv);
if (!mResponseText.SetCapacity(mResponseText.Length() + destBufferLen, fallible_t())) {
return NS_ERROR_OUT_OF_MEMORY;
}
char16_t* destBuffer = mResponseText.BeginWriting() + mResponseText.Length();
int32_t totalChars = mResponseText.Length();
// This code here is basically a copy of a similar thing in
// nsScanner::Append(const char* aBuffer, uint32_t aLen).
int32_t srclen = (int32_t)aSrcBufferLen;
int32_t destlen = (int32_t)destBufferLen;
rv = mDecoder->Convert(aSrcBuffer,
&srclen,
destBuffer,
&destlen);
MOZ_ASSERT(NS_SUCCEEDED(rv));
totalChars += destlen;
mResponseText.SetLength(totalChars);
return NS_OK;
}
/* readonly attribute AString responseText; */
NS_IMETHODIMP
nsXMLHttpRequest::GetResponseText(nsAString& aResponseText)
{
ErrorResult rv;
nsString responseText;
GetResponseText(responseText, rv);
aResponseText = responseText;
return rv.ErrorCode();
}
void
nsXMLHttpRequest::GetResponseText(nsString& aResponseText, ErrorResult& aRv)
{
aResponseText.Truncate();
if (mResponseType != XML_HTTP_RESPONSE_TYPE_DEFAULT &&
mResponseType != XML_HTTP_RESPONSE_TYPE_TEXT &&
mResponseType != XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT &&
!mInLoadProgressEvent) {
aResponseText.SetIsVoid(true);
return;
}
if (!(mState & (XML_HTTP_REQUEST_DONE | XML_HTTP_REQUEST_LOADING))) {
return;
}
// We only decode text lazily if we're also parsing to a doc.
// Also, if we've decoded all current data already, then no need to decode
// more.
if (!mResponseXML ||
mResponseBodyDecodedPos == mResponseBody.Length()) {
aResponseText = mResponseText;
return;
}
if (mResponseCharset != mResponseXML->GetDocumentCharacterSet()) {
mResponseCharset = mResponseXML->GetDocumentCharacterSet();
mResponseText.Truncate();
mResponseBodyDecodedPos = 0;
mDecoder = EncodingUtils::DecoderForEncoding(mResponseCharset);
}
NS_ASSERTION(mResponseBodyDecodedPos < mResponseBody.Length(),
"Unexpected mResponseBodyDecodedPos");
aRv = AppendToResponseText(mResponseBody.get() + mResponseBodyDecodedPos,
mResponseBody.Length() - mResponseBodyDecodedPos);
if (aRv.Failed()) {
return;
}
mResponseBodyDecodedPos = mResponseBody.Length();
if (mState & XML_HTTP_REQUEST_DONE) {
// Free memory buffer which we no longer need
mResponseBody.Truncate();
mResponseBodyDecodedPos = 0;
}
aResponseText = mResponseText;
}
nsresult
nsXMLHttpRequest::CreateResponseParsedJSON(JSContext* aCx)
{
if (!aCx) {
return NS_ERROR_FAILURE;
}
RootJSResultObjects();
// The Unicode converter has already zapped the BOM if there was one
JS::Rooted<JS::Value> value(aCx);
if (!JS_ParseJSON(aCx,
static_cast<const char16_t*>(mResponseText.get()), mResponseText.Length(),
&value)) {
return NS_ERROR_FAILURE;
}
mResultJSON = value;
return NS_OK;
}
void
nsXMLHttpRequest::CreatePartialBlob()
{
if (mDOMFile) {
// Use progress info to determine whether load is complete, but use
// mDataAvailable to ensure a slice is created based on the uncompressed
// data count.
if (mLoadTotal == mLoadTransferred) {
mResponseBlob = mDOMFile;
} else {
ErrorResult rv;
mResponseBlob = mDOMFile->CreateSlice(0, mDataAvailable,
EmptyString(), rv);
}
return;
}
// mBlobSet can be null if the request has been canceled
if (!mBlobSet) {
return;
}
nsAutoCString contentType;
if (mLoadTotal == mLoadTransferred) {
mChannel->GetContentType(contentType);
}
mResponseBlob = mBlobSet->GetBlobInternal(GetOwner(), contentType);
}
/* attribute AString responseType; */
NS_IMETHODIMP nsXMLHttpRequest::GetResponseType(nsAString& aResponseType)
{
switch (mResponseType) {
case XML_HTTP_RESPONSE_TYPE_DEFAULT:
aResponseType.Truncate();
break;
case XML_HTTP_RESPONSE_TYPE_ARRAYBUFFER:
aResponseType.AssignLiteral("arraybuffer");
break;
case XML_HTTP_RESPONSE_TYPE_BLOB:
aResponseType.AssignLiteral("blob");
break;
case XML_HTTP_RESPONSE_TYPE_DOCUMENT:
aResponseType.AssignLiteral("document");
break;
case XML_HTTP_RESPONSE_TYPE_TEXT:
aResponseType.AssignLiteral("text");
break;
case XML_HTTP_RESPONSE_TYPE_JSON:
aResponseType.AssignLiteral("json");
break;
case XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT:
aResponseType.AssignLiteral("moz-chunked-text");
break;
case XML_HTTP_RESPONSE_TYPE_CHUNKED_ARRAYBUFFER:
aResponseType.AssignLiteral("moz-chunked-arraybuffer");
break;
case XML_HTTP_RESPONSE_TYPE_MOZ_BLOB:
aResponseType.AssignLiteral("moz-blob");
break;
default:
NS_ERROR("Should not happen");
}
return NS_OK;
}
#ifdef DEBUG
void
nsXMLHttpRequest::StaticAssertions()
{
#define ASSERT_ENUM_EQUAL(_lc, _uc) \
static_assert(\
static_cast<int>(XMLHttpRequestResponseType::_lc) \
== XML_HTTP_RESPONSE_TYPE_ ## _uc, \
#_uc " should match")
ASSERT_ENUM_EQUAL(_empty, DEFAULT);
ASSERT_ENUM_EQUAL(Arraybuffer, ARRAYBUFFER);
ASSERT_ENUM_EQUAL(Blob, BLOB);
ASSERT_ENUM_EQUAL(Document, DOCUMENT);
ASSERT_ENUM_EQUAL(Json, JSON);
ASSERT_ENUM_EQUAL(Text, TEXT);
ASSERT_ENUM_EQUAL(Moz_chunked_text, CHUNKED_TEXT);
ASSERT_ENUM_EQUAL(Moz_chunked_arraybuffer, CHUNKED_ARRAYBUFFER);
ASSERT_ENUM_EQUAL(Moz_blob, MOZ_BLOB);
#undef ASSERT_ENUM_EQUAL
}
#endif
/* attribute AString responseType; */
NS_IMETHODIMP nsXMLHttpRequest::SetResponseType(const nsAString& aResponseType)
{
nsXMLHttpRequest::ResponseTypeEnum responseType;
if (aResponseType.IsEmpty()) {
responseType = XML_HTTP_RESPONSE_TYPE_DEFAULT;
} else if (aResponseType.EqualsLiteral("arraybuffer")) {
responseType = XML_HTTP_RESPONSE_TYPE_ARRAYBUFFER;
} else if (aResponseType.EqualsLiteral("blob")) {
responseType = XML_HTTP_RESPONSE_TYPE_BLOB;
} else if (aResponseType.EqualsLiteral("document")) {
responseType = XML_HTTP_RESPONSE_TYPE_DOCUMENT;
} else if (aResponseType.EqualsLiteral("text")) {
responseType = XML_HTTP_RESPONSE_TYPE_TEXT;
} else if (aResponseType.EqualsLiteral("json")) {
responseType = XML_HTTP_RESPONSE_TYPE_JSON;
} else if (aResponseType.EqualsLiteral("moz-chunked-text")) {
responseType = XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT;
} else if (aResponseType.EqualsLiteral("moz-chunked-arraybuffer")) {
responseType = XML_HTTP_RESPONSE_TYPE_CHUNKED_ARRAYBUFFER;
} else if (aResponseType.EqualsLiteral("moz-blob")) {
responseType = XML_HTTP_RESPONSE_TYPE_MOZ_BLOB;
} else {
return NS_OK;
}
ErrorResult rv;
SetResponseType(responseType, rv);
return rv.ErrorCode();
}
void
nsXMLHttpRequest::SetResponseType(XMLHttpRequestResponseType aType,
ErrorResult& aRv)
{
SetResponseType(ResponseTypeEnum(static_cast<int>(aType)), aRv);
}
void
nsXMLHttpRequest::SetResponseType(nsXMLHttpRequest::ResponseTypeEnum aResponseType,
ErrorResult& aRv)
{
// If the state is not OPENED or HEADERS_RECEIVED raise an
// INVALID_STATE_ERR exception and terminate these steps.
if (!(mState & (XML_HTTP_REQUEST_OPENED | XML_HTTP_REQUEST_SENT |
XML_HTTP_REQUEST_HEADERS_RECEIVED))) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
// sync request is not allowed setting responseType in window context
if (HasOrHasHadOwner() &&
!(mState & (XML_HTTP_REQUEST_UNSENT | XML_HTTP_REQUEST_ASYNC))) {
LogMessage("ResponseTypeSyncXHRWarning", GetOwner());
aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
return;
}
if (!(mState & XML_HTTP_REQUEST_ASYNC) &&
(aResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT ||
aResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_ARRAYBUFFER)) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
// Set the responseType attribute's value to the given value.
mResponseType = aResponseType;
}
/* readonly attribute jsval response; */
NS_IMETHODIMP
nsXMLHttpRequest::GetResponse(JSContext *aCx, JS::MutableHandle<JS::Value> aResult)
{
ErrorResult rv;
GetResponse(aCx, aResult, rv);
return rv.ErrorCode();
}
void
nsXMLHttpRequest::GetResponse(JSContext* aCx,
JS::MutableHandle<JS::Value> aResponse,
ErrorResult& aRv)
{
switch (mResponseType) {
case XML_HTTP_RESPONSE_TYPE_DEFAULT:
case XML_HTTP_RESPONSE_TYPE_TEXT:
case XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT:
{
nsString str;
aRv = GetResponseText(str);
if (aRv.Failed()) {
return;
}
if (!xpc::StringToJsval(aCx, str, aResponse)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
}
return;
}
case XML_HTTP_RESPONSE_TYPE_ARRAYBUFFER:
case XML_HTTP_RESPONSE_TYPE_CHUNKED_ARRAYBUFFER:
{
if (!(mResponseType == XML_HTTP_RESPONSE_TYPE_ARRAYBUFFER &&
mState & XML_HTTP_REQUEST_DONE) &&
!(mResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_ARRAYBUFFER &&
mInLoadProgressEvent)) {
aResponse.setNull();
return;
}
if (!mResultArrayBuffer) {
RootJSResultObjects();
mResultArrayBuffer = mArrayBufferBuilder.getArrayBuffer(aCx);
if (!mResultArrayBuffer) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
}
JS::ExposeObjectToActiveJS(mResultArrayBuffer);
aResponse.setObject(*mResultArrayBuffer);
return;
}
case XML_HTTP_RESPONSE_TYPE_BLOB:
case XML_HTTP_RESPONSE_TYPE_MOZ_BLOB:
{
if (!(mState & XML_HTTP_REQUEST_DONE)) {
if (mResponseType != XML_HTTP_RESPONSE_TYPE_MOZ_BLOB) {
aResponse.setNull();
return;
}
if (!mResponseBlob) {
CreatePartialBlob();
}
}
if (!mResponseBlob) {
aResponse.setNull();
return;
}
WrapNewBindingObject(aCx, mResponseBlob, aResponse);
return;
}
case XML_HTTP_RESPONSE_TYPE_DOCUMENT:
{
if (!(mState & XML_HTTP_REQUEST_DONE) || !mResponseXML) {
aResponse.setNull();
return;
}
aRv = nsContentUtils::WrapNative(aCx, mResponseXML, aResponse);
return;
}
case XML_HTTP_RESPONSE_TYPE_JSON:
{
if (!(mState & XML_HTTP_REQUEST_DONE)) {
aResponse.setNull();
return;
}
if (mResultJSON.isUndefined()) {
aRv = CreateResponseParsedJSON(aCx);
mResponseText.Truncate();
if (aRv.Failed()) {
// Per spec, errors aren't propagated. null is returned instead.
aRv = NS_OK;
// It would be nice to log the error to the console. That's hard to
// do without calling window.onerror as a side effect, though.
JS_ClearPendingException(aCx);
mResultJSON.setNull();
}
}
JS::ExposeValueToActiveJS(mResultJSON);
aResponse.set(mResultJSON);
return;
}
default:
NS_ERROR("Should not happen");
}
aResponse.setNull();
}
bool
nsXMLHttpRequest::IsDeniedCrossSiteRequest()
{
if ((mState & XML_HTTP_REQUEST_USE_XSITE_AC) && mChannel) {
nsresult rv;
mChannel->GetStatus(&rv);
if (NS_FAILED(rv)) {
return true;
}
}
return false;
}
/* readonly attribute AString responseURL; */
void
nsXMLHttpRequest::GetResponseURL(nsAString& aUrl)
{
aUrl.Truncate();
uint16_t readyState;
GetReadyState(&readyState);
if ((readyState == UNSENT || readyState == OPENED) || !mChannel) {
return;
}
// Make sure we don't leak responseURL information from denied cross-site
// requests.
if (IsDeniedCrossSiteRequest()) {
return;
}
nsCOMPtr<nsIURI> responseUrl;
mChannel->GetURI(getter_AddRefs(responseUrl));
if (!responseUrl) {
return;
}
nsAutoCString temp;
responseUrl->GetSpecIgnoringRef(temp);
CopyUTF8toUTF16(temp, aUrl);
}
/* readonly attribute unsigned long status; */
NS_IMETHODIMP
nsXMLHttpRequest::GetStatus(uint32_t *aStatus)
{
*aStatus = Status();
return NS_OK;
}
uint32_t
nsXMLHttpRequest::Status()
{
// Make sure we don't leak status information from denied cross-site
// requests.
if (IsDeniedCrossSiteRequest()) {
return 0;
}
uint16_t readyState = ReadyState();
if (readyState == UNSENT || readyState == OPENED) {
return 0;
}
if (mErrorLoad) {
// Let's simulate the http protocol for jar/app requests:
nsCOMPtr<nsIJARChannel> jarChannel = GetCurrentJARChannel();
if (jarChannel) {
nsresult status;
mChannel->GetStatus(&status);
if (status == NS_ERROR_FILE_NOT_FOUND) {
return 404; // Not Found
} else {
return 500; // Internal Error
}
}
return 0;
}
nsCOMPtr<nsIHttpChannel> httpChannel = GetCurrentHttpChannel();
if (!httpChannel) {
// Pretend like we got a 200 response, since our load was successful
return 200;
}
uint32_t status;
nsresult rv = httpChannel->GetResponseStatus(&status);
if (NS_FAILED(rv)) {
status = 0;
}
return status;
}
IMPL_CSTRING_GETTER(GetStatusText)
void
nsXMLHttpRequest::GetStatusText(nsCString& aStatusText)
{
// Return an empty status text on all error loads.
aStatusText.Truncate();
// Make sure we don't leak status information from denied cross-site
// requests.
if (IsDeniedCrossSiteRequest()) {
return;
}
// Check the current XHR state to see if it is valid to obtain the statusText
// value. This check is to prevent the status text for redirects from being
// available before all the redirects have been followed and HTTP headers have
// been received.
uint16_t readyState = ReadyState();
if (readyState == UNSENT || readyState == OPENED) {
return;
}
if (mErrorLoad) {
return;
}
nsCOMPtr<nsIHttpChannel> httpChannel = GetCurrentHttpChannel();
if (httpChannel) {
httpChannel->GetResponseStatusText(aStatusText);
} else {
aStatusText.AssignLiteral("OK");
}
}
void
nsXMLHttpRequest::CloseRequestWithError(const nsAString& aType,
const uint32_t aFlag)
{
if (mChannel) {
mChannel->Cancel(NS_BINDING_ABORTED);
}
if (mCORSPreflightChannel) {
mCORSPreflightChannel->Cancel(NS_BINDING_ABORTED);
}
if (mTimeoutTimer) {
mTimeoutTimer->Cancel();
}
uint32_t responseLength = mResponseBody.Length();
ResetResponse();
mState |= aFlag;
// If we're in the destructor, don't risk dispatching an event.
if (mState & XML_HTTP_REQUEST_DELETED) {
mState &= ~XML_HTTP_REQUEST_SYNCLOOPING;
return;
}
if (!(mState & (XML_HTTP_REQUEST_UNSENT |
XML_HTTP_REQUEST_OPENED |
XML_HTTP_REQUEST_DONE))) {
ChangeState(XML_HTTP_REQUEST_DONE, true);
if (!(mState & XML_HTTP_REQUEST_SYNCLOOPING)) {
DispatchProgressEvent(this, aType, mLoadLengthComputable, responseLength,
mLoadTotal);
if (mUpload && !mUploadComplete) {
mUploadComplete = true;
DispatchProgressEvent(mUpload, aType, true, mUploadTransferred,
mUploadTotal);
}
}
}
// The ChangeState call above calls onreadystatechange handlers which
// if they load a new url will cause nsXMLHttpRequest::Open to clear
// the abort state bit. If this occurs we're not uninitialized (bug 361773).
if (mState & XML_HTTP_REQUEST_ABORTED) {
ChangeState(XML_HTTP_REQUEST_UNSENT, false); // IE seems to do it
}
mState &= ~XML_HTTP_REQUEST_SYNCLOOPING;
}
/* void abort (); */
void
nsXMLHttpRequest::Abort()
{
CloseRequestWithError(NS_LITERAL_STRING(ABORT_STR), XML_HTTP_REQUEST_ABORTED);
}
NS_IMETHODIMP
nsXMLHttpRequest::SlowAbort()
{
Abort();
return NS_OK;
}
/*Method that checks if it is safe to expose a header value to the client.
It is used to check what headers are exposed for CORS requests.*/
bool
nsXMLHttpRequest::IsSafeHeader(const nsACString& header, nsIHttpChannel* httpChannel)
{
// See bug #380418. Hide "Set-Cookie" headers from non-chrome scripts.
if (!IsSystemXHR() && nsContentUtils::IsForbiddenResponseHeader(header)) {
NS_WARNING("blocked access to response header");
return false;
}
// if this is not a CORS call all headers are safe
if (!(mState & XML_HTTP_REQUEST_USE_XSITE_AC)){
return true;
}
// Check for dangerous headers
// Make sure we don't leak header information from denied cross-site
// requests.
if (mChannel) {
nsresult status;
mChannel->GetStatus(&status);
if (NS_FAILED(status)) {
return false;
}
}
const char* kCrossOriginSafeHeaders[] = {
"cache-control", "content-language", "content-type", "expires",
"last-modified", "pragma"
};
for (uint32_t i = 0; i < ArrayLength(kCrossOriginSafeHeaders); ++i) {
if (header.LowerCaseEqualsASCII(kCrossOriginSafeHeaders[i])) {
return true;
}
}
nsAutoCString headerVal;
// The "Access-Control-Expose-Headers" header contains a comma separated
// list of method names.
httpChannel->
GetResponseHeader(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"),
headerVal);
nsCCharSeparatedTokenizer exposeTokens(headerVal, ',');
bool isSafe = false;
while (exposeTokens.hasMoreTokens()) {
const nsDependentCSubstring& token = exposeTokens.nextToken();
if (token.IsEmpty()) {
continue;
}
if (!NS_IsValidHTTPToken(token)) {
return false;
}
if (header.Equals(token, nsCaseInsensitiveCStringComparator())) {
isSafe = true;
}
}
return isSafe;
}
/* ByteString getAllResponseHeaders(); */
IMPL_CSTRING_GETTER(GetAllResponseHeaders)
void
nsXMLHttpRequest::GetAllResponseHeaders(nsCString& aResponseHeaders)
{
aResponseHeaders.Truncate();
// If the state is UNSENT or OPENED,
// return the empty string and terminate these steps.
if (mState & (XML_HTTP_REQUEST_UNSENT |
XML_HTTP_REQUEST_OPENED | XML_HTTP_REQUEST_SENT)) {
return;
}
if (nsCOMPtr<nsIHttpChannel> httpChannel = GetCurrentHttpChannel()) {
nsRefPtr<nsHeaderVisitor> visitor = new nsHeaderVisitor(this, httpChannel);
if (NS_SUCCEEDED(httpChannel->VisitResponseHeaders(visitor))) {
aResponseHeaders = visitor->Headers();
}
return;
}
if (!mChannel) {
return;
}
// Even non-http channels supply content type.
nsAutoCString value;
if (NS_SUCCEEDED(mChannel->GetContentType(value))) {
aResponseHeaders.AppendLiteral("Content-Type: ");
aResponseHeaders.Append(value);
if (NS_SUCCEEDED(mChannel->GetContentCharset(value)) && !value.IsEmpty()) {
aResponseHeaders.AppendLiteral(";charset=");
aResponseHeaders.Append(value);
}
aResponseHeaders.AppendLiteral("\r\n");
}
int64_t length;
if (NS_SUCCEEDED(mChannel->GetContentLength(&length))) {
aResponseHeaders.AppendLiteral("Content-Length: ");
aResponseHeaders.AppendInt(length);
aResponseHeaders.AppendLiteral("\r\n");
}
}
NS_IMETHODIMP
nsXMLHttpRequest::GetResponseHeader(const nsACString& aHeader,
nsACString& aResult)
{
ErrorResult rv;
GetResponseHeader(aHeader, aResult, rv);
return rv.ErrorCode();
}
void
nsXMLHttpRequest::GetResponseHeader(const nsACString& header,
nsACString& _retval, ErrorResult& aRv)
{
_retval.SetIsVoid(true);
nsCOMPtr<nsIHttpChannel> httpChannel = GetCurrentHttpChannel();
if (!httpChannel) {
// If the state is UNSENT or OPENED,
// return null and terminate these steps.
if (mState & (XML_HTTP_REQUEST_UNSENT |
XML_HTTP_REQUEST_OPENED | XML_HTTP_REQUEST_SENT)) {
return;
}
// Even non-http channels supply content type and content length.
// Remember we don't leak header information from denied cross-site
// requests.
nsresult status;
if (!mChannel ||
NS_FAILED(mChannel->GetStatus(&status)) ||
NS_FAILED(status)) {
return;
}
// Content Type:
if (header.LowerCaseEqualsASCII("content-type")) {
if (NS_FAILED(mChannel->GetContentType(_retval))) {
// Means no content type
_retval.SetIsVoid(true);
return;
}
nsCString value;
if (NS_SUCCEEDED(mChannel->GetContentCharset(value)) &&
!value.IsEmpty()) {
_retval.AppendLiteral(";charset=");
_retval.Append(value);
}
}
// Content Length:
else if (header.LowerCaseEqualsASCII("content-length")) {
int64_t length;
if (NS_SUCCEEDED(mChannel->GetContentLength(&length))) {
_retval.AppendInt(length);
}
}
return;
}
// Check for dangerous headers
if (!IsSafeHeader(header, httpChannel)) {
return;
}
aRv = httpChannel->GetResponseHeader(header, _retval);
if (aRv.ErrorCode() == NS_ERROR_NOT_AVAILABLE) {
// Means no header
_retval.SetIsVoid(true);
aRv = NS_OK;
}
}
already_AddRefed<nsILoadGroup>
nsXMLHttpRequest::GetLoadGroup() const
{
if (mState & XML_HTTP_REQUEST_BACKGROUND) {
return nullptr;
}
nsresult rv = NS_ERROR_FAILURE;
nsIScriptContext* sc =
const_cast<nsXMLHttpRequest*>(this)->GetContextForEventHandlers(&rv);
nsCOMPtr<nsIDocument> doc =
nsContentUtils::GetDocumentFromScriptContext(sc);
if (doc) {
return doc->GetDocumentLoadGroup();
}
return nullptr;
}
nsresult
nsXMLHttpRequest::CreateReadystatechangeEvent(nsIDOMEvent** aDOMEvent)
{
nsresult rv = EventDispatcher::CreateEvent(this, nullptr, nullptr,
NS_LITERAL_STRING("Events"),
aDOMEvent);
if (NS_FAILED(rv)) {
return rv;
}
(*aDOMEvent)->InitEvent(NS_LITERAL_STRING(READYSTATE_STR),
false, false);
// We assume anyone who managed to call CreateReadystatechangeEvent is trusted
(*aDOMEvent)->SetTrusted(true);
return NS_OK;
}
void
nsXMLHttpRequest::DispatchProgressEvent(DOMEventTargetHelper* aTarget,
const nsAString& aType,
bool aLengthComputable,
uint64_t aLoaded, uint64_t aTotal)
{
NS_ASSERTION(aTarget, "null target");
NS_ASSERTION(!aType.IsEmpty(), "missing event type");
if (NS_FAILED(CheckInnerWindowCorrectness()) ||
(!AllowUploadProgress() && aTarget == mUpload)) {
return;
}
bool dispatchLoadend = aType.EqualsLiteral(LOAD_STR) ||
aType.EqualsLiteral(ERROR_STR) ||
aType.EqualsLiteral(TIMEOUT_STR) ||
aType.EqualsLiteral(ABORT_STR);
ProgressEventInit init;
init.mBubbles = false;
init.mCancelable = false;
init.mLengthComputable = aLengthComputable;
init.mLoaded = aLoaded;
init.mTotal = (aTotal == UINT64_MAX) ? 0 : aTotal;
nsRefPtr<ProgressEvent> event =
ProgressEvent::Constructor(aTarget, aType, init);
event->SetTrusted(true);
aTarget->DispatchDOMEvent(nullptr, event, nullptr, nullptr);
if (dispatchLoadend) {
DispatchProgressEvent(aTarget, NS_LITERAL_STRING(LOADEND_STR),
aLengthComputable, aLoaded, aTotal);
}
}
already_AddRefed<nsIHttpChannel>
nsXMLHttpRequest::GetCurrentHttpChannel()
{
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
return httpChannel.forget();
}
already_AddRefed<nsIJARChannel>
nsXMLHttpRequest::GetCurrentJARChannel()
{
nsCOMPtr<nsIJARChannel> appChannel = do_QueryInterface(mChannel);
return appChannel.forget();
}
bool
nsXMLHttpRequest::IsSystemXHR()
{
return mIsSystem || nsContentUtils::IsSystemPrincipal(mPrincipal);
}
nsresult
nsXMLHttpRequest::CheckChannelForCrossSiteRequest(nsIChannel* aChannel)
{
// A system XHR (chrome code or a web app with the right permission) can
// always perform cross-site requests. In the web app case, however, we
// must still check for protected URIs like file:///.
if (IsSystemXHR()) {
if (!nsContentUtils::IsSystemPrincipal(mPrincipal)) {
nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager();
nsCOMPtr<nsIURI> uri;
aChannel->GetOriginalURI(getter_AddRefs(uri));
return secMan->CheckLoadURIWithPrincipal(
mPrincipal, uri, nsIScriptSecurityManager::STANDARD);
}
return NS_OK;
}
// If this is a same-origin request or the channel's URI inherits
// its principal, it's allowed.
if (nsContentUtils::CheckMayLoad(mPrincipal, aChannel, true)) {
return NS_OK;
}
// This is a cross-site request
mState |= XML_HTTP_REQUEST_USE_XSITE_AC;
// Check if we need to do a preflight request.
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
NS_ENSURE_TRUE(httpChannel, NS_ERROR_DOM_BAD_URI);
nsAutoCString method;
httpChannel->GetRequestMethod(method);
if (!mCORSUnsafeHeaders.IsEmpty() ||
(mUpload && mUpload->HasListeners()) ||
(!method.LowerCaseEqualsLiteral("get") &&
!method.LowerCaseEqualsLiteral("post") &&
!method.LowerCaseEqualsLiteral("head"))) {
mState |= XML_HTTP_REQUEST_NEED_AC_PREFLIGHT;
}
return NS_OK;
}
NS_IMETHODIMP
nsXMLHttpRequest::Open(const nsACString& method, const nsACString& url,
bool async, const nsAString& user,
const nsAString& password, uint8_t optional_argc)
{
if (!optional_argc) {
// No optional arguments were passed in. Default async to true.
async = true;
}
Optional<nsAString> realUser;
if (optional_argc > 1) {
realUser = &user;
}
Optional<nsAString> realPassword;
if (optional_argc > 2) {
realPassword = &password;
}
return Open(method, url, async, realUser, realPassword);
}
nsresult
nsXMLHttpRequest::Open(const nsACString& inMethod, const nsACString& url,
bool async, const Optional<nsAString>& user,
const Optional<nsAString>& password)
{
NS_ENSURE_ARG(!inMethod.IsEmpty());
if (!async && !DontWarnAboutSyncXHR() && GetOwner() &&
GetOwner()->GetExtantDoc()) {
GetOwner()->GetExtantDoc()->WarnOnceAbout(nsIDocument::eSyncXMLHttpRequest);
}
Telemetry::Accumulate(Telemetry::XMLHTTPREQUEST_ASYNC_OR_SYNC,
async ? 0 : 1);
NS_ENSURE_TRUE(mPrincipal, NS_ERROR_NOT_INITIALIZED);
// Disallow HTTP/1.1 TRACE method (see bug 302489)
// and MS IIS equivalent TRACK (see bug 381264)
// and CONNECT
if (inMethod.LowerCaseEqualsLiteral("trace") ||
inMethod.LowerCaseEqualsLiteral("connect") ||
inMethod.LowerCaseEqualsLiteral("track")) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsAutoCString method;
// GET, POST, DELETE, HEAD, OPTIONS, PUT methods normalized to upper case
if (inMethod.LowerCaseEqualsLiteral("get")) {
method.AssignLiteral("GET");
} else if (inMethod.LowerCaseEqualsLiteral("post")) {
method.AssignLiteral("POST");
} else if (inMethod.LowerCaseEqualsLiteral("delete")) {
method.AssignLiteral("DELETE");
} else if (inMethod.LowerCaseEqualsLiteral("head")) {
method.AssignLiteral("HEAD");
} else if (inMethod.LowerCaseEqualsLiteral("options")) {
method.AssignLiteral("OPTIONS");
} else if (inMethod.LowerCaseEqualsLiteral("put")) {
method.AssignLiteral("PUT");
} else {
method = inMethod; // other methods are not normalized
}
// sync request is not allowed using withCredential or responseType
// in window context
if (!async && HasOrHasHadOwner() &&
(mState & XML_HTTP_REQUEST_AC_WITH_CREDENTIALS ||
mTimeoutMilliseconds ||
mResponseType != XML_HTTP_RESPONSE_TYPE_DEFAULT)) {
if (mState & XML_HTTP_REQUEST_AC_WITH_CREDENTIALS) {
LogMessage("WithCredentialsSyncXHRWarning", GetOwner());
}
if (mTimeoutMilliseconds) {
LogMessage("TimeoutSyncXHRWarning", GetOwner());
}
if (mResponseType != XML_HTTP_RESPONSE_TYPE_DEFAULT) {
LogMessage("ResponseTypeSyncXHRWarning", GetOwner());
}
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
}
nsresult rv;
nsCOMPtr<nsIURI> uri;
if (mState & (XML_HTTP_REQUEST_OPENED |
XML_HTTP_REQUEST_HEADERS_RECEIVED |
XML_HTTP_REQUEST_LOADING |
XML_HTTP_REQUEST_SENT)) {
// IE aborts as well
Abort();
// XXX We should probably send a warning to the JS console
// that load was aborted and event listeners were cleared
// since this looks like a situation that could happen
// by accident and you could spend a lot of time wondering
// why things didn't work.
}
// Unset any pre-existing aborted and timed-out states.
mState &= ~XML_HTTP_REQUEST_ABORTED & ~XML_HTTP_REQUEST_TIMED_OUT;
if (async) {
mState |= XML_HTTP_REQUEST_ASYNC;
} else {
mState &= ~XML_HTTP_REQUEST_ASYNC;
}
nsIScriptContext* sc = GetContextForEventHandlers(&rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> doc =
nsContentUtils::GetDocumentFromScriptContext(sc);
nsCOMPtr<nsIURI> baseURI;
if (mBaseURI) {
baseURI = mBaseURI;
}
else if (doc) {
baseURI = doc->GetBaseURI();
}
rv = NS_NewURI(getter_AddRefs(uri), url, nullptr, baseURI);
if (NS_FAILED(rv)) return rv;
rv = CheckInnerWindowCorrectness();
NS_ENSURE_SUCCESS(rv, rv);
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_XMLHTTPREQUEST,
uri,
mPrincipal,
doc,
EmptyCString(), //mime guess
nullptr, //extra
&shouldLoad,
nsContentUtils::GetContentPolicy(),
nsContentUtils::GetSecurityManager());
if (NS_FAILED(rv)) return rv;
if (NS_CP_REJECTED(shouldLoad)) {
// Disallowed by content policy
return NS_ERROR_CONTENT_BLOCKED;
}
// XXXbz this is wrong: we should only be looking at whether
// user/password were passed, not at the values! See bug 759624.
if (user.WasPassed() && !user.Value().IsEmpty()) {
nsAutoCString userpass;
CopyUTF16toUTF8(user.Value(), userpass);
if (password.WasPassed() && !password.Value().IsEmpty()) {
userpass.Append(':');
AppendUTF16toUTF8(password.Value(), userpass);
}
uri->SetUserPass(userpass);
}
// Clear our record of previously set headers so future header set
// operations will merge/override correctly.
mAlreadySetHeaders.Clear();
// When we are called from JS we can find the load group for the page,
// and add ourselves to it. This way any pending requests
// will be automatically aborted if the user leaves the page.
nsCOMPtr<nsILoadGroup> loadGroup = GetLoadGroup();
nsSecurityFlags secFlags = nsILoadInfo::SEC_NORMAL;
if (IsSystemXHR()) {
// Don't give this document the system principal. We need to keep track of
// mPrincipal being system because we use it for various security checks
// that should be passing, but the document data shouldn't get a system
// principal. Hence we set the sandbox flag in loadinfo, so that
// GetChannelResultPrincipal will give us the nullprincipal.
secFlags |= nsILoadInfo::SEC_SANDBOXED;
} else {
secFlags |= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
}
// If we have the document, use it
if (doc) {
rv = NS_NewChannel(getter_AddRefs(mChannel),
uri,
doc,
secFlags,
nsIContentPolicy::TYPE_XMLHTTPREQUEST,
loadGroup,
nullptr, // aCallbacks
nsIRequest::LOAD_BACKGROUND);
} else {
//otherwise use the principal
rv = NS_NewChannel(getter_AddRefs(mChannel),
uri,
mPrincipal,
secFlags,
nsIContentPolicy::TYPE_XMLHTTPREQUEST,
loadGroup,
nullptr, // aCallbacks
nsIRequest::LOAD_BACKGROUND);
}
if (NS_FAILED(rv)) return rv;
mState &= ~(XML_HTTP_REQUEST_USE_XSITE_AC |
XML_HTTP_REQUEST_NEED_AC_PREFLIGHT);
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel));
if (httpChannel) {
rv = httpChannel->SetRequestMethod(method);
NS_ENSURE_SUCCESS(rv, rv);
// Set the initiator type
nsCOMPtr<nsITimedChannel> timedChannel(do_QueryInterface(httpChannel));
if (timedChannel) {
timedChannel->SetInitiatorType(NS_LITERAL_STRING("xmlhttprequest"));
}
}
ChangeState(XML_HTTP_REQUEST_OPENED);
return rv;
}
/*
* "Copy" from a stream.
*/
NS_METHOD
nsXMLHttpRequest::StreamReaderFunc(nsIInputStream* in,
void* closure,
const char* fromRawSegment,
uint32_t toOffset,
uint32_t count,
uint32_t *writeCount)
{
nsXMLHttpRequest* xmlHttpRequest = static_cast<nsXMLHttpRequest*>(closure);
if (!xmlHttpRequest || !writeCount) {
NS_WARNING("XMLHttpRequest cannot read from stream: no closure or writeCount");
return NS_ERROR_FAILURE;
}
nsresult rv = NS_OK;
if (xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_BLOB ||
xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_MOZ_BLOB) {
if (!xmlHttpRequest->mDOMFile) {
if (!xmlHttpRequest->mBlobSet) {
xmlHttpRequest->mBlobSet = new BlobSet();
}
rv = xmlHttpRequest->mBlobSet->AppendVoidPtr(fromRawSegment, count);
}
// Clear the cache so that the blob size is updated.
if (xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_MOZ_BLOB) {
xmlHttpRequest->mResponseBlob = nullptr;
}
} else if ((xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_ARRAYBUFFER &&
!xmlHttpRequest->mIsMappedArrayBuffer) ||
xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_ARRAYBUFFER) {
// get the initial capacity to something reasonable to avoid a bunch of reallocs right
// at the start
if (xmlHttpRequest->mArrayBufferBuilder.capacity() == 0)
xmlHttpRequest->mArrayBufferBuilder.setCapacity(PR_MAX(count, XML_HTTP_REQUEST_ARRAYBUFFER_MIN_SIZE));
xmlHttpRequest->mArrayBufferBuilder.append(reinterpret_cast<const uint8_t*>(fromRawSegment), count,
XML_HTTP_REQUEST_ARRAYBUFFER_MAX_GROWTH);
} else if (xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_DEFAULT &&
xmlHttpRequest->mResponseXML) {
// Copy for our own use
uint32_t previousLength = xmlHttpRequest->mResponseBody.Length();
xmlHttpRequest->mResponseBody.Append(fromRawSegment,count);
if (count > 0 && xmlHttpRequest->mResponseBody.Length() == previousLength) {
return NS_ERROR_OUT_OF_MEMORY;
}
} else if (xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_DEFAULT ||
xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_TEXT ||
xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_JSON ||
xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT) {
NS_ASSERTION(!xmlHttpRequest->mResponseXML,
"We shouldn't be parsing a doc here");
xmlHttpRequest->AppendToResponseText(fromRawSegment, count);
}
if (xmlHttpRequest->mState & XML_HTTP_REQUEST_PARSEBODY) {
// Give the same data to the parser.
// We need to wrap the data in a new lightweight stream and pass that
// to the parser, because calling ReadSegments() recursively on the same
// stream is not supported.
nsCOMPtr<nsIInputStream> copyStream;
rv = NS_NewByteInputStream(getter_AddRefs(copyStream), fromRawSegment, count);
if (NS_SUCCEEDED(rv) && xmlHttpRequest->mXMLParserStreamListener) {
NS_ASSERTION(copyStream, "NS_NewByteInputStream lied");
nsresult parsingResult = xmlHttpRequest->mXMLParserStreamListener
->OnDataAvailable(xmlHttpRequest->mChannel,
xmlHttpRequest->mContext,
copyStream, toOffset, count);
// No use to continue parsing if we failed here, but we
// should still finish reading the stream
if (NS_FAILED(parsingResult)) {
xmlHttpRequest->mState &= ~XML_HTTP_REQUEST_PARSEBODY;
}
}
}
if (NS_SUCCEEDED(rv)) {
*writeCount = count;
} else {
*writeCount = 0;
}
return rv;
}
bool nsXMLHttpRequest::CreateDOMFile(nsIRequest *request)
{
nsCOMPtr<nsIFile> file;
nsCOMPtr<nsIFileChannel> fc = do_QueryInterface(request);
if (fc) {
fc->GetFile(getter_AddRefs(file));
}
if (!file)
return false;
nsAutoCString contentType;
mChannel->GetContentType(contentType);
mDOMFile = File::CreateFromFile(GetOwner(), file, EmptyString(),
NS_ConvertASCIItoUTF16(contentType));
mBlobSet = nullptr;
NS_ASSERTION(mResponseBody.IsEmpty(), "mResponseBody should be empty");
return true;
}
NS_IMETHODIMP
nsXMLHttpRequest::OnDataAvailable(nsIRequest *request,
nsISupports *ctxt,
nsIInputStream *inStr,
uint64_t sourceOffset,
uint32_t count)
{
NS_ENSURE_ARG_POINTER(inStr);
NS_ABORT_IF_FALSE(mContext.get() == ctxt,"start context different from OnDataAvailable context");
mProgressSinceLastProgressEvent = true;
bool cancelable = false;
if ((mResponseType == XML_HTTP_RESPONSE_TYPE_BLOB ||
mResponseType == XML_HTTP_RESPONSE_TYPE_MOZ_BLOB) && !mDOMFile) {
cancelable = CreateDOMFile(request);
// The nsIStreamListener contract mandates us
// to read from the stream before returning.
}
uint32_t totalRead;
nsresult rv = inStr->ReadSegments(nsXMLHttpRequest::StreamReaderFunc,
(void*)this, count, &totalRead);
NS_ENSURE_SUCCESS(rv, rv);
if (cancelable) {
// We don't have to read from the local file for the blob response
mDOMFile->GetSize(&mDataAvailable);
ChangeState(XML_HTTP_REQUEST_LOADING);
return request->Cancel(NS_OK);
}
mDataAvailable += totalRead;
ChangeState(XML_HTTP_REQUEST_LOADING);
MaybeDispatchProgressEvents(false);
return NS_OK;
}
/* void onStartRequest (in nsIRequest request, in nsISupports ctxt); */
NS_IMETHODIMP
nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
{
PROFILER_LABEL("nsXMLHttpRequest", "OnStartRequest",
js::ProfileEntry::Category::NETWORK);
nsresult rv = NS_OK;
if (!mFirstStartRequestSeen && mRequestObserver) {
mFirstStartRequestSeen = true;
mRequestObserver->OnStartRequest(request, ctxt);
}
if (request != mChannel) {
// Can this still happen?
return NS_OK;
}
// Don't do anything if we have been aborted
if (mState & XML_HTTP_REQUEST_UNSENT)
return NS_OK;
/* Apparently, Abort() should set XML_HTTP_REQUEST_UNSENT. See bug 361773.
XHR2 spec says this is correct. */
if (mState & XML_HTTP_REQUEST_ABORTED) {
NS_ERROR("Ugh, still getting data on an aborted XMLHttpRequest!");
return NS_ERROR_UNEXPECTED;
}
// Don't do anything if we have timed out.
if (mState & XML_HTTP_REQUEST_TIMED_OUT) {
return NS_OK;
}
nsCOMPtr<nsIChannel> channel(do_QueryInterface(request));
NS_ENSURE_TRUE(channel, NS_ERROR_UNEXPECTED);
nsresult status;
request->GetStatus(&status);
mErrorLoad = mErrorLoad || NS_FAILED(status);
if (mUpload && !mUploadComplete && !mErrorLoad &&
(mState & XML_HTTP_REQUEST_ASYNC)) {
if (mProgressTimerIsActive) {
mProgressTimerIsActive = false;
mProgressNotifier->Cancel();
}
if (mUploadTransferred < mUploadTotal) {
mUploadTransferred = mUploadTotal;
mProgressSinceLastProgressEvent = true;
mUploadLengthComputable = true;
MaybeDispatchProgressEvents(true);
}
mUploadComplete = true;
DispatchProgressEvent(mUpload, NS_LITERAL_STRING(LOAD_STR),
true, mUploadTotal, mUploadTotal);
}
mContext = ctxt;
mState |= XML_HTTP_REQUEST_PARSEBODY;
ChangeState(XML_HTTP_REQUEST_HEADERS_RECEIVED);
ResetResponse();
if (!mOverrideMimeType.IsEmpty()) {
channel->SetContentType(NS_ConvertUTF16toUTF8(mOverrideMimeType));
}
DetectCharset();
// Set up arraybuffer
if (mResponseType == XML_HTTP_RESPONSE_TYPE_ARRAYBUFFER && NS_SUCCEEDED(status)) {
if (mIsMappedArrayBuffer) {
nsCOMPtr<nsIJARChannel> jarChannel = do_QueryInterface(channel);
if (jarChannel) {
nsCOMPtr<nsIURI> uri;
rv = channel->GetURI(getter_AddRefs(uri));
if (NS_SUCCEEDED(rv)) {
nsAutoCString file;
nsAutoCString scheme;
uri->GetScheme(scheme);
if (scheme.LowerCaseEqualsLiteral("app")) {
uri->GetPath(file);
// The actual file inside zip package has no leading slash.
file.Trim("/", true, false, false);
} else if (scheme.LowerCaseEqualsLiteral("jar")) {
nsCOMPtr<nsIJARURI> jarURI = do_QueryInterface(uri);
if (jarURI) {
jarURI->GetJAREntry(file);
}
}
nsCOMPtr<nsIFile> jarFile;
jarChannel->GetJarFile(getter_AddRefs(jarFile));
rv = mArrayBufferBuilder.mapToFileInPackage(file, jarFile);
if (NS_WARN_IF(NS_FAILED(rv))) {
mIsMappedArrayBuffer = false;
} else {
channel->SetContentType(NS_LITERAL_CSTRING("application/mem-mapped"));
}
}
}
}
// If memory mapping failed, mIsMappedArrayBuffer would be set to false,
// and we want it fallback to the malloc way.
if (!mIsMappedArrayBuffer) {
int64_t contentLength;
rv = channel->GetContentLength(&contentLength);
if (NS_SUCCEEDED(rv) &&
contentLength > 0 &&
contentLength < XML_HTTP_REQUEST_MAX_CONTENT_LENGTH_PREALLOCATE) {
mArrayBufferBuilder.setCapacity(static_cast<int32_t>(contentLength));
}
}
}
// Set up responseXML
bool parseBody = mResponseType == XML_HTTP_RESPONSE_TYPE_DEFAULT ||
mResponseType == XML_HTTP_RESPONSE_TYPE_DOCUMENT;
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel));
if (parseBody && httpChannel) {
nsAutoCString method;
httpChannel->GetRequestMethod(method);
parseBody = !method.EqualsLiteral("HEAD");
}
mIsHtml = false;
mWarnAboutSyncHtml = false;
if (parseBody && NS_SUCCEEDED(status)) {
// We can gain a huge performance win by not even trying to
// parse non-XML data. This also protects us from the situation
// where we have an XML document and sink, but HTML (or other)
// parser, which can produce unreliable results.
nsAutoCString type;
channel->GetContentType(type);
if ((mResponseType == XML_HTTP_RESPONSE_TYPE_DOCUMENT) &&
type.EqualsLiteral("text/html")) {
// HTML parsing is only supported for responseType == "document" to
// avoid running the parser and, worse, populating responseXML for
// legacy users of XHR who use responseType == "" for retrieving the
// responseText of text/html resources. This legacy case is so common
// that it's not useful to emit a warning about it.
if (!(mState & XML_HTTP_REQUEST_ASYNC)) {
// We don't make cool new features available in the bad synchronous
// mode. The synchronous mode is for legacy only.
mWarnAboutSyncHtml = true;
mState &= ~XML_HTTP_REQUEST_PARSEBODY;
} else {
mIsHtml = true;
}
} else if (type.Find("xml") == kNotFound) {
mState &= ~XML_HTTP_REQUEST_PARSEBODY;
}
} else {
// The request failed, so we shouldn't be parsing anyway
mState &= ~XML_HTTP_REQUEST_PARSEBODY;
}
if (mState & XML_HTTP_REQUEST_PARSEBODY) {
nsCOMPtr<nsIURI> baseURI, docURI;
rv = mChannel->GetURI(getter_AddRefs(docURI));
NS_ENSURE_SUCCESS(rv, rv);
baseURI = docURI;
nsIScriptContext* sc = GetContextForEventHandlers(&rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> doc =
nsContentUtils::GetDocumentFromScriptContext(sc);
nsCOMPtr<nsIURI> chromeXHRDocURI, chromeXHRDocBaseURI;
if (doc) {
chromeXHRDocURI = doc->GetDocumentURI();
chromeXHRDocBaseURI = doc->GetBaseURI();
}
// Create an empty document from it.
const nsAString& emptyStr = EmptyString();
nsCOMPtr<nsIDOMDocument> responseDoc;
nsIGlobalObject* global = DOMEventTargetHelper::GetParentObject();
nsCOMPtr<nsIPrincipal> requestingPrincipal;
rv = nsContentUtils::GetSecurityManager()->
GetChannelResultPrincipal(channel, getter_AddRefs(requestingPrincipal));
NS_ENSURE_SUCCESS(rv, rv);
rv = NS_NewDOMDocument(getter_AddRefs(responseDoc),
emptyStr, emptyStr, nullptr, docURI,
baseURI, requestingPrincipal, true, global,
mIsHtml ? DocumentFlavorHTML :
DocumentFlavorLegacyGuess);
NS_ENSURE_SUCCESS(rv, rv);
mResponseXML = do_QueryInterface(responseDoc);
mResponseXML->SetChromeXHRDocURI(chromeXHRDocURI);
mResponseXML->SetChromeXHRDocBaseURI(chromeXHRDocBaseURI);
if (nsContentUtils::IsSystemPrincipal(mPrincipal)) {
mResponseXML->ForceEnableXULXBL();
}
if (mState & XML_HTTP_REQUEST_USE_XSITE_AC) {
nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(mResponseXML);
if (htmlDoc) {
htmlDoc->DisableCookieAccess();
}
}
nsCOMPtr<nsIStreamListener> listener;
nsCOMPtr<nsILoadGroup> loadGroup;
channel->GetLoadGroup(getter_AddRefs(loadGroup));
rv = mResponseXML->StartDocumentLoad(kLoadAsData, channel, loadGroup,
nullptr, getter_AddRefs(listener),
!(mState & XML_HTTP_REQUEST_USE_XSITE_AC));
NS_ENSURE_SUCCESS(rv, rv);
mXMLParserStreamListener = listener;
rv = mXMLParserStreamListener->OnStartRequest(request, ctxt);
NS_ENSURE_SUCCESS(rv, rv);
}
// We won't get any progress events anyway if we didn't have progress
// events when starting the request - so maybe no need to start timer here.
if (NS_SUCCEEDED(rv) &&
(mState & XML_HTTP_REQUEST_ASYNC) &&
HasListenersFor(nsGkAtoms::onprogress)) {
StartProgressEventTimer();
}
return NS_OK;
}
/* void onStopRequest (in nsIRequest request, in nsISupports ctxt, in nsresult status, in wstring statusArg); */
NS_IMETHODIMP
nsXMLHttpRequest::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult status)
{
PROFILER_LABEL("nsXMLHttpRequest", "OnStopRequest",
js::ProfileEntry::Category::NETWORK);
if (request != mChannel) {
// Can this still happen?
return NS_OK;
}
mWaitingForOnStopRequest = false;
if (mRequestObserver) {
NS_ASSERTION(mFirstStartRequestSeen, "Inconsistent state!");
mFirstStartRequestSeen = false;
mRequestObserver->OnStopRequest(request, ctxt, status);
}
// make sure to notify the listener if we were aborted
// XXX in fact, why don't we do the cleanup below in this case??
// XML_HTTP_REQUEST_UNSENT is for abort calls. See OnStartRequest above.
if ((mState & XML_HTTP_REQUEST_UNSENT) ||
(mState & XML_HTTP_REQUEST_TIMED_OUT)) {
if (mXMLParserStreamListener)
(void) mXMLParserStreamListener->OnStopRequest(request, ctxt, status);
return NS_OK;
}
// Is this good enough here?
if (mState & XML_HTTP_REQUEST_PARSEBODY && mXMLParserStreamListener) {
mXMLParserStreamListener->OnStopRequest(request, ctxt, status);
}
mXMLParserStreamListener = nullptr;
mContext = nullptr;
// If we're received data since the last progress event, make sure to fire
// an event for it, except in the HTML case, defer the last progress event
// until the parser is done.
if (!mIsHtml) {
MaybeDispatchProgressEvents(true);
}
if (NS_SUCCEEDED(status) &&
(mResponseType == XML_HTTP_RESPONSE_TYPE_BLOB ||
mResponseType == XML_HTTP_RESPONSE_TYPE_MOZ_BLOB)) {
if (!mDOMFile) {
CreateDOMFile(request);
}
if (mDOMFile) {
mResponseBlob = mDOMFile;
mDOMFile = nullptr;
} else {
// mBlobSet can be null if the channel is non-file non-cacheable
// and if the response length is zero.
if (!mBlobSet) {
mBlobSet = new BlobSet();
}
// Smaller files may be written in cache map instead of separate files.
// Also, no-store response cannot be written in persistent cache.
nsAutoCString contentType;
mChannel->GetContentType(contentType);
mResponseBlob = mBlobSet->GetBlobInternal(GetOwner(), contentType);
mBlobSet = nullptr;
}
NS_ASSERTION(mResponseBody.IsEmpty(), "mResponseBody should be empty");
NS_ASSERTION(mResponseText.IsEmpty(), "mResponseText should be empty");
} else if (NS_SUCCEEDED(status) &&
((mResponseType == XML_HTTP_RESPONSE_TYPE_ARRAYBUFFER &&
!mIsMappedArrayBuffer) ||
mResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_ARRAYBUFFER)) {
// set the capacity down to the actual length, to realloc back
// down to the actual size
if (!mArrayBufferBuilder.setCapacity(mArrayBufferBuilder.length())) {
// this should never happen!
status = NS_ERROR_UNEXPECTED;
}
}
nsCOMPtr<nsIChannel> channel(do_QueryInterface(request));
NS_ENSURE_TRUE(channel, NS_ERROR_UNEXPECTED);
channel->SetNotificationCallbacks(nullptr);
mNotificationCallbacks = nullptr;
mChannelEventSink = nullptr;
mProgressEventSink = nullptr;
mState &= ~XML_HTTP_REQUEST_SYNCLOOPING;
if (NS_FAILED(status)) {
// This can happen if the server is unreachable. Other possible
// reasons are that the user leaves the page or hits the ESC key.
mErrorLoad = true;
mResponseXML = nullptr;
}
// If we're uninitialized at this point, we encountered an error
// earlier and listeners have already been notified. Also we do
// not want to do this if we already completed.
if (mState & (XML_HTTP_REQUEST_UNSENT |
XML_HTTP_REQUEST_DONE)) {
return NS_OK;
}
if (!mResponseXML) {
ChangeStateToDone();
return NS_OK;
}
if (mIsHtml) {
NS_ASSERTION(!(mState & XML_HTTP_REQUEST_SYNCLOOPING),
"We weren't supposed to support HTML parsing with XHR!");
nsCOMPtr<EventTarget> eventTarget = do_QueryInterface(mResponseXML);
EventListenerManager* manager =
eventTarget->GetOrCreateListenerManager();
manager->AddEventListenerByType(new nsXHRParseEndListener(this),
NS_LITERAL_STRING("DOMContentLoaded"),
TrustedEventsAtSystemGroupBubble());
return NS_OK;
}
// We might have been sent non-XML data. If that was the case,
// we should null out the document member. The idea in this
// check here is that if there is no document element it is not
// an XML document. We might need a fancier check...
if (!mResponseXML->GetRootElement()) {
mResponseXML = nullptr;
}
ChangeStateToDone();
return NS_OK;
}
void
nsXMLHttpRequest::ChangeStateToDone()
{
if (mIsHtml) {
// In the HTML case, this has to be deferred, because the parser doesn't
// do it's job synchronously.
MaybeDispatchProgressEvents(true);
}
ChangeState(XML_HTTP_REQUEST_DONE, true);
if (mTimeoutTimer) {
mTimeoutTimer->Cancel();
}
NS_NAMED_LITERAL_STRING(errorStr, ERROR_STR);
NS_NAMED_LITERAL_STRING(loadStr, LOAD_STR);
DispatchProgressEvent(this,
mErrorLoad ? errorStr : loadStr,
!mErrorLoad,
mLoadTransferred,
mErrorLoad ? 0 : mLoadTransferred);
if (mErrorLoad && mUpload && !mUploadComplete) {
DispatchProgressEvent(mUpload, errorStr, true,
mUploadTransferred, mUploadTotal);
}
if (mErrorLoad) {
// By nulling out channel here we make it so that Send() can test
// for that and throw. Also calling the various status
// methods/members will not throw.
// This matches what IE does.
mChannel = nullptr;
mCORSPreflightChannel = nullptr;
}
}
NS_IMETHODIMP
nsXMLHttpRequest::SendAsBinary(const nsAString &aBody)
{
ErrorResult rv;
SendAsBinary(aBody, rv);
return rv.ErrorCode();
}
void
nsXMLHttpRequest::SendAsBinary(const nsAString &aBody,
ErrorResult& aRv)
{
char *data = static_cast<char*>(NS_Alloc(aBody.Length() + 1));
if (!data) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
if (GetOwner() && GetOwner()->GetExtantDoc()) {
GetOwner()->GetExtantDoc()->WarnOnceAbout(nsIDocument::eSendAsBinary);
}
nsAString::const_iterator iter, end;
aBody.BeginReading(iter);
aBody.EndReading(end);
char *p = data;
while (iter != end) {
if (*iter & 0xFF00) {
NS_Free(data);
aRv.Throw(NS_ERROR_DOM_INVALID_CHARACTER_ERR);
return;
}
*p++ = static_cast<char>(*iter++);
}
*p = '\0';
nsCOMPtr<nsIInputStream> stream;
aRv = NS_NewByteInputStream(getter_AddRefs(stream), data, aBody.Length(),
NS_ASSIGNMENT_ADOPT);
if (aRv.Failed()) {
NS_Free(data);
return;
}
nsCOMPtr<nsIWritableVariant> variant = new nsVariant();
aRv = variant->SetAsISupports(stream);
if (aRv.Failed()) {
return;
}
aRv = Send(variant);
}
static nsresult
GetRequestBody(nsIDOMDocument* aDoc, nsIInputStream** aResult,
uint64_t* aContentLength, nsACString& aContentType,
nsACString& aCharset)
{
aContentType.AssignLiteral("application/xml");
nsAutoString inputEncoding;
aDoc->GetInputEncoding(inputEncoding);
if (!DOMStringIsNull(inputEncoding)) {
CopyUTF16toUTF8(inputEncoding, aCharset);
}
else {
aCharset.AssignLiteral("UTF-8");
}
// Serialize to a stream so that the encoding used will
// match the document's.
nsresult rv;
nsCOMPtr<nsIDOMSerializer> serializer =
do_CreateInstance(NS_XMLSERIALIZER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStorageStream> storStream;
rv = NS_NewStorageStream(4096, UINT32_MAX, getter_AddRefs(storStream));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIOutputStream> output;
rv = storStream->GetOutputStream(0, getter_AddRefs(output));
NS_ENSURE_SUCCESS(rv, rv);
// Make sure to use the encoding we'll send
rv = serializer->SerializeToStream(aDoc, output, aCharset);
NS_ENSURE_SUCCESS(rv, rv);
output->Close();
uint32_t length;
rv = storStream->GetLength(&length);
NS_ENSURE_SUCCESS(rv, rv);
*aContentLength = length;
return storStream->NewInputStream(0, aResult);
}
static nsresult
GetRequestBody(const nsAString& aString, nsIInputStream** aResult,
uint64_t* aContentLength, nsACString& aContentType,
nsACString& aCharset)
{
aContentType.AssignLiteral("text/plain");
aCharset.AssignLiteral("UTF-8");
nsCString converted = NS_ConvertUTF16toUTF8(aString);
*aContentLength = converted.Length();
return NS_NewCStringInputStream(aResult, converted);
}
static nsresult
GetRequestBody(nsIInputStream* aStream, nsIInputStream** aResult,
uint64_t* aContentLength, nsACString& aContentType,
nsACString& aCharset)
{
aContentType.AssignLiteral("text/plain");
aCharset.Truncate();
nsresult rv = aStream->Available(aContentLength);
NS_ENSURE_SUCCESS(rv, rv);
NS_ADDREF(*aResult = aStream);
return NS_OK;
}
static nsresult
GetRequestBody(nsIXHRSendable* aSendable, nsIInputStream** aResult, uint64_t* aContentLength,
nsACString& aContentType, nsACString& aCharset)
{
return aSendable->GetSendInfo(aResult, aContentLength, aContentType, aCharset);
}
// Used for array buffers and array buffer views
static nsresult
GetRequestBody(const uint8_t* aData, uint32_t aDataLength,
nsIInputStream** aResult, uint64_t* aContentLength,
nsACString& aContentType, nsACString& aCharset)
{
aContentType.SetIsVoid(true);
aCharset.Truncate();
*aContentLength = aDataLength;
const char* data = reinterpret_cast<const char*>(aData);
nsCOMPtr<nsIInputStream> stream;
nsresult rv = NS_NewByteInputStream(getter_AddRefs(stream), data, aDataLength,
NS_ASSIGNMENT_COPY);
NS_ENSURE_SUCCESS(rv, rv);
stream.forget(aResult);
return NS_OK;
}
static nsresult
GetRequestBody(nsIVariant* aBody, nsIInputStream** aResult, uint64_t* aContentLength,
nsACString& aContentType, nsACString& aCharset)
{
*aResult = nullptr;
uint16_t dataType;
nsresult rv = aBody->GetDataType(&dataType);
NS_ENSURE_SUCCESS(rv, rv);
if (dataType == nsIDataType::VTYPE_INTERFACE ||
dataType == nsIDataType::VTYPE_INTERFACE_IS) {
nsCOMPtr<nsISupports> supports;
nsID *iid;
rv = aBody->GetAsInterface(&iid, getter_AddRefs(supports));
NS_ENSURE_SUCCESS(rv, rv);
nsMemory::Free(iid);
// document?
nsCOMPtr<nsIDOMDocument> doc = do_QueryInterface(supports);
if (doc) {
return GetRequestBody(doc, aResult, aContentLength, aContentType, aCharset);
}
// nsISupportsString?
nsCOMPtr<nsISupportsString> wstr = do_QueryInterface(supports);
if (wstr) {
nsAutoString string;
wstr->GetData(string);
return GetRequestBody(string, aResult, aContentLength, aContentType, aCharset);
}
// nsIInputStream?
nsCOMPtr<nsIInputStream> stream = do_QueryInterface(supports);
if (stream) {
return GetRequestBody(stream, aResult, aContentLength, aContentType, aCharset);
}
// nsIXHRSendable?
nsCOMPtr<nsIXHRSendable> sendable = do_QueryInterface(supports);
if (sendable) {
return GetRequestBody(sendable, aResult, aContentLength, aContentType, aCharset);
}
// ArrayBuffer?
AutoSafeJSContext cx;
JS::Rooted<JS::Value> realVal(cx);
nsresult rv = aBody->GetAsJSVal(&realVal);
if (NS_SUCCEEDED(rv) && !realVal.isPrimitive()) {
JS::Rooted<JSObject*> obj(cx, realVal.toObjectOrNull());
ArrayBuffer buf;
if (buf.Init(obj)) {
buf.ComputeLengthAndData();
return GetRequestBody(buf.Data(), buf.Length(), aResult,
aContentLength, aContentType, aCharset);
}
}
}
else if (dataType == nsIDataType::VTYPE_VOID ||
dataType == nsIDataType::VTYPE_EMPTY) {
// Makes us act as if !aBody, don't upload anything
aContentType.AssignLiteral("text/plain");
aCharset.AssignLiteral("UTF-8");
*aContentLength = 0;
return NS_OK;
}
char16_t* data = nullptr;
uint32_t len = 0;
rv = aBody->GetAsWStringWithSize(&len, &data);
NS_ENSURE_SUCCESS(rv, rv);
nsString string;
string.Adopt(data, len);
return GetRequestBody(string, aResult, aContentLength, aContentType, aCharset);
}
/* static */
nsresult
nsXMLHttpRequest::GetRequestBody(nsIVariant* aVariant,
const Nullable<RequestBody>& aBody,
nsIInputStream** aResult,
uint64_t* aContentLength,
nsACString& aContentType, nsACString& aCharset)
{
if (aVariant) {
return ::GetRequestBody(aVariant, aResult, aContentLength, aContentType, aCharset);
}
const RequestBody& body = aBody.Value();
RequestBody::Value value = body.GetValue();
switch (body.GetType()) {
case nsXMLHttpRequest::RequestBody::ArrayBuffer:
{
const ArrayBuffer* buffer = value.mArrayBuffer;
buffer->ComputeLengthAndData();
return ::GetRequestBody(buffer->Data(), buffer->Length(), aResult,
aContentLength, aContentType, aCharset);
}
case nsXMLHttpRequest::RequestBody::ArrayBufferView:
{
const ArrayBufferView* view = value.mArrayBufferView;
view->ComputeLengthAndData();
return ::GetRequestBody(view->Data(), view->Length(), aResult,
aContentLength, aContentType, aCharset);
}
case nsXMLHttpRequest::RequestBody::Blob:
{
nsresult rv;
nsCOMPtr<nsIDOMBlob> blob = value.mBlob;
nsCOMPtr<nsIXHRSendable> sendable = do_QueryInterface(blob, &rv);
NS_ENSURE_SUCCESS(rv, rv);
return ::GetRequestBody(sendable, aResult, aContentLength, aContentType, aCharset);
}
case nsXMLHttpRequest::RequestBody::Document:
{
nsCOMPtr<nsIDOMDocument> document = do_QueryInterface(value.mDocument);
return ::GetRequestBody(document, aResult, aContentLength, aContentType, aCharset);
}
case nsXMLHttpRequest::RequestBody::DOMString:
{
return ::GetRequestBody(*value.mString, aResult, aContentLength,
aContentType, aCharset);
}
case nsXMLHttpRequest::RequestBody::FormData:
{
MOZ_ASSERT(value.mFormData);
return ::GetRequestBody(value.mFormData, aResult, aContentLength,
aContentType, aCharset);
}
case nsXMLHttpRequest::RequestBody::InputStream:
{
return ::GetRequestBody(value.mStream, aResult, aContentLength,
aContentType, aCharset);
}
default:
{
return NS_ERROR_FAILURE;
}
}
NS_NOTREACHED("Default cases exist for a reason");
return NS_OK;
}
/* void send (in nsIVariant aBody); */
NS_IMETHODIMP
nsXMLHttpRequest::Send(nsIVariant *aBody)
{
return Send(aBody, Nullable<RequestBody>());
}
nsresult
nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable<RequestBody>& aBody)
{
NS_ENSURE_TRUE(mPrincipal, NS_ERROR_NOT_INITIALIZED);
nsresult rv = CheckInnerWindowCorrectness();
NS_ENSURE_SUCCESS(rv, rv);
// Return error if we're already processing a request
if (XML_HTTP_REQUEST_SENT & mState) {
return NS_ERROR_FAILURE;
}
// Make sure we've been opened
if (!mChannel || !(XML_HTTP_REQUEST_OPENED & mState)) {
return NS_ERROR_NOT_INITIALIZED;
}
// nsIRequest::LOAD_BACKGROUND prevents throbber from becoming active, which
// in turn keeps STOP button from becoming active. If the consumer passed in
// a progress event handler we must load with nsIRequest::LOAD_NORMAL or
// necko won't generate any progress notifications.
if (HasListenersFor(nsGkAtoms::onprogress) ||
(mUpload && mUpload->HasListenersFor(nsGkAtoms::onprogress))) {
nsLoadFlags loadFlags;
mChannel->GetLoadFlags(&loadFlags);
loadFlags &= ~nsIRequest::LOAD_BACKGROUND;
loadFlags |= nsIRequest::LOAD_NORMAL;
mChannel->SetLoadFlags(loadFlags);
}
// XXX We should probably send a warning to the JS console
// if there are no event listeners set and we are doing
// an asynchronous call.
// Ignore argument if method is GET, there is no point in trying to
// upload anything
nsAutoCString method;
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel));
if (httpChannel) {
httpChannel->GetRequestMethod(method); // If GET, method name will be uppercase
if (!IsSystemXHR()) {
// Get the referrer for the request.
//
// If it weren't for history.push/replaceState, we could just use the
// principal's URI here. But since we want changes to the URI effected
// by push/replaceState to be reflected in the XHR referrer, we have to
// be more clever.
//
// If the document's original URI (before any push/replaceStates) matches
// our principal, then we use the document's current URI (after
// push/replaceStates). Otherwise (if the document is, say, a data:
// URI), we just use the principal's URI.
nsCOMPtr<nsIURI> principalURI;
mPrincipal->GetURI(getter_AddRefs(principalURI));
nsIScriptContext* sc = GetContextForEventHandlers(&rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> doc =
nsContentUtils::GetDocumentFromScriptContext(sc);
nsCOMPtr<nsIURI> docCurURI;
nsCOMPtr<nsIURI> docOrigURI;
if (doc) {
docCurURI = doc->GetDocumentURI();
docOrigURI = doc->GetOriginalURI();
}
nsCOMPtr<nsIURI> referrerURI;
if (principalURI && docCurURI && docOrigURI) {
bool equal = false;
principalURI->Equals(docOrigURI, &equal);
if (equal) {
referrerURI = docCurURI;
}
}
if (!referrerURI)
referrerURI = principalURI;
httpChannel->SetReferrer(referrerURI);
}
// Some extensions override the http protocol handler and provide their own
// implementation. The channels returned from that implementation doesn't
// seem to always implement the nsIUploadChannel2 interface, presumably
// because it's a new interface.
// Eventually we should remove this and simply require that http channels
// implement the new interface.
// See bug 529041
nsCOMPtr<nsIUploadChannel2> uploadChannel2 =
do_QueryInterface(httpChannel);
if (!uploadChannel2) {
nsCOMPtr<nsIConsoleService> consoleService =
do_GetService(NS_CONSOLESERVICE_CONTRACTID);
if (consoleService) {
consoleService->LogStringMessage(NS_LITERAL_STRING(
"Http channel implementation doesn't support nsIUploadChannel2. An extension has supplied a non-functional http protocol handler. This will break behavior and in future releases not work at all."
).get());
}
}
}
mUploadTransferred = 0;
mUploadTotal = 0;
// By default we don't have any upload, so mark upload complete.
mUploadComplete = true;
mErrorLoad = false;
mLoadLengthComputable = false;
mLoadTotal = 0;
if ((aVariant || !aBody.IsNull()) && httpChannel &&
!method.LowerCaseEqualsLiteral("get") &&
!method.LowerCaseEqualsLiteral("head")) {
nsAutoCString charset;
nsAutoCString defaultContentType;
nsCOMPtr<nsIInputStream> postDataStream;
rv = GetRequestBody(aVariant, aBody, getter_AddRefs(postDataStream),
&mUploadTotal, defaultContentType, charset);
NS_ENSURE_SUCCESS(rv, rv);
if (postDataStream) {
// If no content type header was set by the client, we set it to
// application/xml.
nsAutoCString contentType;
if (NS_FAILED(httpChannel->
GetRequestHeader(NS_LITERAL_CSTRING("Content-Type"),
contentType)) ||
contentType.IsEmpty()) {
contentType = defaultContentType;
}
// We don't want to set a charset for streams.
if (!charset.IsEmpty()) {
nsAutoCString specifiedCharset;
bool haveCharset;
int32_t charsetStart, charsetEnd;
rv = NS_ExtractCharsetFromContentType(contentType, specifiedCharset,
&haveCharset, &charsetStart,
&charsetEnd);
if (NS_SUCCEEDED(rv)) {
// special case: the extracted charset is quoted with single quotes
// -- for the purpose of preserving what was set we want to handle
// them as delimiters (although they aren't really)
if (specifiedCharset.Length() >= 2 &&
specifiedCharset.First() == '\'' &&
specifiedCharset.Last() == '\'') {
specifiedCharset = Substring(specifiedCharset, 1,
specifiedCharset.Length() - 2);
}
// If the content-type the page set already has a charset parameter,
// and it's the same charset, up to case, as |charset|, just send the
// page-set content-type header. Apparently at least
// google-web-toolkit is broken and relies on the exact case of its
// charset parameter, which makes things break if we use |charset|
// (which is always a fully resolved charset per our charset alias
// table, hence might be differently cased).
if (!specifiedCharset.Equals(charset,
nsCaseInsensitiveCStringComparator())) {
nsAutoCString newCharset("; charset=");
newCharset.Append(charset);
contentType.Replace(charsetStart, charsetEnd - charsetStart,
newCharset);
}
}
}
// If necessary, wrap the stream in a buffered stream so as to guarantee
// support for our upload when calling ExplicitSetUploadStream.
if (!NS_InputStreamIsBuffered(postDataStream)) {
nsCOMPtr<nsIInputStream> bufferedStream;
rv = NS_NewBufferedInputStream(getter_AddRefs(bufferedStream),
postDataStream,
4096);
NS_ENSURE_SUCCESS(rv, rv);
postDataStream = bufferedStream;
}
mUploadComplete = false;
// We want to use a newer version of the upload channel that won't
// ignore the necessary headers for an empty Content-Type.
nsCOMPtr<nsIUploadChannel2> uploadChannel2(do_QueryInterface(httpChannel));
// This assertion will fire if buggy extensions are installed
NS_ASSERTION(uploadChannel2, "http must support nsIUploadChannel2");
if (uploadChannel2) {
uploadChannel2->ExplicitSetUploadStream(postDataStream, contentType,
mUploadTotal, method, false);
}
else {
// http channel doesn't support the new nsIUploadChannel2. Emulate
// as best we can using nsIUploadChannel
if (contentType.IsEmpty()) {
contentType.AssignLiteral("application/octet-stream");
}
nsCOMPtr<nsIUploadChannel> uploadChannel =
do_QueryInterface(httpChannel);
uploadChannel->SetUploadStream(postDataStream, contentType, mUploadTotal);
// Reset the method to its original value
httpChannel->SetRequestMethod(method);
}
}
}
if (httpChannel) {
nsAutoCString contentTypeHeader;
rv = httpChannel->GetRequestHeader(NS_LITERAL_CSTRING("Content-Type"),
contentTypeHeader);
if (NS_SUCCEEDED(rv)) {
if (!nsContentUtils::IsAllowedNonCorsContentType(contentTypeHeader)) {
mCORSUnsafeHeaders.AppendElement(NS_LITERAL_CSTRING("Content-Type"));
}
}
}
ResetResponse();
rv = CheckChannelForCrossSiteRequest(mChannel);
NS_ENSURE_SUCCESS(rv, rv);
bool withCredentials = !!(mState & XML_HTTP_REQUEST_AC_WITH_CREDENTIALS);
// Hook us up to listen to redirects and the like
mChannel->GetNotificationCallbacks(getter_AddRefs(mNotificationCallbacks));
mChannel->SetNotificationCallbacks(this);
// Blocking gets are common enough out of XHR that we should mark
// the channel slow by default for pipeline purposes
AddLoadFlags(mChannel, nsIRequest::INHIBIT_PIPELINE);
nsCOMPtr<nsIHttpChannelInternal>
internalHttpChannel(do_QueryInterface(mChannel));
if (internalHttpChannel) {
// we never let XHR be blocked by head CSS/JS loads to avoid
// potential deadlock where server generation of CSS/JS requires
// an XHR signal.
internalHttpChannel->SetLoadUnblocked(true);
// Disable Necko-internal response timeouts.
internalHttpChannel->SetResponseTimeoutEnabled(false);
}
nsCOMPtr<nsIStreamListener> listener = this;
if (!IsSystemXHR()) {
// Always create a nsCORSListenerProxy here even if it's
// a same-origin request right now, since it could be redirected.
nsRefPtr<nsCORSListenerProxy> corsListener =
new nsCORSListenerProxy(listener, mPrincipal, withCredentials);
rv = corsListener->Init(mChannel, true);
NS_ENSURE_SUCCESS(rv, rv);
listener = corsListener;
}
else {
// Because of bug 682305, we can't let listener be the XHR object itself
// because JS wouldn't be able to use it. So if we haven't otherwise
// created a listener around 'this', do so now.
listener = new nsStreamListenerWrapper(listener);
}
if (mIsAnon) {
AddLoadFlags(mChannel, nsIRequest::LOAD_ANONYMOUS);
}
else {
AddLoadFlags(mChannel, nsIChannel::LOAD_EXPLICIT_CREDENTIALS);
}
NS_ASSERTION(listener != this,
"Using an object as a listener that can't be exposed to JS");
// Bypass the network cache in cases where it makes no sense:
// POST responses are always unique, and we provide no API that would
// allow our consumers to specify a "cache key" to access old POST
// responses, so they are not worth caching.
if (method.EqualsLiteral("POST")) {
AddLoadFlags(mChannel,
nsIRequest::LOAD_BYPASS_CACHE | nsIRequest::INHIBIT_CACHING);
}
// When we are sync loading, we need to bypass the local cache when it would
// otherwise block us waiting for exclusive access to the cache. If we don't
// do this, then we could dead lock in some cases (see bug 309424).
else if (!(mState & XML_HTTP_REQUEST_ASYNC)) {
AddLoadFlags(mChannel,
nsICachingChannel::LOAD_BYPASS_LOCAL_CACHE_IF_BUSY);
}
// Since we expect XML data, set the type hint accordingly
// if the channel doesn't know any content type.
// This means that we always try to parse local files as XML
// ignoring return value, as this is not critical
nsAutoCString contentType;
if (NS_FAILED(mChannel->GetContentType(contentType)) ||
contentType.IsEmpty() ||
contentType.Equals(UNKNOWN_CONTENT_TYPE)) {
mChannel->SetContentType(NS_LITERAL_CSTRING("application/xml"));
}
// We're about to send the request. Start our timeout.
mRequestSentTime = PR_Now();
StartTimeoutTimer();
// Set up the preflight if needed
if (mState & XML_HTTP_REQUEST_NEED_AC_PREFLIGHT) {
// Check to see if this initial OPTIONS request has already been cached
// in our special Access Control Cache.
rv = NS_StartCORSPreflight(mChannel, listener,
mPrincipal, withCredentials,
mCORSUnsafeHeaders,
getter_AddRefs(mCORSPreflightChannel));
NS_ENSURE_SUCCESS(rv, rv);
}
else {
mIsMappedArrayBuffer = false;
if (mResponseType == XML_HTTP_RESPONSE_TYPE_ARRAYBUFFER &&
Preferences::GetBool("dom.mapped_arraybuffer.enabled", false)) {
nsCOMPtr<nsIURI> uri;
nsAutoCString scheme;
rv = mChannel->GetURI(getter_AddRefs(uri));
if (NS_SUCCEEDED(rv)) {
uri->GetScheme(scheme);
if (scheme.LowerCaseEqualsLiteral("app") ||
scheme.LowerCaseEqualsLiteral("jar")) {
mIsMappedArrayBuffer = true;
if (XRE_GetProcessType() != GeckoProcessType_Default) {
nsCOMPtr<nsIJARChannel> jarChannel = do_QueryInterface(mChannel);
// For memory mapping from child process, we need to get file
// descriptor of the JAR file opened remotely on the parent proess.
// Set this to make sure that file descriptor can be obtained by
// child process.
jarChannel->EnsureChildFd();
}
}
}
}
// Start reading from the channel
rv = mChannel->AsyncOpen(listener, nullptr);
}
if (NS_FAILED(rv)) {
// Drop our ref to the channel to avoid cycles
mChannel = nullptr;
mCORSPreflightChannel = nullptr;
return rv;
}
// Either AsyncOpen was called, or CORS will open the channel later.
mWaitingForOnStopRequest = true;
// If we're synchronous, spin an event loop here and wait
if (!(mState & XML_HTTP_REQUEST_ASYNC)) {
mState |= XML_HTTP_REQUEST_SYNCLOOPING;
nsCOMPtr<nsIDocument> suspendedDoc;
nsCOMPtr<nsIRunnable> resumeTimeoutRunnable;
if (GetOwner()) {
nsCOMPtr<nsIDOMWindow> topWindow;
if (NS_SUCCEEDED(GetOwner()->GetTop(getter_AddRefs(topWindow)))) {
nsCOMPtr<nsPIDOMWindow> suspendedWindow(do_QueryInterface(topWindow));
if (suspendedWindow &&
(suspendedWindow = suspendedWindow->GetCurrentInnerWindow())) {
suspendedDoc = suspendedWindow->GetExtantDoc();
if (suspendedDoc) {
suspendedDoc->SuppressEventHandling(nsIDocument::eEvents);
}
suspendedWindow->SuspendTimeouts(1, false);
resumeTimeoutRunnable = new nsResumeTimeoutsEvent(suspendedWindow);
}
}
}
ChangeState(XML_HTTP_REQUEST_SENT);
{
nsAutoSyncOperation sync(suspendedDoc);
// Note, calling ChangeState may have cleared
// XML_HTTP_REQUEST_SYNCLOOPING flag.
nsIThread *thread = NS_GetCurrentThread();
while (mState & XML_HTTP_REQUEST_SYNCLOOPING) {
if (!NS_ProcessNextEvent(thread)) {
rv = NS_ERROR_UNEXPECTED;
break;
}
}
}
if (suspendedDoc) {
suspendedDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents,
true);
}
if (resumeTimeoutRunnable) {
NS_DispatchToCurrentThread(resumeTimeoutRunnable);
}
} else {
// Now that we've successfully opened the channel, we can change state. Note
// that this needs to come after the AsyncOpen() and rv check, because this
// can run script that would try to restart this request, and that could end
// up doing our AsyncOpen on a null channel if the reentered AsyncOpen fails.
ChangeState(XML_HTTP_REQUEST_SENT);
if (mUpload && mUpload->HasListenersFor(nsGkAtoms::onprogress)) {
StartProgressEventTimer();
}
DispatchProgressEvent(this, NS_LITERAL_STRING(LOADSTART_STR), false,
0, 0);
if (mUpload && !mUploadComplete) {
DispatchProgressEvent(mUpload, NS_LITERAL_STRING(LOADSTART_STR), true,
0, mUploadTotal);
}
}
if (!mChannel) {
return NS_ERROR_FAILURE;
}
return rv;
}
/* void setRequestHeader (in ByteString header, in ByteString value); */
// http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader
NS_IMETHODIMP
nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
const nsACString& value)
{
// Step 1 and 2
if (!(mState & XML_HTTP_REQUEST_OPENED)) {
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
NS_ASSERTION(mChannel, "mChannel must be valid if we're OPENED.");
// Step 3
// Make sure we don't store an invalid header name in mCORSUnsafeHeaders
if (!NS_IsValidHTTPToken(header)) {
return NS_ERROR_DOM_SYNTAX_ERR;
}
// Check that we haven't already opened the channel. We can't rely on
// the channel throwing from mChannel->SetRequestHeader since we might
// still be waiting for mCORSPreflightChannel to actually open mChannel
if (mCORSPreflightChannel) {
bool pending;
nsresult rv = mCORSPreflightChannel->IsPending(&pending);
NS_ENSURE_SUCCESS(rv, rv);
if (pending) {
return NS_ERROR_IN_PROGRESS;
}
}
if (!mChannel) // open() initializes mChannel, and open()
return NS_ERROR_FAILURE; // must be called before first setRequestHeader()
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
if (!httpChannel) {
return NS_OK;
}
// We will merge XHR headers, per the spec (secion 4.6.2) unless:
// 1 - The caller is privileged and setting an invalid header,
// or
// 2 - we have not yet explicitly set that header; this allows web
// content to override default headers the first time they set them.
bool mergeHeaders = true;
if (!IsSystemXHR()) {
// Step 5: Check for dangerous headers.
// Prevent modification to certain HTTP headers (see bug 302263), unless
// the executing script is privileged.
if (nsContentUtils::IsForbiddenRequestHeader(header)) {
NS_WARNING("refusing to set request header");
return NS_OK;
}
// Check for dangerous cross-site headers
bool safeHeader = IsSystemXHR();
if (!safeHeader) {
// Content-Type isn't always safe, but we'll deal with it in Send()
const char *kCrossOriginSafeHeaders[] = {
"accept", "accept-language", "content-language", "content-type",
"last-event-id"
};
for (uint32_t i = 0; i < ArrayLength(kCrossOriginSafeHeaders); ++i) {
if (header.LowerCaseEqualsASCII(kCrossOriginSafeHeaders[i])) {
safeHeader = true;
break;
}
}
}
if (!safeHeader) {
if (!mCORSUnsafeHeaders.Contains(header)) {
mCORSUnsafeHeaders.AppendElement(header);
}
}
} else {
// Case 1 above
if (nsContentUtils::IsForbiddenSystemRequestHeader(header)) {
mergeHeaders = false;
}
}
if (!mAlreadySetHeaders.Contains(header)) {
// Case 2 above
mergeHeaders = false;
}
// Merge headers depending on what we decided above.
nsresult rv = httpChannel->SetRequestHeader(header, value, mergeHeaders);
if (rv == NS_ERROR_INVALID_ARG) {
return NS_ERROR_DOM_SYNTAX_ERR;
}
if (NS_SUCCEEDED(rv)) {
// Remember that we've set this header, so subsequent set operations will merge values.
mAlreadySetHeaders.PutEntry(nsCString(header));
// We'll want to duplicate this header for any replacement channels (eg. on redirect)
RequestHeader reqHeader = {
nsCString(header), nsCString(value)
};
mModifiedRequestHeaders.AppendElement(reqHeader);
}
return rv;
}
/* attribute unsigned long timeout; */
NS_IMETHODIMP
nsXMLHttpRequest::GetTimeout(uint32_t *aTimeout)
{
*aTimeout = Timeout();
return NS_OK;
}
NS_IMETHODIMP
nsXMLHttpRequest::SetTimeout(uint32_t aTimeout)
{
ErrorResult rv;
SetTimeout(aTimeout, rv);
return rv.ErrorCode();
}
void
nsXMLHttpRequest::SetTimeout(uint32_t aTimeout, ErrorResult& aRv)
{
if (!(mState & (XML_HTTP_REQUEST_ASYNC | XML_HTTP_REQUEST_UNSENT)) &&
HasOrHasHadOwner()) {
/* Timeout is not supported for synchronous requests with an owning window,
per XHR2 spec. */
LogMessage("TimeoutSyncXHRWarning", GetOwner());
aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
return;
}
mTimeoutMilliseconds = aTimeout;
if (mRequestSentTime) {
StartTimeoutTimer();
}
}
void
nsXMLHttpRequest::StartTimeoutTimer()
{
NS_ABORT_IF_FALSE(mRequestSentTime,
"StartTimeoutTimer mustn't be called before the request was sent!");
if (mState & XML_HTTP_REQUEST_DONE) {
// do nothing!
return;
}
if (mTimeoutTimer) {
mTimeoutTimer->Cancel();
}
if (!mTimeoutMilliseconds) {
return;
}
if (!mTimeoutTimer) {
mTimeoutTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
}
uint32_t elapsed =
(uint32_t)((PR_Now() - mRequestSentTime) / PR_USEC_PER_MSEC);
mTimeoutTimer->InitWithCallback(
this,
mTimeoutMilliseconds > elapsed ? mTimeoutMilliseconds - elapsed : 0,
nsITimer::TYPE_ONE_SHOT
);
}
/* readonly attribute unsigned short readyState; */
NS_IMETHODIMP
nsXMLHttpRequest::GetReadyState(uint16_t *aState)
{
*aState = ReadyState();
return NS_OK;
}
uint16_t
nsXMLHttpRequest::ReadyState()
{
// Translate some of our internal states for external consumers
if (mState & XML_HTTP_REQUEST_UNSENT) {
return UNSENT;
}
if (mState & (XML_HTTP_REQUEST_OPENED | XML_HTTP_REQUEST_SENT)) {
return OPENED;
}
if (mState & XML_HTTP_REQUEST_HEADERS_RECEIVED) {
return HEADERS_RECEIVED;
}
if (mState & XML_HTTP_REQUEST_LOADING) {
return LOADING;
}
MOZ_ASSERT(mState & XML_HTTP_REQUEST_DONE);
return DONE;
}
/* void overrideMimeType(in DOMString mimetype); */
NS_IMETHODIMP
nsXMLHttpRequest::SlowOverrideMimeType(const nsAString& aMimeType)
{
OverrideMimeType(aMimeType);
return NS_OK;
}
/* attribute boolean mozBackgroundRequest; */
NS_IMETHODIMP
nsXMLHttpRequest::GetMozBackgroundRequest(bool *_retval)
{
*_retval = MozBackgroundRequest();
return NS_OK;
}
bool
nsXMLHttpRequest::MozBackgroundRequest()
{
return !!(mState & XML_HTTP_REQUEST_BACKGROUND);
}
NS_IMETHODIMP
nsXMLHttpRequest::SetMozBackgroundRequest(bool aMozBackgroundRequest)
{
nsresult rv = NS_OK;
SetMozBackgroundRequest(aMozBackgroundRequest, rv);
return rv;
}
void
nsXMLHttpRequest::SetMozBackgroundRequest(bool aMozBackgroundRequest, nsresult& aRv)
{
if (!IsSystemXHR()) {
aRv = NS_ERROR_DOM_SECURITY_ERR;
return;
}
if (!(mState & XML_HTTP_REQUEST_UNSENT)) {
// Can't change this while we're in the middle of something.
aRv = NS_ERROR_IN_PROGRESS;
return;
}
if (aMozBackgroundRequest) {
mState |= XML_HTTP_REQUEST_BACKGROUND;
} else {
mState &= ~XML_HTTP_REQUEST_BACKGROUND;
}
}
/* attribute boolean withCredentials; */
NS_IMETHODIMP
nsXMLHttpRequest::GetWithCredentials(bool *_retval)
{
*_retval = WithCredentials();
return NS_OK;
}
bool
nsXMLHttpRequest::WithCredentials()
{
return !!(mState & XML_HTTP_REQUEST_AC_WITH_CREDENTIALS);
}
NS_IMETHODIMP
nsXMLHttpRequest::SetWithCredentials(bool aWithCredentials)
{
ErrorResult rv;
SetWithCredentials(aWithCredentials, rv);
return rv.ErrorCode();
}
void
nsXMLHttpRequest::SetWithCredentials(bool aWithCredentials, ErrorResult& aRv)
{
// Return error if we're already processing a request
if (XML_HTTP_REQUEST_SENT & mState) {
aRv = NS_ERROR_FAILURE;
return;
}
// sync request is not allowed setting withCredentials in window context
if (HasOrHasHadOwner() &&
!(mState & (XML_HTTP_REQUEST_UNSENT | XML_HTTP_REQUEST_ASYNC))) {
LogMessage("WithCredentialsSyncXHRWarning", GetOwner());
aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
return;
}
if (aWithCredentials) {
mState |= XML_HTTP_REQUEST_AC_WITH_CREDENTIALS;
} else {
mState &= ~XML_HTTP_REQUEST_AC_WITH_CREDENTIALS;
}
}
nsresult
nsXMLHttpRequest::ChangeState(uint32_t aState, bool aBroadcast)
{
// If we are setting one of the mutually exclusive states,
// unset those state bits first.
if (aState & XML_HTTP_REQUEST_LOADSTATES) {
mState &= ~XML_HTTP_REQUEST_LOADSTATES;
}
mState |= aState;
nsresult rv = NS_OK;
if (mProgressNotifier &&
!(aState & (XML_HTTP_REQUEST_HEADERS_RECEIVED | XML_HTTP_REQUEST_LOADING))) {
mProgressTimerIsActive = false;
mProgressNotifier->Cancel();
}
if ((aState & XML_HTTP_REQUEST_LOADSTATES) && // Broadcast load states only
aState != XML_HTTP_REQUEST_SENT && // And not internal ones
aBroadcast &&
(mState & XML_HTTP_REQUEST_ASYNC ||
aState & XML_HTTP_REQUEST_OPENED ||
aState & XML_HTTP_REQUEST_DONE)) {
nsCOMPtr<nsIDOMEvent> event;
rv = CreateReadystatechangeEvent(getter_AddRefs(event));
NS_ENSURE_SUCCESS(rv, rv);
DispatchDOMEvent(nullptr, event, nullptr, nullptr);
}
return rv;
}
/*
* Simple helper class that just forwards the redirect callback back
* to the nsXMLHttpRequest.
*/
class AsyncVerifyRedirectCallbackForwarder MOZ_FINAL : public nsIAsyncVerifyRedirectCallback
{
public:
explicit AsyncVerifyRedirectCallbackForwarder(nsXMLHttpRequest* xhr)
: mXHR(xhr)
{
}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(AsyncVerifyRedirectCallbackForwarder)
// nsIAsyncVerifyRedirectCallback implementation
NS_IMETHOD OnRedirectVerifyCallback(nsresult result)
{
mXHR->OnRedirectVerifyCallback(result);
return NS_OK;
}
private:
~AsyncVerifyRedirectCallbackForwarder() {}
nsRefPtr<nsXMLHttpRequest> mXHR;
};
NS_IMPL_CYCLE_COLLECTION(AsyncVerifyRedirectCallbackForwarder, mXHR)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AsyncVerifyRedirectCallbackForwarder)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY(nsIAsyncVerifyRedirectCallback)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(AsyncVerifyRedirectCallbackForwarder)
NS_IMPL_CYCLE_COLLECTING_RELEASE(AsyncVerifyRedirectCallbackForwarder)
/////////////////////////////////////////////////////
// nsIChannelEventSink methods:
//
NS_IMETHODIMP
nsXMLHttpRequest::AsyncOnChannelRedirect(nsIChannel *aOldChannel,
nsIChannel *aNewChannel,
uint32_t aFlags,
nsIAsyncVerifyRedirectCallback *callback)
{
NS_PRECONDITION(aNewChannel, "Redirect without a channel?");
nsresult rv;
if (!NS_IsInternalSameURIRedirect(aOldChannel, aNewChannel, aFlags)) {
rv = CheckChannelForCrossSiteRequest(aNewChannel);
if (NS_FAILED(rv)) {
NS_WARNING("nsXMLHttpRequest::OnChannelRedirect: "
"CheckChannelForCrossSiteRequest returned failure");
return rv;
}
// Disable redirects for preflighted cross-site requests entirely for now
// Note, do this after the call to CheckChannelForCrossSiteRequest
// to make sure that XML_HTTP_REQUEST_USE_XSITE_AC is up-to-date
if ((mState & XML_HTTP_REQUEST_NEED_AC_PREFLIGHT)) {
return NS_ERROR_DOM_BAD_URI;
}
}
// Prepare to receive callback
mRedirectCallback = callback;
mNewRedirectChannel = aNewChannel;
if (mChannelEventSink) {
nsRefPtr<AsyncVerifyRedirectCallbackForwarder> fwd =
new AsyncVerifyRedirectCallbackForwarder(this);
rv = mChannelEventSink->AsyncOnChannelRedirect(aOldChannel,
aNewChannel,
aFlags, fwd);
if (NS_FAILED(rv)) {
mRedirectCallback = nullptr;
mNewRedirectChannel = nullptr;
}
return rv;
}
OnRedirectVerifyCallback(NS_OK);
return NS_OK;
}
void
nsXMLHttpRequest::OnRedirectVerifyCallback(nsresult result)
{
NS_ASSERTION(mRedirectCallback, "mRedirectCallback not set in callback");
NS_ASSERTION(mNewRedirectChannel, "mNewRedirectChannel not set in callback");
if (NS_SUCCEEDED(result)) {
mChannel = mNewRedirectChannel;
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel));
if (httpChannel) {
// Ensure all original headers are duplicated for the new channel (bug #553888)
for (uint32_t i = mModifiedRequestHeaders.Length(); i > 0; ) {
--i;
httpChannel->SetRequestHeader(mModifiedRequestHeaders[i].header,
mModifiedRequestHeaders[i].value,
false);
}
}
} else {
mErrorLoad = true;
}
mNewRedirectChannel = nullptr;
mRedirectCallback->OnRedirectVerifyCallback(result);
mRedirectCallback = nullptr;
}
/////////////////////////////////////////////////////
// nsIProgressEventSink methods:
//
void
nsXMLHttpRequest::MaybeDispatchProgressEvents(bool aFinalProgress)
{
if (aFinalProgress && mProgressTimerIsActive) {
mProgressTimerIsActive = false;
mProgressNotifier->Cancel();
}
if (mProgressTimerIsActive ||
!mProgressSinceLastProgressEvent ||
mErrorLoad ||
!(mState & XML_HTTP_REQUEST_ASYNC)) {
return;
}
if (!aFinalProgress) {
StartProgressEventTimer();
}
// We're uploading if our state is XML_HTTP_REQUEST_OPENED or
// XML_HTTP_REQUEST_SENT
if ((XML_HTTP_REQUEST_OPENED | XML_HTTP_REQUEST_SENT) & mState) {
if (mUpload && !mUploadComplete) {
DispatchProgressEvent(mUpload, NS_LITERAL_STRING(PROGRESS_STR),
mUploadLengthComputable, mUploadTransferred,
mUploadTotal);
}
} else {
if (aFinalProgress) {
mLoadTotal = mLoadTransferred;
}
mInLoadProgressEvent = true;
DispatchProgressEvent(this, NS_LITERAL_STRING(PROGRESS_STR),
mLoadLengthComputable, mLoadTransferred,
mLoadTotal);
mInLoadProgressEvent = false;
if (mResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_TEXT ||
mResponseType == XML_HTTP_RESPONSE_TYPE_CHUNKED_ARRAYBUFFER) {
mResponseBody.Truncate();
mResponseText.Truncate();
mResultArrayBuffer = nullptr;
mArrayBufferBuilder.reset();
}
}
mProgressSinceLastProgressEvent = false;
}
NS_IMETHODIMP
nsXMLHttpRequest::OnProgress(nsIRequest *aRequest, nsISupports *aContext, uint64_t aProgress, uint64_t aProgressMax)
{
// We're uploading if our state is XML_HTTP_REQUEST_OPENED or
// XML_HTTP_REQUEST_SENT
bool upload = !!((XML_HTTP_REQUEST_OPENED | XML_HTTP_REQUEST_SENT) & mState);
// When uploading, OnProgress reports also headers in aProgress and aProgressMax.
// So, try to remove the headers, if possible.
bool lengthComputable = (aProgressMax != UINT64_MAX);
if (upload) {
uint64_t loaded = aProgress;
if (lengthComputable) {
uint64_t headerSize = aProgressMax - mUploadTotal;
loaded -= headerSize;
}
mUploadLengthComputable = lengthComputable;
mUploadTransferred = loaded;
mProgressSinceLastProgressEvent = true;
MaybeDispatchProgressEvents(false);
} else {
mLoadLengthComputable = lengthComputable;
mLoadTotal = lengthComputable ? aProgressMax : 0;
mLoadTransferred = aProgress;
// Don't dispatch progress events here. OnDataAvailable will take care
// of that.
}
if (mProgressEventSink) {
mProgressEventSink->OnProgress(aRequest, aContext, aProgress,
aProgressMax);
}
return NS_OK;
}
NS_IMETHODIMP
nsXMLHttpRequest::OnStatus(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus, const char16_t *aStatusArg)
{
if (mProgressEventSink) {
mProgressEventSink->OnStatus(aRequest, aContext, aStatus, aStatusArg);
}
return NS_OK;
}
bool
nsXMLHttpRequest::AllowUploadProgress()
{
return !(mState & XML_HTTP_REQUEST_USE_XSITE_AC) ||
(mState & XML_HTTP_REQUEST_NEED_AC_PREFLIGHT);
}
/////////////////////////////////////////////////////
// nsIInterfaceRequestor methods:
//
NS_IMETHODIMP
nsXMLHttpRequest::GetInterface(const nsIID & aIID, void **aResult)
{
nsresult rv;
// Make sure to return ourselves for the channel event sink interface and
// progress event sink interface, no matter what. We can forward these to
// mNotificationCallbacks if it wants to get notifications for them. But we
// need to see these notifications for proper functioning.
if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) {
mChannelEventSink = do_GetInterface(mNotificationCallbacks);
*aResult = static_cast<nsIChannelEventSink*>(EnsureXPCOMifier().take());
return NS_OK;
} else if (aIID.Equals(NS_GET_IID(nsIProgressEventSink))) {
mProgressEventSink = do_GetInterface(mNotificationCallbacks);
*aResult = static_cast<nsIProgressEventSink*>(EnsureXPCOMifier().take());
return NS_OK;
}
// Now give mNotificationCallbacks (if non-null) a chance to return the
// desired interface.
if (mNotificationCallbacks) {
rv = mNotificationCallbacks->GetInterface(aIID, aResult);
if (NS_SUCCEEDED(rv)) {
NS_ASSERTION(*aResult, "Lying nsIInterfaceRequestor implementation!");
return rv;
}
}
if (mState & XML_HTTP_REQUEST_BACKGROUND) {
nsCOMPtr<nsIInterfaceRequestor> badCertHandler(do_CreateInstance(NS_BADCERTHANDLER_CONTRACTID, &rv));
// Ignore failure to get component, we may not have all its dependencies
// available
if (NS_SUCCEEDED(rv)) {
rv = badCertHandler->GetInterface(aIID, aResult);
if (NS_SUCCEEDED(rv))
return rv;
}
}
else if (aIID.Equals(NS_GET_IID(nsIAuthPrompt)) ||
aIID.Equals(NS_GET_IID(nsIAuthPrompt2))) {
nsCOMPtr<nsIURI> uri;
rv = mChannel->GetURI(getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, rv);
// Verify that it's ok to prompt for credentials here, per spec
// http://xhr.spec.whatwg.org/#the-send%28%29-method
bool showPrompt = true;
// If authentication fails, XMLHttpRequest origin and
// the request URL are same origin, ...
/* Disabled - bug: 799540
if (mState & XML_HTTP_REQUEST_USE_XSITE_AC) {
showPrompt = false;
}
*/
// ... Authorization is not in the list of author request headers, ...
if (showPrompt) {
for (uint32_t i = 0, len = mModifiedRequestHeaders.Length(); i < len; ++i) {
if (mModifiedRequestHeaders[i].header.
LowerCaseEqualsLiteral("authorization")) {
showPrompt = false;
break;
}
}
}
// ... request username is null, and request password is null,
if (showPrompt) {
nsCString username;
rv = uri->GetUsername(username);
NS_ENSURE_SUCCESS(rv, rv);
nsCString password;
rv = uri->GetPassword(password);
NS_ENSURE_SUCCESS(rv, rv);
if (!username.IsEmpty() || !password.IsEmpty()) {
showPrompt = false;
}
}
// ... user agents should prompt the end user for their username and password.
if (!showPrompt) {
nsRefPtr<XMLHttpRequestAuthPrompt> prompt = new XMLHttpRequestAuthPrompt();
if (!prompt)
return NS_ERROR_OUT_OF_MEMORY;
return prompt->QueryInterface(aIID, aResult);
}
nsCOMPtr<nsIPromptFactory> wwatch =
do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
// Get the an auth prompter for our window so that the parenting
// of the dialogs works as it should when using tabs.
nsCOMPtr<nsIDOMWindow> window;
if (GetOwner()) {
window = GetOwner()->GetOuterWindow();
}
return wwatch->GetPrompt(window, aIID,
reinterpret_cast<void**>(aResult));
}
// Now check for the various XHR non-DOM interfaces, except
// nsIProgressEventSink and nsIChannelEventSink which we already
// handled above.
else if (aIID.Equals(NS_GET_IID(nsIStreamListener))) {
*aResult = static_cast<nsIStreamListener*>(EnsureXPCOMifier().take());
return NS_OK;
}
else if (aIID.Equals(NS_GET_IID(nsIRequestObserver))) {
*aResult = static_cast<nsIRequestObserver*>(EnsureXPCOMifier().take());
return NS_OK;
}
else if (aIID.Equals(NS_GET_IID(nsITimerCallback))) {
*aResult = static_cast<nsITimerCallback*>(EnsureXPCOMifier().take());
return NS_OK;
}
return QueryInterface(aIID, aResult);
}
void
nsXMLHttpRequest::GetInterface(JSContext* aCx, nsIJSID* aIID,
JS::MutableHandle<JS::Value> aRetval,
ErrorResult& aRv)
{
dom::GetInterface(aCx, this, aIID, aRetval, aRv);
}
nsXMLHttpRequestUpload*
nsXMLHttpRequest::Upload()
{
if (!mUpload) {
mUpload = new nsXMLHttpRequestUpload(this);
}
return mUpload;
}
NS_IMETHODIMP
nsXMLHttpRequest::GetUpload(nsIXMLHttpRequestUpload** aUpload)
{
nsRefPtr<nsXMLHttpRequestUpload> upload = Upload();
upload.forget(aUpload);
return NS_OK;
}
bool
nsXMLHttpRequest::MozAnon()
{
return mIsAnon;
}
NS_IMETHODIMP
nsXMLHttpRequest::GetMozAnon(bool* aAnon)
{
*aAnon = MozAnon();
return NS_OK;
}
bool
nsXMLHttpRequest::MozSystem()
{
return IsSystemXHR();
}
NS_IMETHODIMP
nsXMLHttpRequest::GetMozSystem(bool* aSystem)
{
*aSystem = MozSystem();
return NS_OK;
}
void
nsXMLHttpRequest::HandleTimeoutCallback()
{
if (mState & XML_HTTP_REQUEST_DONE) {
NS_NOTREACHED("nsXMLHttpRequest::HandleTimeoutCallback with completed request");
// do nothing!
return;
}
CloseRequestWithError(NS_LITERAL_STRING(TIMEOUT_STR),
XML_HTTP_REQUEST_TIMED_OUT);
}
NS_IMETHODIMP
nsXMLHttpRequest::Notify(nsITimer* aTimer)
{
if (mProgressNotifier == aTimer) {
HandleProgressTimerCallback();
return NS_OK;
}
if (mTimeoutTimer == aTimer) {
HandleTimeoutCallback();
return NS_OK;
}
// Just in case some JS user wants to QI to nsITimerCallback and play with us...
NS_WARNING("Unexpected timer!");
return NS_ERROR_INVALID_POINTER;
}
void
nsXMLHttpRequest::HandleProgressTimerCallback()
{
mProgressTimerIsActive = false;
MaybeDispatchProgressEvents(false);
}
void
nsXMLHttpRequest::StartProgressEventTimer()
{
if (!mProgressNotifier) {
mProgressNotifier = do_CreateInstance(NS_TIMER_CONTRACTID);
}
if (mProgressNotifier) {
mProgressTimerIsActive = true;
mProgressNotifier->Cancel();
mProgressNotifier->InitWithCallback(this, NS_PROGRESS_EVENT_INTERVAL,
nsITimer::TYPE_ONE_SHOT);
}
}
already_AddRefed<nsXMLHttpRequestXPCOMifier>
nsXMLHttpRequest::EnsureXPCOMifier()
{
if (!mXPCOMifier) {
mXPCOMifier = new nsXMLHttpRequestXPCOMifier(this);
}
nsRefPtr<nsXMLHttpRequestXPCOMifier> newRef(mXPCOMifier);
return newRef.forget();
}
NS_IMPL_ISUPPORTS(nsXMLHttpRequest::nsHeaderVisitor, nsIHttpHeaderVisitor)
NS_IMETHODIMP nsXMLHttpRequest::
nsHeaderVisitor::VisitHeader(const nsACString &header, const nsACString &value)
{
if (mXHR->IsSafeHeader(header, mHttpChannel)) {
mHeaders.Append(header);
mHeaders.AppendLiteral(": ");
mHeaders.Append(value);
mHeaders.AppendLiteral("\r\n");
}
return NS_OK;
}
// nsXMLHttpRequestXPCOMifier implementation
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXMLHttpRequestXPCOMifier)
NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
NS_INTERFACE_MAP_ENTRY(nsIProgressEventSink)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIStreamListener)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXMLHttpRequestXPCOMifier)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXMLHttpRequestXPCOMifier)
// Can't NS_IMPL_CYCLE_COLLECTION( because mXHR has ambiguous
// inheritance from nsISupports.
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXMLHttpRequestXPCOMifier)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXMLHttpRequestXPCOMifier)
if (tmp->mXHR) {
tmp->mXHR->mXPCOMifier = nullptr;
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mXHR)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXMLHttpRequestXPCOMifier)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXHR)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMETHODIMP
nsXMLHttpRequestXPCOMifier::GetInterface(const nsIID & aIID, void **aResult)
{
// Return ourselves for the things we implement (except
// nsIInterfaceRequestor) and the XHR for the rest.
if (!aIID.Equals(NS_GET_IID(nsIInterfaceRequestor))) {
nsresult rv = QueryInterface(aIID, aResult);
if (NS_SUCCEEDED(rv)) {
return rv;
}
}
return mXHR->GetInterface(aIID, aResult);
}
namespace mozilla {
ArrayBufferBuilder::ArrayBufferBuilder()
: mDataPtr(nullptr),
mCapacity(0),
mLength(0),
mMapPtr(nullptr)
{
}
ArrayBufferBuilder::~ArrayBufferBuilder()
{
reset();
}
void
ArrayBufferBuilder::reset()
{
if (mDataPtr) {
JS_free(nullptr, mDataPtr);
}
if (mMapPtr) {
JS_ReleaseMappedArrayBufferContents(mMapPtr, mLength);
mMapPtr = nullptr;
}
mDataPtr = nullptr;
mCapacity = mLength = 0;
}
bool
ArrayBufferBuilder::setCapacity(uint32_t aNewCap)
{
MOZ_ASSERT(!mMapPtr);
uint8_t *newdata = (uint8_t *) js_realloc(mDataPtr, aNewCap);
if (!newdata) {
return false;
}
if (aNewCap > mCapacity) {
memset(newdata + mCapacity, 0, aNewCap - mCapacity);
}
mDataPtr = newdata;
mCapacity = aNewCap;
if (mLength > aNewCap) {
mLength = aNewCap;
}
return true;
}
bool
ArrayBufferBuilder::append(const uint8_t *aNewData, uint32_t aDataLen,
uint32_t aMaxGrowth)
{
MOZ_ASSERT(!mMapPtr);
if (mLength + aDataLen > mCapacity) {
uint32_t newcap;
// Double while under aMaxGrowth or if not specified.
if (!aMaxGrowth || mCapacity < aMaxGrowth) {
newcap = mCapacity * 2;
} else {
newcap = mCapacity + aMaxGrowth;
}
// But make sure there's always enough to satisfy our request.
if (newcap < mLength + aDataLen) {
newcap = mLength + aDataLen;
}
// Did we overflow?
if (newcap < mCapacity) {
return false;
}
if (!setCapacity(newcap)) {
return false;
}
}
// Assert that the region isn't overlapping so we can memcpy.
MOZ_ASSERT(!areOverlappingRegions(aNewData, aDataLen, mDataPtr + mLength,
aDataLen));
memcpy(mDataPtr + mLength, aNewData, aDataLen);
mLength += aDataLen;
return true;
}
JSObject*
ArrayBufferBuilder::getArrayBuffer(JSContext* aCx)
{
if (mMapPtr) {
JSObject* obj = JS_NewMappedArrayBufferWithContents(aCx, mLength, mMapPtr);
if (!obj) {
JS_ReleaseMappedArrayBufferContents(mMapPtr, mLength);
}
mMapPtr = nullptr;
// The memory-mapped contents will be released when obj been finalized(GCed
// or neutered).
return obj;
}
// we need to check for mLength == 0, because nothing may have been
// added
if (mCapacity > mLength || mLength == 0) {
if (!setCapacity(mLength)) {
return nullptr;
}
}
JSObject* obj = JS_NewArrayBufferWithContents(aCx, mLength, mDataPtr);
mLength = mCapacity = 0;
if (!obj) {
js_free(mDataPtr);
}
mDataPtr = nullptr;
return obj;
}
nsresult
ArrayBufferBuilder::mapToFileInPackage(const nsCString& aFile,
nsIFile* aJarFile)
{
#ifdef XP_WIN
// TODO: Bug 988813 - Support memory mapped array buffer for Windows platform.
MOZ_CRASH("Not implemented");
return NS_ERROR_NOT_IMPLEMENTED;
#else
nsresult rv;
// Open Jar file to get related attributes of target file.
nsRefPtr<nsZipArchive> zip = new nsZipArchive();
rv = zip->OpenArchive(aJarFile);
if (NS_FAILED(rv)) {
return rv;
}
nsZipItem* zipItem = zip->GetItem(aFile.get());
if (!zipItem) {
return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST;
}
// If file was added to the package as stored(uncompressed), map to the
// offset of file in zip package.
if (!zipItem->Compression()) {
uint32_t offset = zip->GetDataOffset(zipItem);
uint32_t size = zipItem->RealSize();
mozilla::AutoFDClose pr_fd;
mozilla::ScopedClose fd;
rv = aJarFile->OpenNSPRFileDesc(PR_RDONLY, 0, &pr_fd.rwget());
if (NS_FAILED(rv)) {
return rv;
}
fd.rwget() = PR_FileDesc2NativeHandle(pr_fd);
mMapPtr = JS_CreateMappedArrayBufferContents(fd, offset, size);
if (mMapPtr) {
mLength = size;
return NS_OK;
}
}
return NS_ERROR_FAILURE;
#endif
}
/* static */ bool
ArrayBufferBuilder::areOverlappingRegions(const uint8_t* aStart1,
uint32_t aLength1,
const uint8_t* aStart2,
uint32_t aLength2)
{
const uint8_t* end1 = aStart1 + aLength1;
const uint8_t* end2 = aStart2 + aLength2;
const uint8_t* max_start = aStart1 > aStart2 ? aStart1 : aStart2;
const uint8_t* min_end = end1 < end2 ? end1 : end2;
return max_start < min_end;
}
} // namespace mozilla