gecko/dom/html/nsHTMLDocument.cpp
Birunthan Mohanathas 3703bda816 Bug 946065 - Part 11: Move content/html/ to dom/ and flatten subdirectories. r=peterv
--HG--
rename : content/html/document/src/HTMLAllCollection.cpp => dom/html/HTMLAllCollection.cpp
rename : content/html/document/src/HTMLAllCollection.h => dom/html/HTMLAllCollection.h
rename : content/html/content/src/HTMLAnchorElement.cpp => dom/html/HTMLAnchorElement.cpp
rename : content/html/content/src/HTMLAnchorElement.h => dom/html/HTMLAnchorElement.h
rename : content/html/content/src/HTMLAreaElement.cpp => dom/html/HTMLAreaElement.cpp
rename : content/html/content/src/HTMLAreaElement.h => dom/html/HTMLAreaElement.h
rename : content/html/content/src/HTMLAudioElement.cpp => dom/html/HTMLAudioElement.cpp
rename : content/html/content/public/HTMLAudioElement.h => dom/html/HTMLAudioElement.h
rename : content/html/content/src/HTMLBRElement.cpp => dom/html/HTMLBRElement.cpp
rename : content/html/content/src/HTMLBRElement.h => dom/html/HTMLBRElement.h
rename : content/html/content/src/HTMLBodyElement.cpp => dom/html/HTMLBodyElement.cpp
rename : content/html/content/src/HTMLBodyElement.h => dom/html/HTMLBodyElement.h
rename : content/html/content/src/HTMLButtonElement.cpp => dom/html/HTMLButtonElement.cpp
rename : content/html/content/src/HTMLButtonElement.h => dom/html/HTMLButtonElement.h
rename : content/html/content/src/HTMLCanvasElement.cpp => dom/html/HTMLCanvasElement.cpp
rename : content/html/content/public/HTMLCanvasElement.h => dom/html/HTMLCanvasElement.h
rename : content/html/content/src/HTMLContentElement.cpp => dom/html/HTMLContentElement.cpp
rename : content/html/content/src/HTMLContentElement.h => dom/html/HTMLContentElement.h
rename : content/html/content/src/HTMLDataElement.cpp => dom/html/HTMLDataElement.cpp
rename : content/html/content/src/HTMLDataElement.h => dom/html/HTMLDataElement.h
rename : content/html/content/src/HTMLDataListElement.cpp => dom/html/HTMLDataListElement.cpp
rename : content/html/content/src/HTMLDataListElement.h => dom/html/HTMLDataListElement.h
rename : content/html/content/src/HTMLDivElement.cpp => dom/html/HTMLDivElement.cpp
rename : content/html/content/src/HTMLDivElement.h => dom/html/HTMLDivElement.h
rename : content/html/content/src/HTMLElement.cpp => dom/html/HTMLElement.cpp
rename : content/html/content/src/HTMLFieldSetElement.cpp => dom/html/HTMLFieldSetElement.cpp
rename : content/html/content/src/HTMLFieldSetElement.h => dom/html/HTMLFieldSetElement.h
rename : content/html/content/src/HTMLFontElement.cpp => dom/html/HTMLFontElement.cpp
rename : content/html/content/src/HTMLFontElement.h => dom/html/HTMLFontElement.h
rename : content/html/content/src/HTMLFormControlsCollection.cpp => dom/html/HTMLFormControlsCollection.cpp
rename : content/html/content/src/HTMLFormControlsCollection.h => dom/html/HTMLFormControlsCollection.h
rename : content/html/content/src/HTMLFormElement.cpp => dom/html/HTMLFormElement.cpp
rename : content/html/content/src/HTMLFormElement.h => dom/html/HTMLFormElement.h
rename : content/html/content/src/HTMLFrameElement.cpp => dom/html/HTMLFrameElement.cpp
rename : content/html/content/src/HTMLFrameElement.h => dom/html/HTMLFrameElement.h
rename : content/html/content/src/HTMLFrameSetElement.cpp => dom/html/HTMLFrameSetElement.cpp
rename : content/html/content/src/HTMLFrameSetElement.h => dom/html/HTMLFrameSetElement.h
rename : content/html/content/src/HTMLHRElement.cpp => dom/html/HTMLHRElement.cpp
rename : content/html/content/src/HTMLHRElement.h => dom/html/HTMLHRElement.h
rename : content/html/content/src/HTMLHeadingElement.cpp => dom/html/HTMLHeadingElement.cpp
rename : content/html/content/src/HTMLHeadingElement.h => dom/html/HTMLHeadingElement.h
rename : content/html/content/src/HTMLIFrameElement.cpp => dom/html/HTMLIFrameElement.cpp
rename : content/html/content/src/HTMLIFrameElement.h => dom/html/HTMLIFrameElement.h
rename : content/html/content/src/HTMLImageElement.cpp => dom/html/HTMLImageElement.cpp
rename : content/html/content/src/HTMLImageElement.h => dom/html/HTMLImageElement.h
rename : content/html/content/src/HTMLInputElement.cpp => dom/html/HTMLInputElement.cpp
rename : content/html/content/src/HTMLInputElement.h => dom/html/HTMLInputElement.h
rename : content/html/content/src/HTMLLIElement.cpp => dom/html/HTMLLIElement.cpp
rename : content/html/content/src/HTMLLIElement.h => dom/html/HTMLLIElement.h
rename : content/html/content/src/HTMLLabelElement.cpp => dom/html/HTMLLabelElement.cpp
rename : content/html/content/src/HTMLLabelElement.h => dom/html/HTMLLabelElement.h
rename : content/html/content/src/HTMLLegendElement.cpp => dom/html/HTMLLegendElement.cpp
rename : content/html/content/src/HTMLLegendElement.h => dom/html/HTMLLegendElement.h
rename : content/html/content/src/HTMLLinkElement.cpp => dom/html/HTMLLinkElement.cpp
rename : content/html/content/src/HTMLLinkElement.h => dom/html/HTMLLinkElement.h
rename : content/html/content/src/HTMLMapElement.cpp => dom/html/HTMLMapElement.cpp
rename : content/html/content/src/HTMLMapElement.h => dom/html/HTMLMapElement.h
rename : content/html/content/src/HTMLMediaElement.cpp => dom/html/HTMLMediaElement.cpp
rename : content/html/content/public/HTMLMediaElement.h => dom/html/HTMLMediaElement.h
rename : content/html/content/src/HTMLMenuElement.cpp => dom/html/HTMLMenuElement.cpp
rename : content/html/content/src/HTMLMenuElement.h => dom/html/HTMLMenuElement.h
rename : content/html/content/src/HTMLMenuItemElement.cpp => dom/html/HTMLMenuItemElement.cpp
rename : content/html/content/src/HTMLMenuItemElement.h => dom/html/HTMLMenuItemElement.h
rename : content/html/content/src/HTMLMetaElement.cpp => dom/html/HTMLMetaElement.cpp
rename : content/html/content/src/HTMLMetaElement.h => dom/html/HTMLMetaElement.h
rename : content/html/content/src/HTMLMeterElement.cpp => dom/html/HTMLMeterElement.cpp
rename : content/html/content/src/HTMLMeterElement.h => dom/html/HTMLMeterElement.h
rename : content/html/content/src/HTMLModElement.cpp => dom/html/HTMLModElement.cpp
rename : content/html/content/src/HTMLModElement.h => dom/html/HTMLModElement.h
rename : content/html/content/src/HTMLObjectElement.cpp => dom/html/HTMLObjectElement.cpp
rename : content/html/content/src/HTMLObjectElement.h => dom/html/HTMLObjectElement.h
rename : content/html/content/src/HTMLOptGroupElement.cpp => dom/html/HTMLOptGroupElement.cpp
rename : content/html/content/src/HTMLOptGroupElement.h => dom/html/HTMLOptGroupElement.h
rename : content/html/content/src/HTMLOptionElement.cpp => dom/html/HTMLOptionElement.cpp
rename : content/html/content/src/HTMLOptionElement.h => dom/html/HTMLOptionElement.h
rename : content/html/content/src/HTMLOptionsCollection.cpp => dom/html/HTMLOptionsCollection.cpp
rename : content/html/content/src/HTMLOptionsCollection.h => dom/html/HTMLOptionsCollection.h
rename : content/html/content/src/HTMLOutputElement.cpp => dom/html/HTMLOutputElement.cpp
rename : content/html/content/src/HTMLOutputElement.h => dom/html/HTMLOutputElement.h
rename : content/html/content/src/HTMLParagraphElement.cpp => dom/html/HTMLParagraphElement.cpp
rename : content/html/content/src/HTMLParagraphElement.h => dom/html/HTMLParagraphElement.h
rename : content/html/content/src/HTMLPictureElement.cpp => dom/html/HTMLPictureElement.cpp
rename : content/html/content/src/HTMLPictureElement.h => dom/html/HTMLPictureElement.h
rename : content/html/content/src/HTMLPreElement.cpp => dom/html/HTMLPreElement.cpp
rename : content/html/content/src/HTMLPreElement.h => dom/html/HTMLPreElement.h
rename : content/html/content/src/HTMLProgressElement.cpp => dom/html/HTMLProgressElement.cpp
rename : content/html/content/src/HTMLProgressElement.h => dom/html/HTMLProgressElement.h
rename : content/html/content/src/HTMLPropertiesCollection.cpp => dom/html/HTMLPropertiesCollection.cpp
rename : content/html/content/src/HTMLPropertiesCollection.h => dom/html/HTMLPropertiesCollection.h
rename : content/html/content/src/HTMLScriptElement.cpp => dom/html/HTMLScriptElement.cpp
rename : content/html/content/src/HTMLScriptElement.h => dom/html/HTMLScriptElement.h
rename : content/html/content/src/HTMLSelectElement.cpp => dom/html/HTMLSelectElement.cpp
rename : content/html/content/src/HTMLSelectElement.h => dom/html/HTMLSelectElement.h
rename : content/html/content/src/HTMLShadowElement.cpp => dom/html/HTMLShadowElement.cpp
rename : content/html/content/src/HTMLShadowElement.h => dom/html/HTMLShadowElement.h
rename : content/html/content/src/HTMLSharedElement.cpp => dom/html/HTMLSharedElement.cpp
rename : content/html/content/src/HTMLSharedElement.h => dom/html/HTMLSharedElement.h
rename : content/html/content/src/HTMLSharedListElement.cpp => dom/html/HTMLSharedListElement.cpp
rename : content/html/content/src/HTMLSharedListElement.h => dom/html/HTMLSharedListElement.h
rename : content/html/content/src/HTMLSharedObjectElement.cpp => dom/html/HTMLSharedObjectElement.cpp
rename : content/html/content/src/HTMLSharedObjectElement.h => dom/html/HTMLSharedObjectElement.h
rename : content/html/content/src/HTMLSourceElement.cpp => dom/html/HTMLSourceElement.cpp
rename : content/html/content/src/HTMLSourceElement.h => dom/html/HTMLSourceElement.h
rename : content/html/content/src/HTMLSpanElement.cpp => dom/html/HTMLSpanElement.cpp
rename : content/html/content/src/HTMLSpanElement.h => dom/html/HTMLSpanElement.h
rename : content/html/content/src/HTMLStyleElement.cpp => dom/html/HTMLStyleElement.cpp
rename : content/html/content/src/HTMLStyleElement.h => dom/html/HTMLStyleElement.h
rename : content/html/content/src/HTMLTableCaptionElement.cpp => dom/html/HTMLTableCaptionElement.cpp
rename : content/html/content/src/HTMLTableCaptionElement.h => dom/html/HTMLTableCaptionElement.h
rename : content/html/content/src/HTMLTableCellElement.cpp => dom/html/HTMLTableCellElement.cpp
rename : content/html/content/src/HTMLTableCellElement.h => dom/html/HTMLTableCellElement.h
rename : content/html/content/src/HTMLTableColElement.cpp => dom/html/HTMLTableColElement.cpp
rename : content/html/content/src/HTMLTableColElement.h => dom/html/HTMLTableColElement.h
rename : content/html/content/src/HTMLTableElement.cpp => dom/html/HTMLTableElement.cpp
rename : content/html/content/src/HTMLTableElement.h => dom/html/HTMLTableElement.h
rename : content/html/content/src/HTMLTableRowElement.cpp => dom/html/HTMLTableRowElement.cpp
rename : content/html/content/src/HTMLTableRowElement.h => dom/html/HTMLTableRowElement.h
rename : content/html/content/src/HTMLTableSectionElement.cpp => dom/html/HTMLTableSectionElement.cpp
rename : content/html/content/src/HTMLTableSectionElement.h => dom/html/HTMLTableSectionElement.h
rename : content/html/content/src/HTMLTemplateElement.cpp => dom/html/HTMLTemplateElement.cpp
rename : content/html/content/src/HTMLTemplateElement.h => dom/html/HTMLTemplateElement.h
rename : content/html/content/src/HTMLTextAreaElement.cpp => dom/html/HTMLTextAreaElement.cpp
rename : content/html/content/src/HTMLTextAreaElement.h => dom/html/HTMLTextAreaElement.h
rename : content/html/content/src/HTMLTimeElement.cpp => dom/html/HTMLTimeElement.cpp
rename : content/html/content/src/HTMLTimeElement.h => dom/html/HTMLTimeElement.h
rename : content/html/content/src/HTMLTitleElement.cpp => dom/html/HTMLTitleElement.cpp
rename : content/html/content/src/HTMLTitleElement.h => dom/html/HTMLTitleElement.h
rename : content/html/content/src/HTMLTrackElement.cpp => dom/html/HTMLTrackElement.cpp
rename : content/html/content/src/HTMLTrackElement.h => dom/html/HTMLTrackElement.h
rename : content/html/content/src/HTMLUnknownElement.cpp => dom/html/HTMLUnknownElement.cpp
rename : content/html/content/src/HTMLUnknownElement.h => dom/html/HTMLUnknownElement.h
rename : content/html/content/src/HTMLVideoElement.cpp => dom/html/HTMLVideoElement.cpp
rename : content/html/content/public/HTMLVideoElement.h => dom/html/HTMLVideoElement.h
rename : content/html/document/src/ImageDocument.cpp => dom/html/ImageDocument.cpp
rename : content/html/document/src/ImageDocument.h => dom/html/ImageDocument.h
rename : content/html/document/src/MediaDocument.cpp => dom/html/MediaDocument.cpp
rename : content/html/document/src/MediaDocument.h => dom/html/MediaDocument.h
rename : content/html/content/src/MediaError.cpp => dom/html/MediaError.cpp
rename : content/html/content/src/MediaError.h => dom/html/MediaError.h
rename : content/html/document/src/PluginDocument.cpp => dom/html/PluginDocument.cpp
rename : content/html/content/src/RadioNodeList.cpp => dom/html/RadioNodeList.cpp
rename : content/html/content/src/RadioNodeList.h => dom/html/RadioNodeList.h
rename : content/html/content/src/TextTrackManager.cpp => dom/html/TextTrackManager.cpp
rename : content/html/content/src/TextTrackManager.h => dom/html/TextTrackManager.h
rename : content/html/content/src/TimeRanges.cpp => dom/html/TimeRanges.cpp
rename : content/html/content/src/TimeRanges.h => dom/html/TimeRanges.h
rename : content/html/content/src/UndoManager.cpp => dom/html/UndoManager.cpp
rename : content/html/content/src/UndoManager.h => dom/html/UndoManager.h
rename : content/html/content/src/ValidityState.cpp => dom/html/ValidityState.cpp
rename : content/html/content/src/ValidityState.h => dom/html/ValidityState.h
rename : content/html/document/src/VideoDocument.cpp => dom/html/VideoDocument.cpp
rename : content/html/content/crashtests/1032654.html => dom/html/crashtests/1032654.html
rename : content/html/content/crashtests/257818-1.html => dom/html/crashtests/257818-1.html
rename : content/html/document/crashtests/285166-1.html => dom/html/crashtests/285166-1.html
rename : content/html/document/crashtests/294235-1.html => dom/html/crashtests/294235-1.html
rename : content/html/content/crashtests/307616-1.html => dom/html/crashtests/307616-1.html
rename : content/html/content/crashtests/324918-1.xhtml => dom/html/crashtests/324918-1.xhtml
rename : content/html/content/crashtests/338649-1.xhtml => dom/html/crashtests/338649-1.xhtml
rename : content/html/content/crashtests/339501-1.xhtml => dom/html/crashtests/339501-1.xhtml
rename : content/html/content/crashtests/339501-2.xhtml => dom/html/crashtests/339501-2.xhtml
rename : content/html/document/crashtests/378993-1.xhtml => dom/html/crashtests/378993-1.xhtml
rename : content/html/content/crashtests/382568-1-inner.xhtml => dom/html/crashtests/382568-1-inner.xhtml
rename : content/html/content/crashtests/382568-1.html => dom/html/crashtests/382568-1.html
rename : content/html/content/crashtests/383137.xhtml => dom/html/crashtests/383137.xhtml
rename : content/html/document/crashtests/388183-1.html => dom/html/crashtests/388183-1.html
rename : content/html/document/crashtests/395340-1.html => dom/html/crashtests/395340-1.html
rename : content/html/document/crashtests/399694-1.html => dom/html/crashtests/399694-1.html
rename : content/html/document/crashtests/407053.html => dom/html/crashtests/407053.html
rename : content/html/content/crashtests/423371-1.html => dom/html/crashtests/423371-1.html
rename : content/html/document/crashtests/448564.html => dom/html/crashtests/448564.html
rename : content/html/content/crashtests/451123-1.html => dom/html/crashtests/451123-1.html
rename : content/html/content/crashtests/453406-1.html => dom/html/crashtests/453406-1.html
rename : content/html/content/crashtests/464197-1.html => dom/html/crashtests/464197-1.html
rename : content/html/content/crashtests/465466-1.xhtml => dom/html/crashtests/465466-1.xhtml
rename : content/html/document/crashtests/468562-1.html => dom/html/crashtests/468562-1.html
rename : content/html/document/crashtests/468562-2.html => dom/html/crashtests/468562-2.html
rename : content/html/document/crashtests/494225.html => dom/html/crashtests/494225.html
rename : content/html/document/crashtests/495543.svg => dom/html/crashtests/495543.svg
rename : content/html/content/crashtests/504183-1.html => dom/html/crashtests/504183-1.html
rename : content/html/content/crashtests/515829-1.html => dom/html/crashtests/515829-1.html
rename : content/html/content/crashtests/515829-2.html => dom/html/crashtests/515829-2.html
rename : content/html/document/crashtests/564461.xhtml => dom/html/crashtests/564461.xhtml
rename : content/html/content/crashtests/570566-1.html => dom/html/crashtests/570566-1.html
rename : content/html/content/crashtests/571428-1.html => dom/html/crashtests/571428-1.html
rename : content/html/content/crashtests/580507-1.xhtml => dom/html/crashtests/580507-1.xhtml
rename : content/html/content/crashtests/590387.html => dom/html/crashtests/590387.html
rename : content/html/content/crashtests/596785-1.html => dom/html/crashtests/596785-1.html
rename : content/html/content/crashtests/596785-2.html => dom/html/crashtests/596785-2.html
rename : content/html/document/crashtests/601422.html => dom/html/crashtests/601422.html
rename : content/html/content/crashtests/602117.html => dom/html/crashtests/602117.html
rename : content/html/content/crashtests/604807.html => dom/html/crashtests/604807.html
rename : content/html/content/crashtests/605264.html => dom/html/crashtests/605264.html
rename : content/html/content/crashtests/606430-1.html => dom/html/crashtests/606430-1.html
rename : content/html/content/crashtests/613027.html => dom/html/crashtests/613027.html
rename : content/html/content/crashtests/614279.html => dom/html/crashtests/614279.html
rename : content/html/content/crashtests/614988-1.html => dom/html/crashtests/614988-1.html
rename : content/html/content/crashtests/616401.html => dom/html/crashtests/616401.html
rename : content/html/content/crashtests/620078-1.html => dom/html/crashtests/620078-1.html
rename : content/html/content/crashtests/620078-2.html => dom/html/crashtests/620078-2.html
rename : content/html/document/crashtests/631421.html => dom/html/crashtests/631421.html
rename : content/html/document/crashtests/631421.png => dom/html/crashtests/631421.png
rename : content/html/content/crashtests/673853.html => dom/html/crashtests/673853.html
rename : content/html/content/crashtests/680922-1.xul => dom/html/crashtests/680922-1.xul
rename : content/html/content/crashtests/680922-binding.xml => dom/html/crashtests/680922-binding.xml
rename : content/html/content/crashtests/682058.xhtml => dom/html/crashtests/682058.xhtml
rename : content/html/content/crashtests/682460.html => dom/html/crashtests/682460.html
rename : content/html/content/crashtests/68912-1.html => dom/html/crashtests/68912-1.html
rename : content/html/content/crashtests/738744.xhtml => dom/html/crashtests/738744.xhtml
rename : content/html/document/crashtests/741218.json => dom/html/crashtests/741218.json
rename : content/html/document/crashtests/741218.json^headers^ => dom/html/crashtests/741218.json^headers^
rename : content/html/content/crashtests/741250.xhtml => dom/html/crashtests/741250.xhtml
rename : content/html/content/crashtests/795221-1.html => dom/html/crashtests/795221-1.html
rename : content/html/content/crashtests/795221-2.html => dom/html/crashtests/795221-2.html
rename : content/html/content/crashtests/795221-3.html => dom/html/crashtests/795221-3.html
rename : content/html/content/crashtests/795221-4.html => dom/html/crashtests/795221-4.html
rename : content/html/content/crashtests/795221-5.xml => dom/html/crashtests/795221-5.xml
rename : content/html/content/crashtests/798802-1.html => dom/html/crashtests/798802-1.html
rename : content/html/content/crashtests/811226.html => dom/html/crashtests/811226.html
rename : content/html/content/crashtests/819745.html => dom/html/crashtests/819745.html
rename : content/html/content/crashtests/828180.html => dom/html/crashtests/828180.html
rename : content/html/content/crashtests/828472.html => dom/html/crashtests/828472.html
rename : content/html/content/crashtests/837033.html => dom/html/crashtests/837033.html
rename : content/html/content/crashtests/838256-1.html => dom/html/crashtests/838256-1.html
rename : content/html/content/crashtests/862084.html => dom/html/crashtests/862084.html
rename : content/html/content/crashtests/865147.html => dom/html/crashtests/865147.html
rename : content/html/content/crashtests/877910.html => dom/html/crashtests/877910.html
rename : content/html/content/crashtests/903106.html => dom/html/crashtests/903106.html
rename : content/html/content/crashtests/916322-1.html => dom/html/crashtests/916322-1.html
rename : content/html/content/crashtests/916322-2.html => dom/html/crashtests/916322-2.html
rename : content/html/content/crashtests/crashtests.list => dom/html/crashtests/crashtests.list
rename : content/html/moz.build => dom/html/moz.build
rename : content/html/content/src/nsDOMStringMap.cpp => dom/html/nsDOMStringMap.cpp
rename : content/html/content/src/nsDOMStringMap.h => dom/html/nsDOMStringMap.h
rename : content/html/content/src/nsFormSubmission.cpp => dom/html/nsFormSubmission.cpp
rename : content/html/content/public/nsFormSubmission.h => dom/html/nsFormSubmission.h
rename : content/html/content/src/nsFormSubmissionConstants.h => dom/html/nsFormSubmissionConstants.h
rename : content/html/content/src/nsGenericHTMLElement.cpp => dom/html/nsGenericHTMLElement.cpp
rename : content/html/content/src/nsGenericHTMLElement.h => dom/html/nsGenericHTMLElement.h
rename : content/html/content/src/nsGenericHTMLFrameElement.cpp => dom/html/nsGenericHTMLFrameElement.cpp
rename : content/html/content/src/nsGenericHTMLFrameElement.h => dom/html/nsGenericHTMLFrameElement.h
rename : content/html/document/src/nsHTMLContentSink.cpp => dom/html/nsHTMLContentSink.cpp
rename : content/html/content/src/nsHTMLDNSPrefetch.cpp => dom/html/nsHTMLDNSPrefetch.cpp
rename : content/html/content/src/nsHTMLDNSPrefetch.h => dom/html/nsHTMLDNSPrefetch.h
rename : content/html/document/src/nsHTMLDocument.cpp => dom/html/nsHTMLDocument.cpp
rename : content/html/document/src/nsHTMLDocument.h => dom/html/nsHTMLDocument.h
rename : content/html/content/src/nsIConstraintValidation.cpp => dom/html/nsIConstraintValidation.cpp
rename : content/html/content/public/nsIConstraintValidation.h => dom/html/nsIConstraintValidation.h
rename : content/html/content/public/nsIForm.h => dom/html/nsIForm.h
rename : content/html/content/public/nsIFormControl.h => dom/html/nsIFormControl.h
rename : content/html/content/public/nsIFormProcessor.h => dom/html/nsIFormProcessor.h
rename : content/html/content/public/nsIFormSubmitObserver.idl => dom/html/nsIFormSubmitObserver.idl
rename : content/html/content/public/nsIHTMLCollection.h => dom/html/nsIHTMLCollection.h
rename : content/html/document/src/nsIHTMLDocument.h => dom/html/nsIHTMLDocument.h
rename : content/html/content/public/nsIHTMLMenu.idl => dom/html/nsIHTMLMenu.idl
rename : content/html/document/public/nsIImageDocument.idl => dom/html/nsIImageDocument.idl
rename : content/html/content/public/nsIMenuBuilder.idl => dom/html/nsIMenuBuilder.idl
rename : content/html/content/public/nsIPhonetic.idl => dom/html/nsIPhonetic.idl
rename : content/html/content/public/nsIRadioGroupContainer.h => dom/html/nsIRadioGroupContainer.h
rename : content/html/content/public/nsIRadioVisitor.h => dom/html/nsIRadioVisitor.h
rename : content/html/content/public/nsITextControlElement.h => dom/html/nsITextControlElement.h
rename : content/html/content/src/nsRadioVisitor.cpp => dom/html/nsRadioVisitor.cpp
rename : content/html/content/src/nsRadioVisitor.h => dom/html/nsRadioVisitor.h
rename : content/html/content/src/nsTextEditorState.cpp => dom/html/nsTextEditorState.cpp
rename : content/html/content/src/nsTextEditorState.h => dom/html/nsTextEditorState.h
rename : content/html/content/reftests/41464-1-ref.html => dom/html/reftests/41464-1-ref.html
rename : content/html/content/reftests/41464-1a.html => dom/html/reftests/41464-1a.html
rename : content/html/content/reftests/41464-1b.html => dom/html/reftests/41464-1b.html
rename : content/html/content/reftests/468263-1a.html => dom/html/reftests/468263-1a.html
rename : content/html/content/reftests/468263-1b.html => dom/html/reftests/468263-1b.html
rename : content/html/content/reftests/468263-1c.html => dom/html/reftests/468263-1c.html
rename : content/html/content/reftests/468263-1d.html => dom/html/reftests/468263-1d.html
rename : content/html/content/reftests/468263-2-alternate-ref.html => dom/html/reftests/468263-2-alternate-ref.html
rename : content/html/content/reftests/468263-2-ref.html => dom/html/reftests/468263-2-ref.html
rename : content/html/content/reftests/468263-2.html => dom/html/reftests/468263-2.html
rename : content/html/content/reftests/484200-1-ref.html => dom/html/reftests/484200-1-ref.html
rename : content/html/content/reftests/484200-1.html => dom/html/reftests/484200-1.html
rename : content/html/content/reftests/485377-ref.html => dom/html/reftests/485377-ref.html
rename : content/html/content/reftests/485377.html => dom/html/reftests/485377.html
rename : content/html/content/reftests/52019-1-ref.html => dom/html/reftests/52019-1-ref.html
rename : content/html/content/reftests/52019-1.html => dom/html/reftests/52019-1.html
rename : content/html/content/reftests/557840-ref.html => dom/html/reftests/557840-ref.html
rename : content/html/content/reftests/557840.html => dom/html/reftests/557840.html
rename : content/html/content/reftests/560059-video-dimensions-ref.html => dom/html/reftests/560059-video-dimensions-ref.html
rename : content/html/content/reftests/560059-video-dimensions.html => dom/html/reftests/560059-video-dimensions.html
rename : content/html/content/reftests/573322-no-quirks-ref.html => dom/html/reftests/573322-no-quirks-ref.html
rename : content/html/content/reftests/573322-no-quirks.html => dom/html/reftests/573322-no-quirks.html
rename : content/html/content/reftests/573322-quirks-ref.html => dom/html/reftests/573322-quirks-ref.html
rename : content/html/content/reftests/573322-quirks.html => dom/html/reftests/573322-quirks.html
rename : content/html/content/reftests/596455-1a.html => dom/html/reftests/596455-1a.html
rename : content/html/content/reftests/596455-1b.html => dom/html/reftests/596455-1b.html
rename : content/html/content/reftests/596455-2a.html => dom/html/reftests/596455-2a.html
rename : content/html/content/reftests/596455-2b.html => dom/html/reftests/596455-2b.html
rename : content/html/content/reftests/596455-ref-1.html => dom/html/reftests/596455-ref-1.html
rename : content/html/content/reftests/596455-ref-2.html => dom/html/reftests/596455-ref-2.html
rename : content/html/content/reftests/610935-ref.html => dom/html/reftests/610935-ref.html
rename : content/html/content/reftests/610935.html => dom/html/reftests/610935.html
rename : content/html/content/reftests/649134-1.html => dom/html/reftests/649134-1.html
rename : content/html/content/reftests/649134-2-ref.html => dom/html/reftests/649134-2-ref.html
rename : content/html/content/reftests/649134-2.html => dom/html/reftests/649134-2.html
rename : content/html/content/reftests/649134-ref.html => dom/html/reftests/649134-ref.html
rename : content/html/content/reftests/autofocus/autofocus-after-body-focus-ref.html => dom/html/reftests/autofocus/autofocus-after-body-focus-ref.html
rename : content/html/content/reftests/autofocus/autofocus-after-body-focus.html => dom/html/reftests/autofocus/autofocus-after-body-focus.html
rename : content/html/content/reftests/autofocus/autofocus-after-load-ref.html => dom/html/reftests/autofocus/autofocus-after-load-ref.html
rename : content/html/content/reftests/autofocus/autofocus-after-load.html => dom/html/reftests/autofocus/autofocus-after-load.html
rename : content/html/content/reftests/autofocus/autofocus-leaves-iframe-ref.html => dom/html/reftests/autofocus/autofocus-leaves-iframe-ref.html
rename : content/html/content/reftests/autofocus/autofocus-leaves-iframe.html => dom/html/reftests/autofocus/autofocus-leaves-iframe.html
rename : content/html/content/reftests/autofocus/button-create.html => dom/html/reftests/autofocus/button-create.html
rename : content/html/content/reftests/autofocus/button-load.html => dom/html/reftests/autofocus/button-load.html
rename : content/html/content/reftests/autofocus/button-ref.html => dom/html/reftests/autofocus/button-ref.html
rename : content/html/content/reftests/autofocus/input-create.html => dom/html/reftests/autofocus/input-create.html
rename : content/html/content/reftests/autofocus/input-load.html => dom/html/reftests/autofocus/input-load.html
rename : content/html/content/reftests/autofocus/input-number-ref.html => dom/html/reftests/autofocus/input-number-ref.html
rename : content/html/content/reftests/autofocus/input-number.html => dom/html/reftests/autofocus/input-number.html
rename : content/html/content/reftests/autofocus/input-ref.html => dom/html/reftests/autofocus/input-ref.html
rename : content/html/content/reftests/autofocus/reftest.list => dom/html/reftests/autofocus/reftest.list
rename : content/html/content/reftests/autofocus/select-create.html => dom/html/reftests/autofocus/select-create.html
rename : content/html/content/reftests/autofocus/select-load.html => dom/html/reftests/autofocus/select-load.html
rename : content/html/content/reftests/autofocus/select-ref.html => dom/html/reftests/autofocus/select-ref.html
rename : content/html/content/reftests/autofocus/style.css => dom/html/reftests/autofocus/style.css
rename : content/html/content/reftests/autofocus/textarea-create.html => dom/html/reftests/autofocus/textarea-create.html
rename : content/html/content/reftests/autofocus/textarea-load.html => dom/html/reftests/autofocus/textarea-load.html
rename : content/html/content/reftests/autofocus/textarea-ref.html => dom/html/reftests/autofocus/textarea-ref.html
rename : content/html/document/reftests/bug448564-1_ideal.html => dom/html/reftests/bug448564-1_ideal.html
rename : content/html/document/reftests/bug448564-1_malformed.html => dom/html/reftests/bug448564-1_malformed.html
rename : content/html/document/reftests/bug448564-1_well-formed.html => dom/html/reftests/bug448564-1_well-formed.html
rename : content/html/document/reftests/bug448564-4a.html => dom/html/reftests/bug448564-4a.html
rename : content/html/document/reftests/bug448564-4b.html => dom/html/reftests/bug448564-4b.html
rename : content/html/document/reftests/bug448564_forms.css => dom/html/reftests/bug448564_forms.css
rename : content/html/document/reftests/bug502168-1_malformed.html => dom/html/reftests/bug502168-1_malformed.html
rename : content/html/document/reftests/bug502168-1_well-formed.html => dom/html/reftests/bug502168-1_well-formed.html
rename : content/html/document/reftests/bug917595-1-ref.html => dom/html/reftests/bug917595-1-ref.html
rename : content/html/document/reftests/bug917595-exif-rotated.jpg => dom/html/reftests/bug917595-exif-rotated.jpg
rename : content/html/document/reftests/bug917595-iframe-1.html => dom/html/reftests/bug917595-iframe-1.html
rename : content/html/document/reftests/bug917595-pixel-rotated.jpg => dom/html/reftests/bug917595-pixel-rotated.jpg
rename : content/html/document/reftests/bug917595-unrotated.jpg => dom/html/reftests/bug917595-unrotated.jpg
rename : content/html/content/reftests/figure-ref.html => dom/html/reftests/figure-ref.html
rename : content/html/content/reftests/figure.html => dom/html/reftests/figure.html
rename : content/html/content/reftests/href-attr-change-restyles-ref.html => dom/html/reftests/href-attr-change-restyles-ref.html
rename : content/html/content/reftests/href-attr-change-restyles.html => dom/html/reftests/href-attr-change-restyles.html
rename : content/html/content/reftests/pass.png => dom/html/reftests/pass.png
rename : content/html/content/reftests/pre-1-ref.html => dom/html/reftests/pre-1-ref.html
rename : content/html/content/reftests/pre-1.html => dom/html/reftests/pre-1.html
rename : content/html/content/reftests/reftest.list => dom/html/reftests/reftest.list
rename : content/html/content/reftests/table-border-1-ref.html => dom/html/reftests/table-border-1-ref.html
rename : content/html/content/reftests/table-border-1.html => dom/html/reftests/table-border-1.html
rename : content/html/content/reftests/table-border-2-notref.html => dom/html/reftests/table-border-2-notref.html
rename : content/html/content/reftests/table-border-2-ref.html => dom/html/reftests/table-border-2-ref.html
rename : content/html/content/reftests/table-border-2.html => dom/html/reftests/table-border-2.html
rename : content/html/content/reftests/toblob-todataurl/blob.js => dom/html/reftests/toblob-todataurl/blob.js
rename : content/html/content/reftests/toblob-todataurl/dataurl.js => dom/html/reftests/toblob-todataurl/dataurl.js
rename : content/html/content/reftests/toblob-todataurl/images/original.png => dom/html/reftests/toblob-todataurl/images/original.png
rename : content/html/content/reftests/toblob-todataurl/images/q0.jpg => dom/html/reftests/toblob-todataurl/images/q0.jpg
rename : content/html/content/reftests/toblob-todataurl/images/q100.jpg => dom/html/reftests/toblob-todataurl/images/q100.jpg
rename : content/html/content/reftests/toblob-todataurl/images/q25.jpg => dom/html/reftests/toblob-todataurl/images/q25.jpg
rename : content/html/content/reftests/toblob-todataurl/images/q50.jpg => dom/html/reftests/toblob-todataurl/images/q50.jpg
rename : content/html/content/reftests/toblob-todataurl/images/q75.jpg => dom/html/reftests/toblob-todataurl/images/q75.jpg
rename : content/html/content/reftests/toblob-todataurl/images/q92.jpg => dom/html/reftests/toblob-todataurl/images/q92.jpg
rename : content/html/content/reftests/toblob-todataurl/quality-0-ref.html => dom/html/reftests/toblob-todataurl/quality-0-ref.html
rename : content/html/content/reftests/toblob-todataurl/quality-100-ref.html => dom/html/reftests/toblob-todataurl/quality-100-ref.html
rename : content/html/content/reftests/toblob-todataurl/quality-25-ref.html => dom/html/reftests/toblob-todataurl/quality-25-ref.html
rename : content/html/content/reftests/toblob-todataurl/quality-50-ref.html => dom/html/reftests/toblob-todataurl/quality-50-ref.html
rename : content/html/content/reftests/toblob-todataurl/quality-75-ref.html => dom/html/reftests/toblob-todataurl/quality-75-ref.html
rename : content/html/content/reftests/toblob-todataurl/quality-92-ref.html => dom/html/reftests/toblob-todataurl/quality-92-ref.html
rename : content/html/content/reftests/toblob-todataurl/reftest.list => dom/html/reftests/toblob-todataurl/reftest.list
rename : content/html/content/reftests/toblob-todataurl/sample.js => dom/html/reftests/toblob-todataurl/sample.js
rename : content/html/content/reftests/toblob-todataurl/toblob-quality-0.html => dom/html/reftests/toblob-todataurl/toblob-quality-0.html
rename : content/html/content/reftests/toblob-todataurl/toblob-quality-100.html => dom/html/reftests/toblob-todataurl/toblob-quality-100.html
rename : content/html/content/reftests/toblob-todataurl/toblob-quality-25.html => dom/html/reftests/toblob-todataurl/toblob-quality-25.html
rename : content/html/content/reftests/toblob-todataurl/toblob-quality-50.html => dom/html/reftests/toblob-todataurl/toblob-quality-50.html
rename : content/html/content/reftests/toblob-todataurl/toblob-quality-75.html => dom/html/reftests/toblob-todataurl/toblob-quality-75.html
rename : content/html/content/reftests/toblob-todataurl/toblob-quality-92.html => dom/html/reftests/toblob-todataurl/toblob-quality-92.html
rename : content/html/content/reftests/toblob-todataurl/toblob-quality-default.html => dom/html/reftests/toblob-todataurl/toblob-quality-default.html
rename : content/html/content/reftests/toblob-todataurl/toblob-quality-undefined.html => dom/html/reftests/toblob-todataurl/toblob-quality-undefined.html
rename : content/html/content/reftests/toblob-todataurl/todataurl-quality-0.html => dom/html/reftests/toblob-todataurl/todataurl-quality-0.html
rename : content/html/content/reftests/toblob-todataurl/todataurl-quality-100.html => dom/html/reftests/toblob-todataurl/todataurl-quality-100.html
rename : content/html/content/reftests/toblob-todataurl/todataurl-quality-25.html => dom/html/reftests/toblob-todataurl/todataurl-quality-25.html
rename : content/html/content/reftests/toblob-todataurl/todataurl-quality-50.html => dom/html/reftests/toblob-todataurl/todataurl-quality-50.html
rename : content/html/content/reftests/toblob-todataurl/todataurl-quality-75.html => dom/html/reftests/toblob-todataurl/todataurl-quality-75.html
rename : content/html/content/reftests/toblob-todataurl/todataurl-quality-92.html => dom/html/reftests/toblob-todataurl/todataurl-quality-92.html
rename : content/html/content/reftests/toblob-todataurl/todataurl-quality-default.html => dom/html/reftests/toblob-todataurl/todataurl-quality-default.html
rename : content/html/content/reftests/toblob-todataurl/todataurl-quality-undefined.html => dom/html/reftests/toblob-todataurl/todataurl-quality-undefined.html
rename : content/html/content/test/347174transform.xsl => dom/html/test/347174transform.xsl
rename : content/html/content/test/347174transformable.xml => dom/html/test/347174transformable.xml
rename : content/html/content/test/allowMedia.sjs => dom/html/test/allowMedia.sjs
rename : content/html/content/test/browser.ini => dom/html/test/browser.ini
rename : content/html/document/test/browser_bug1081537.js => dom/html/test/browser_bug1081537.js
rename : content/html/document/test/browser_bug592641.js => dom/html/test/browser_bug592641.js
rename : content/html/content/test/browser_bug649778.js => dom/html/test/browser_bug649778.js
rename : content/html/content/test/bug100533_iframe.html => dom/html/test/bug100533_iframe.html
rename : content/html/content/test/bug100533_load.html => dom/html/test/bug100533_load.html
rename : content/html/document/test/bug196523-subframe.html => dom/html/test/bug196523-subframe.html
rename : content/html/document/test/bug199692-nested-d2.html => dom/html/test/bug199692-nested-d2.html
rename : content/html/document/test/bug199692-nested.html => dom/html/test/bug199692-nested.html
rename : content/html/document/test/bug199692-popup.html => dom/html/test/bug199692-popup.html
rename : content/html/document/test/bug199692-scrolled.html => dom/html/test/bug199692-scrolled.html
rename : content/html/content/test/bug242709_iframe.html => dom/html/test/bug242709_iframe.html
rename : content/html/content/test/bug242709_load.html => dom/html/test/bug242709_load.html
rename : content/html/content/test/bug277724_iframe1.html => dom/html/test/bug277724_iframe1.html
rename : content/html/content/test/bug277724_iframe2.xhtml => dom/html/test/bug277724_iframe2.xhtml
rename : content/html/content/test/bug277890_iframe.html => dom/html/test/bug277890_iframe.html
rename : content/html/content/test/bug277890_load.html => dom/html/test/bug277890_load.html
rename : content/html/content/test/bug340800_iframe.txt => dom/html/test/bug340800_iframe.txt
rename : content/html/document/test/bug369370-popup.png => dom/html/test/bug369370-popup.png
rename : content/html/content/test/bug372098-link-target.html => dom/html/test/bug372098-link-target.html
rename : content/html/content/test/bug392567.jar => dom/html/test/bug392567.jar
rename : content/html/content/test/bug392567.jar^headers^ => dom/html/test/bug392567.jar^headers^
rename : content/html/content/test/bug441930_iframe.html => dom/html/test/bug441930_iframe.html
rename : content/html/document/test/bug445004-inner.html => dom/html/test/bug445004-inner.html
rename : content/html/document/test/bug445004-inner.js => dom/html/test/bug445004-inner.js
rename : content/html/document/test/bug445004-outer-abs.html => dom/html/test/bug445004-outer-abs.html
rename : content/html/document/test/bug445004-outer-rel.html => dom/html/test/bug445004-outer-rel.html
rename : content/html/document/test/bug445004-outer-write.html => dom/html/test/bug445004-outer-write.html
rename : content/html/document/test/bug446483-iframe.html => dom/html/test/bug446483-iframe.html
rename : content/html/document/test/bug448564-echo.sjs => dom/html/test/bug448564-echo.sjs
rename : content/html/document/test/bug448564-iframe-1.html => dom/html/test/bug448564-iframe-1.html
rename : content/html/document/test/bug448564-iframe-2.html => dom/html/test/bug448564-iframe-2.html
rename : content/html/document/test/bug448564-iframe-3.html => dom/html/test/bug448564-iframe-3.html
rename : content/html/document/test/bug448564-submit.js => dom/html/test/bug448564-submit.js
rename : content/html/document/test/bug499092.html => dom/html/test/bug499092.html
rename : content/html/document/test/bug499092.xml => dom/html/test/bug499092.xml
rename : content/html/content/test/bug514856_iframe.html => dom/html/test/bug514856_iframe.html
rename : content/html/document/test/bug592641_img.jpg => dom/html/test/bug592641_img.jpg
rename : content/html/content/test/bug649134/file_bug649134-1.sjs => dom/html/test/bug649134/file_bug649134-1.sjs
rename : content/html/content/test/bug649134/file_bug649134-2.sjs => dom/html/test/bug649134/file_bug649134-2.sjs
rename : content/html/content/test/bug649134/index.html => dom/html/test/bug649134/index.html
rename : content/html/content/test/chrome.ini => dom/html/test/chrome.ini
rename : content/html/content/test/enableTestPlugin.js => dom/html/test/enableTestPlugin.js
rename : content/html/content/test/file_anchor_ping.html => dom/html/test/file_anchor_ping.html
rename : content/html/content/test/file_bug209275_1.html => dom/html/test/file_bug209275_1.html
rename : content/html/content/test/file_bug209275_2.html => dom/html/test/file_bug209275_2.html
rename : content/html/content/test/file_bug209275_3.html => dom/html/test/file_bug209275_3.html
rename : content/html/content/test/file_bug297761.html => dom/html/test/file_bug297761.html
rename : content/html/content/test/file_bug417760.png => dom/html/test/file_bug417760.png
rename : content/html/content/test/file_bug649778.html => dom/html/test/file_bug649778.html
rename : content/html/content/test/file_bug649778.html^headers^ => dom/html/test/file_bug649778.html^headers^
rename : content/html/document/test/file_bug871161-1.html => dom/html/test/file_bug871161-1.html
rename : content/html/document/test/file_bug871161-2.html => dom/html/test/file_bug871161-2.html
rename : content/html/content/test/file_bug893537.html => dom/html/test/file_bug893537.html
rename : content/html/content/test/file_formSubmission_img.jpg => dom/html/test/file_formSubmission_img.jpg
rename : content/html/content/test/file_formSubmission_text.txt => dom/html/test/file_formSubmission_text.txt
rename : content/html/content/test/file_fullscreen-ancestor-stacking-context.html => dom/html/test/file_fullscreen-ancestor-stacking-context.html
rename : content/html/content/test/file_fullscreen-api-keys.html => dom/html/test/file_fullscreen-api-keys.html
rename : content/html/content/test/file_fullscreen-api.html => dom/html/test/file_fullscreen-api.html
rename : content/html/content/test/file_fullscreen-denied-inner.html => dom/html/test/file_fullscreen-denied-inner.html
rename : content/html/content/test/file_fullscreen-denied.html => dom/html/test/file_fullscreen-denied.html
rename : content/html/content/test/file_fullscreen-esc-exit-inner.html => dom/html/test/file_fullscreen-esc-exit-inner.html
rename : content/html/content/test/file_fullscreen-esc-exit.html => dom/html/test/file_fullscreen-esc-exit.html
rename : content/html/content/test/file_fullscreen-hidden.html => dom/html/test/file_fullscreen-hidden.html
rename : content/html/content/test/file_fullscreen-multiple-inner.html => dom/html/test/file_fullscreen-multiple-inner.html
rename : content/html/content/test/file_fullscreen-multiple.html => dom/html/test/file_fullscreen-multiple.html
rename : content/html/content/test/file_fullscreen-navigation.html => dom/html/test/file_fullscreen-navigation.html
rename : content/html/content/test/file_fullscreen-plugins.html => dom/html/test/file_fullscreen-plugins.html
rename : content/html/content/test/file_fullscreen-rollback.html => dom/html/test/file_fullscreen-rollback.html
rename : content/html/content/test/file_fullscreen-svg-element.html => dom/html/test/file_fullscreen-svg-element.html
rename : content/html/content/test/file_fullscreen-utils.js => dom/html/test/file_fullscreen-utils.js
rename : content/html/content/test/file_iframe_sandbox_a_if1.html => dom/html/test/file_iframe_sandbox_a_if1.html
rename : content/html/content/test/file_iframe_sandbox_a_if10.html => dom/html/test/file_iframe_sandbox_a_if10.html
rename : content/html/content/test/file_iframe_sandbox_a_if11.html => dom/html/test/file_iframe_sandbox_a_if11.html
rename : content/html/content/test/file_iframe_sandbox_a_if12.html => dom/html/test/file_iframe_sandbox_a_if12.html
rename : content/html/content/test/file_iframe_sandbox_a_if13.html => dom/html/test/file_iframe_sandbox_a_if13.html
rename : content/html/content/test/file_iframe_sandbox_a_if14.html => dom/html/test/file_iframe_sandbox_a_if14.html
rename : content/html/content/test/file_iframe_sandbox_a_if15.html => dom/html/test/file_iframe_sandbox_a_if15.html
rename : content/html/content/test/file_iframe_sandbox_a_if16.html => dom/html/test/file_iframe_sandbox_a_if16.html
rename : content/html/content/test/file_iframe_sandbox_a_if17.html => dom/html/test/file_iframe_sandbox_a_if17.html
rename : content/html/content/test/file_iframe_sandbox_a_if18.html => dom/html/test/file_iframe_sandbox_a_if18.html
rename : content/html/content/test/file_iframe_sandbox_a_if19.html => dom/html/test/file_iframe_sandbox_a_if19.html
rename : content/html/content/test/file_iframe_sandbox_a_if2.html => dom/html/test/file_iframe_sandbox_a_if2.html
rename : content/html/content/test/file_iframe_sandbox_a_if3.html => dom/html/test/file_iframe_sandbox_a_if3.html
rename : content/html/content/test/file_iframe_sandbox_a_if4.html => dom/html/test/file_iframe_sandbox_a_if4.html
rename : content/html/content/test/file_iframe_sandbox_a_if5.html => dom/html/test/file_iframe_sandbox_a_if5.html
rename : content/html/content/test/file_iframe_sandbox_a_if6.html => dom/html/test/file_iframe_sandbox_a_if6.html
rename : content/html/content/test/file_iframe_sandbox_a_if7.html => dom/html/test/file_iframe_sandbox_a_if7.html
rename : content/html/content/test/file_iframe_sandbox_a_if8.html => dom/html/test/file_iframe_sandbox_a_if8.html
rename : content/html/content/test/file_iframe_sandbox_a_if9.html => dom/html/test/file_iframe_sandbox_a_if9.html
rename : content/html/content/test/file_iframe_sandbox_b_if1.html => dom/html/test/file_iframe_sandbox_b_if1.html
rename : content/html/content/test/file_iframe_sandbox_b_if2.html => dom/html/test/file_iframe_sandbox_b_if2.html
rename : content/html/content/test/file_iframe_sandbox_b_if3.html => dom/html/test/file_iframe_sandbox_b_if3.html
rename : content/html/content/test/file_iframe_sandbox_c_if1.html => dom/html/test/file_iframe_sandbox_c_if1.html
rename : content/html/content/test/file_iframe_sandbox_c_if2.html => dom/html/test/file_iframe_sandbox_c_if2.html
rename : content/html/content/test/file_iframe_sandbox_c_if3.html => dom/html/test/file_iframe_sandbox_c_if3.html
rename : content/html/content/test/file_iframe_sandbox_c_if4.html => dom/html/test/file_iframe_sandbox_c_if4.html
rename : content/html/content/test/file_iframe_sandbox_c_if5.html => dom/html/test/file_iframe_sandbox_c_if5.html
rename : content/html/content/test/file_iframe_sandbox_c_if6.html => dom/html/test/file_iframe_sandbox_c_if6.html
rename : content/html/content/test/file_iframe_sandbox_c_if7.html => dom/html/test/file_iframe_sandbox_c_if7.html
rename : content/html/content/test/file_iframe_sandbox_c_if8.html => dom/html/test/file_iframe_sandbox_c_if8.html
rename : content/html/content/test/file_iframe_sandbox_close.html => dom/html/test/file_iframe_sandbox_close.html
rename : content/html/content/test/file_iframe_sandbox_d_if1.html => dom/html/test/file_iframe_sandbox_d_if1.html
rename : content/html/content/test/file_iframe_sandbox_d_if10.html => dom/html/test/file_iframe_sandbox_d_if10.html
rename : content/html/content/test/file_iframe_sandbox_d_if11.html => dom/html/test/file_iframe_sandbox_d_if11.html
rename : content/html/content/test/file_iframe_sandbox_d_if12.html => dom/html/test/file_iframe_sandbox_d_if12.html
rename : content/html/content/test/file_iframe_sandbox_d_if13.html => dom/html/test/file_iframe_sandbox_d_if13.html
rename : content/html/content/test/file_iframe_sandbox_d_if14.html => dom/html/test/file_iframe_sandbox_d_if14.html
rename : content/html/content/test/file_iframe_sandbox_d_if15.html => dom/html/test/file_iframe_sandbox_d_if15.html
rename : content/html/content/test/file_iframe_sandbox_d_if16.html => dom/html/test/file_iframe_sandbox_d_if16.html
rename : content/html/content/test/file_iframe_sandbox_d_if17.html => dom/html/test/file_iframe_sandbox_d_if17.html
rename : content/html/content/test/file_iframe_sandbox_d_if18.html => dom/html/test/file_iframe_sandbox_d_if18.html
rename : content/html/content/test/file_iframe_sandbox_d_if19.html => dom/html/test/file_iframe_sandbox_d_if19.html
rename : content/html/content/test/file_iframe_sandbox_d_if2.html => dom/html/test/file_iframe_sandbox_d_if2.html
rename : content/html/content/test/file_iframe_sandbox_d_if20.html => dom/html/test/file_iframe_sandbox_d_if20.html
rename : content/html/content/test/file_iframe_sandbox_d_if21.html => dom/html/test/file_iframe_sandbox_d_if21.html
rename : content/html/content/test/file_iframe_sandbox_d_if22.html => dom/html/test/file_iframe_sandbox_d_if22.html
rename : content/html/content/test/file_iframe_sandbox_d_if23.html => dom/html/test/file_iframe_sandbox_d_if23.html
rename : content/html/content/test/file_iframe_sandbox_d_if3.html => dom/html/test/file_iframe_sandbox_d_if3.html
rename : content/html/content/test/file_iframe_sandbox_d_if4.html => dom/html/test/file_iframe_sandbox_d_if4.html
rename : content/html/content/test/file_iframe_sandbox_d_if5.html => dom/html/test/file_iframe_sandbox_d_if5.html
rename : content/html/content/test/file_iframe_sandbox_d_if6.html => dom/html/test/file_iframe_sandbox_d_if6.html
rename : content/html/content/test/file_iframe_sandbox_d_if7.html => dom/html/test/file_iframe_sandbox_d_if7.html
rename : content/html/content/test/file_iframe_sandbox_d_if8.html => dom/html/test/file_iframe_sandbox_d_if8.html
rename : content/html/content/test/file_iframe_sandbox_d_if9.html => dom/html/test/file_iframe_sandbox_d_if9.html
rename : content/html/content/test/file_iframe_sandbox_e_if1.html => dom/html/test/file_iframe_sandbox_e_if1.html
rename : content/html/content/test/file_iframe_sandbox_e_if10.html => dom/html/test/file_iframe_sandbox_e_if10.html
rename : content/html/content/test/file_iframe_sandbox_e_if11.html => dom/html/test/file_iframe_sandbox_e_if11.html
rename : content/html/content/test/file_iframe_sandbox_e_if12.html => dom/html/test/file_iframe_sandbox_e_if12.html
rename : content/html/content/test/file_iframe_sandbox_e_if13.html => dom/html/test/file_iframe_sandbox_e_if13.html
rename : content/html/content/test/file_iframe_sandbox_e_if14.html => dom/html/test/file_iframe_sandbox_e_if14.html
rename : content/html/content/test/file_iframe_sandbox_e_if15.html => dom/html/test/file_iframe_sandbox_e_if15.html
rename : content/html/content/test/file_iframe_sandbox_e_if16.html => dom/html/test/file_iframe_sandbox_e_if16.html
rename : content/html/content/test/file_iframe_sandbox_e_if2.html => dom/html/test/file_iframe_sandbox_e_if2.html
rename : content/html/content/test/file_iframe_sandbox_e_if3.html => dom/html/test/file_iframe_sandbox_e_if3.html
rename : content/html/content/test/file_iframe_sandbox_e_if4.html => dom/html/test/file_iframe_sandbox_e_if4.html
rename : content/html/content/test/file_iframe_sandbox_e_if5.html => dom/html/test/file_iframe_sandbox_e_if5.html
rename : content/html/content/test/file_iframe_sandbox_e_if6.html => dom/html/test/file_iframe_sandbox_e_if6.html
rename : content/html/content/test/file_iframe_sandbox_e_if7.html => dom/html/test/file_iframe_sandbox_e_if7.html
rename : content/html/content/test/file_iframe_sandbox_e_if8.html => dom/html/test/file_iframe_sandbox_e_if8.html
rename : content/html/content/test/file_iframe_sandbox_e_if9.html => dom/html/test/file_iframe_sandbox_e_if9.html
rename : content/html/content/test/file_iframe_sandbox_f_if1.html => dom/html/test/file_iframe_sandbox_f_if1.html
rename : content/html/content/test/file_iframe_sandbox_f_if2.html => dom/html/test/file_iframe_sandbox_f_if2.html
rename : content/html/content/test/file_iframe_sandbox_f_if2.html^headers^ => dom/html/test/file_iframe_sandbox_f_if2.html^headers^
rename : content/html/content/test/file_iframe_sandbox_fail.js => dom/html/test/file_iframe_sandbox_fail.js
rename : content/html/content/test/file_iframe_sandbox_form_fail.html => dom/html/test/file_iframe_sandbox_form_fail.html
rename : content/html/content/test/file_iframe_sandbox_form_pass.html => dom/html/test/file_iframe_sandbox_form_pass.html
rename : content/html/content/test/file_iframe_sandbox_g_if1.html => dom/html/test/file_iframe_sandbox_g_if1.html
rename : content/html/content/test/file_iframe_sandbox_h_if1.html => dom/html/test/file_iframe_sandbox_h_if1.html
rename : content/html/content/test/file_iframe_sandbox_j_if1.html => dom/html/test/file_iframe_sandbox_j_if1.html
rename : content/html/content/test/file_iframe_sandbox_j_if2.html => dom/html/test/file_iframe_sandbox_j_if2.html
rename : content/html/content/test/file_iframe_sandbox_j_if3.html => dom/html/test/file_iframe_sandbox_j_if3.html
rename : content/html/content/test/file_iframe_sandbox_k_if1.html => dom/html/test/file_iframe_sandbox_k_if1.html
rename : content/html/content/test/file_iframe_sandbox_k_if2.html => dom/html/test/file_iframe_sandbox_k_if2.html
rename : content/html/content/test/file_iframe_sandbox_k_if3.html => dom/html/test/file_iframe_sandbox_k_if3.html
rename : content/html/content/test/file_iframe_sandbox_k_if4.html => dom/html/test/file_iframe_sandbox_k_if4.html
rename : content/html/content/test/file_iframe_sandbox_k_if5.html => dom/html/test/file_iframe_sandbox_k_if5.html
rename : content/html/content/test/file_iframe_sandbox_k_if6.html => dom/html/test/file_iframe_sandbox_k_if6.html
rename : content/html/content/test/file_iframe_sandbox_k_if7.html => dom/html/test/file_iframe_sandbox_k_if7.html
rename : content/html/content/test/file_iframe_sandbox_k_if8.html => dom/html/test/file_iframe_sandbox_k_if8.html
rename : content/html/content/test/file_iframe_sandbox_k_if9.html => dom/html/test/file_iframe_sandbox_k_if9.html
rename : content/html/content/test/file_iframe_sandbox_navigation_fail.html => dom/html/test/file_iframe_sandbox_navigation_fail.html
rename : content/html/content/test/file_iframe_sandbox_navigation_pass.html => dom/html/test/file_iframe_sandbox_navigation_pass.html
rename : content/html/content/test/file_iframe_sandbox_navigation_start.html => dom/html/test/file_iframe_sandbox_navigation_start.html
rename : content/html/content/test/file_iframe_sandbox_open_window_fail.html => dom/html/test/file_iframe_sandbox_open_window_fail.html
rename : content/html/content/test/file_iframe_sandbox_open_window_pass.html => dom/html/test/file_iframe_sandbox_open_window_pass.html
rename : content/html/content/test/file_iframe_sandbox_pass.js => dom/html/test/file_iframe_sandbox_pass.js
rename : content/html/content/test/file_iframe_sandbox_redirect.html => dom/html/test/file_iframe_sandbox_redirect.html
rename : content/html/content/test/file_iframe_sandbox_redirect.html^headers^ => dom/html/test/file_iframe_sandbox_redirect.html^headers^
rename : content/html/content/test/file_iframe_sandbox_redirect_target.html => dom/html/test/file_iframe_sandbox_redirect_target.html
rename : content/html/content/test/file_iframe_sandbox_top_navigation_fail.html => dom/html/test/file_iframe_sandbox_top_navigation_fail.html
rename : content/html/content/test/file_iframe_sandbox_top_navigation_pass.html => dom/html/test/file_iframe_sandbox_top_navigation_pass.html
rename : content/html/content/test/file_iframe_sandbox_window_form_fail.html => dom/html/test/file_iframe_sandbox_window_form_fail.html
rename : content/html/content/test/file_iframe_sandbox_window_form_pass.html => dom/html/test/file_iframe_sandbox_window_form_pass.html
rename : content/html/content/test/file_iframe_sandbox_window_navigation_fail.html => dom/html/test/file_iframe_sandbox_window_navigation_fail.html
rename : content/html/content/test/file_iframe_sandbox_window_navigation_pass.html => dom/html/test/file_iframe_sandbox_window_navigation_pass.html
rename : content/html/content/test/file_iframe_sandbox_window_top_navigation_fail.html => dom/html/test/file_iframe_sandbox_window_top_navigation_fail.html
rename : content/html/content/test/file_iframe_sandbox_window_top_navigation_pass.html => dom/html/test/file_iframe_sandbox_window_top_navigation_pass.html
rename : content/html/content/test/file_iframe_sandbox_worker.js => dom/html/test/file_iframe_sandbox_worker.js
rename : content/html/content/test/file_ignoreuserfocus.html => dom/html/test/file_ignoreuserfocus.html
rename : content/html/content/test/file_imports_basics.html => dom/html/test/file_imports_basics.html
rename : content/html/content/test/file_imports_redirect.html => dom/html/test/file_imports_redirect.html
rename : content/html/content/test/file_imports_redirect.html^headers^ => dom/html/test/file_imports_redirect.html^headers^
rename : content/html/content/test/file_imports_redirected.html => dom/html/test/file_imports_redirected.html
rename : content/html/content/test/file_srcdoc-2.html => dom/html/test/file_srcdoc-2.html
rename : content/html/content/test/file_srcdoc.html => dom/html/test/file_srcdoc.html
rename : content/html/content/test/form_submit_server.sjs => dom/html/test/form_submit_server.sjs
rename : content/html/content/test/forms/chrome.ini => dom/html/test/forms/chrome.ini
rename : content/html/content/test/forms/mochitest.ini => dom/html/test/forms/mochitest.ini
rename : content/html/content/test/forms/save_restore_radio_groups.sjs => dom/html/test/forms/save_restore_radio_groups.sjs
rename : content/html/content/test/forms/submit_invalid_file.sjs => dom/html/test/forms/submit_invalid_file.sjs
rename : content/html/content/test/forms/test_autocompleteinfo.html => dom/html/test/forms/test_autocompleteinfo.html
rename : content/html/content/test/forms/test_bug1039548.html => dom/html/test/forms/test_bug1039548.html
rename : content/html/content/test/forms/test_button_attributes_reflection.html => dom/html/test/forms/test_button_attributes_reflection.html
rename : content/html/content/test/forms/test_change_event.html => dom/html/test/forms/test_change_event.html
rename : content/html/content/test/forms/test_datalist_element.html => dom/html/test/forms/test_datalist_element.html
rename : content/html/content/test/forms/test_experimental_forms_pref.html => dom/html/test/forms/test_experimental_forms_pref.html
rename : content/html/content/test/forms/test_form_attribute-1.html => dom/html/test/forms/test_form_attribute-1.html
rename : content/html/content/test/forms/test_form_attribute-2.html => dom/html/test/forms/test_form_attribute-2.html
rename : content/html/content/test/forms/test_form_attribute-3.html => dom/html/test/forms/test_form_attribute-3.html
rename : content/html/content/test/forms/test_form_attribute-4.html => dom/html/test/forms/test_form_attribute-4.html
rename : content/html/content/test/forms/test_form_attributes_reflection.html => dom/html/test/forms/test_form_attributes_reflection.html
rename : content/html/content/test/forms/test_form_named_getter_dynamic.html => dom/html/test/forms/test_form_named_getter_dynamic.html
rename : content/html/content/test/forms/test_formaction_attribute.html => dom/html/test/forms/test_formaction_attribute.html
rename : content/html/content/test/forms/test_formnovalidate_attribute.html => dom/html/test/forms/test_formnovalidate_attribute.html
rename : content/html/content/test/forms/test_input_attributes_reflection.html => dom/html/test/forms/test_input_attributes_reflection.html
rename : content/html/content/test/forms/test_input_autocomplete.html => dom/html/test/forms/test_input_autocomplete.html
rename : content/html/content/test/forms/test_input_color_input_change_events.html => dom/html/test/forms/test_input_color_input_change_events.html
rename : content/html/content/test/forms/test_input_color_picker_initial.html => dom/html/test/forms/test_input_color_picker_initial.html
rename : content/html/content/test/forms/test_input_color_picker_popup.html => dom/html/test/forms/test_input_color_picker_popup.html
rename : content/html/content/test/forms/test_input_color_picker_update.html => dom/html/test/forms/test_input_color_picker_update.html
rename : content/html/content/test/forms/test_input_defaultValue.html => dom/html/test/forms/test_input_defaultValue.html
rename : content/html/content/test/forms/test_input_email.html => dom/html/test/forms/test_input_email.html
rename : content/html/content/test/forms/test_input_event.html => dom/html/test/forms/test_input_event.html
rename : content/html/content/test/forms/test_input_file_picker.html => dom/html/test/forms/test_input_file_picker.html
rename : content/html/content/test/forms/test_input_list_attribute.html => dom/html/test/forms/test_input_list_attribute.html
rename : content/html/content/test/forms/test_input_number_data.js => dom/html/test/forms/test_input_number_data.js
rename : content/html/content/test/forms/test_input_number_key_events.html => dom/html/test/forms/test_input_number_key_events.html
rename : content/html/content/test/forms/test_input_number_l10n.html => dom/html/test/forms/test_input_number_l10n.html
rename : content/html/content/test/forms/test_input_number_mouse_events.html => dom/html/test/forms/test_input_number_mouse_events.html
rename : content/html/content/test/forms/test_input_number_rounding.html => dom/html/test/forms/test_input_number_rounding.html
rename : content/html/content/test/forms/test_input_number_validation.html => dom/html/test/forms/test_input_number_validation.html
rename : content/html/content/test/forms/test_input_radio_radiogroup.html => dom/html/test/forms/test_input_radio_radiogroup.html
rename : content/html/content/test/forms/test_input_range_attr_order.html => dom/html/test/forms/test_input_range_attr_order.html
rename : content/html/content/test/forms/test_input_range_key_events.html => dom/html/test/forms/test_input_range_key_events.html
rename : content/html/content/test/forms/test_input_range_mouse_and_touch_events.html => dom/html/test/forms/test_input_range_mouse_and_touch_events.html
rename : content/html/content/test/forms/test_input_range_rounding.html => dom/html/test/forms/test_input_range_rounding.html
rename : content/html/content/test/forms/test_input_sanitization.html => dom/html/test/forms/test_input_sanitization.html
rename : content/html/content/test/forms/test_input_textarea_set_value_no_scroll.html => dom/html/test/forms/test_input_textarea_set_value_no_scroll.html
rename : content/html/content/test/forms/test_input_typing_sanitization.html => dom/html/test/forms/test_input_typing_sanitization.html
rename : content/html/content/test/forms/test_input_untrusted_key_events.html => dom/html/test/forms/test_input_untrusted_key_events.html
rename : content/html/content/test/forms/test_input_url.html => dom/html/test/forms/test_input_url.html
rename : content/html/content/test/forms/test_label_control_attribute.html => dom/html/test/forms/test_label_control_attribute.html
rename : content/html/content/test/forms/test_label_input_controls.html => dom/html/test/forms/test_label_input_controls.html
rename : content/html/content/test/forms/test_max_attribute.html => dom/html/test/forms/test_max_attribute.html
rename : content/html/content/test/forms/test_maxlength_attribute.html => dom/html/test/forms/test_maxlength_attribute.html
rename : content/html/content/test/forms/test_meter_element.html => dom/html/test/forms/test_meter_element.html
rename : content/html/content/test/forms/test_meter_pseudo-classes.html => dom/html/test/forms/test_meter_pseudo-classes.html
rename : content/html/content/test/forms/test_min_attribute.html => dom/html/test/forms/test_min_attribute.html
rename : content/html/content/test/forms/test_mozistextfield.html => dom/html/test/forms/test_mozistextfield.html
rename : content/html/content/test/forms/test_novalidate_attribute.html => dom/html/test/forms/test_novalidate_attribute.html
rename : content/html/content/test/forms/test_option_disabled.html => dom/html/test/forms/test_option_disabled.html
rename : content/html/content/test/forms/test_option_index_attribute.html => dom/html/test/forms/test_option_index_attribute.html
rename : content/html/content/test/forms/test_option_text.html => dom/html/test/forms/test_option_text.html
rename : content/html/content/test/forms/test_output_element.html => dom/html/test/forms/test_output_element.html
rename : content/html/content/test/forms/test_pattern_attribute.html => dom/html/test/forms/test_pattern_attribute.html
rename : content/html/content/test/forms/test_progress_element.html => dom/html/test/forms/test_progress_element.html
rename : content/html/content/test/forms/test_radio_radionodelist.html => dom/html/test/forms/test_radio_radionodelist.html
rename : content/html/content/test/forms/test_required_attribute.html => dom/html/test/forms/test_required_attribute.html
rename : content/html/content/test/forms/test_restore_form_elements.html => dom/html/test/forms/test_restore_form_elements.html
rename : content/html/content/test/forms/test_save_restore_radio_groups.html => dom/html/test/forms/test_save_restore_radio_groups.html
rename : content/html/content/test/forms/test_select_selectedOptions.html => dom/html/test/forms/test_select_selectedOptions.html
rename : content/html/content/test/forms/test_select_validation.html => dom/html/test/forms/test_select_validation.html
rename : content/html/content/test/forms/test_set_range_text.html => dom/html/test/forms/test_set_range_text.html
rename : content/html/content/test/forms/test_step_attribute.html => dom/html/test/forms/test_step_attribute.html
rename : content/html/content/test/forms/test_stepup_stepdown.html => dom/html/test/forms/test_stepup_stepdown.html
rename : content/html/content/test/forms/test_submit_invalid_file.html => dom/html/test/forms/test_submit_invalid_file.html
rename : content/html/content/test/forms/test_textarea_attributes_reflection.html => dom/html/test/forms/test_textarea_attributes_reflection.html
rename : content/html/content/test/forms/test_validation.html => dom/html/test/forms/test_validation.html
rename : content/html/content/test/forms/test_validation_not_in_doc.html => dom/html/test/forms/test_validation_not_in_doc.html
rename : content/html/content/test/forms/test_valueAsDate_pref.html => dom/html/test/forms/test_valueAsDate_pref.html
rename : content/html/content/test/forms/test_valueasdate_attribute.html => dom/html/test/forms/test_valueasdate_attribute.html
rename : content/html/content/test/forms/test_valueasnumber_attribute.html => dom/html/test/forms/test_valueasnumber_attribute.html
rename : content/html/content/test/image-allow-credentials.png => dom/html/test/image-allow-credentials.png
rename : content/html/content/test/image-allow-credentials.png^headers^ => dom/html/test/image-allow-credentials.png^headers^
rename : content/html/content/test/image.png => dom/html/test/image.png
rename : content/html/content/test/imports/file_cycle_1_A.html => dom/html/test/imports/file_cycle_1_A.html
rename : content/html/content/test/imports/file_cycle_1_B.html => dom/html/test/imports/file_cycle_1_B.html
rename : content/html/content/test/imports/file_cycle_1_C.html => dom/html/test/imports/file_cycle_1_C.html
rename : content/html/content/test/imports/file_cycle_2_A.html => dom/html/test/imports/file_cycle_2_A.html
rename : content/html/content/test/imports/file_cycle_2_B.html => dom/html/test/imports/file_cycle_2_B.html
rename : content/html/content/test/imports/file_cycle_2_C.html => dom/html/test/imports/file_cycle_2_C.html
rename : content/html/content/test/imports/file_cycle_2_D.html => dom/html/test/imports/file_cycle_2_D.html
rename : content/html/content/test/imports/file_cycle_3_A.html => dom/html/test/imports/file_cycle_3_A.html
rename : content/html/content/test/imports/file_cycle_3_B.html => dom/html/test/imports/file_cycle_3_B.html
rename : content/html/content/test/imports/file_cycle_3_C.html => dom/html/test/imports/file_cycle_3_C.html
rename : content/html/content/test/imports/file_cycle_4_A.html => dom/html/test/imports/file_cycle_4_A.html
rename : content/html/content/test/imports/file_cycle_4_B.html => dom/html/test/imports/file_cycle_4_B.html
rename : content/html/content/test/imports/file_cycle_4_C.html => dom/html/test/imports/file_cycle_4_C.html
rename : content/html/content/test/imports/file_cycle_4_D.html => dom/html/test/imports/file_cycle_4_D.html
rename : content/html/content/test/imports/file_cycle_4_E.html => dom/html/test/imports/file_cycle_4_E.html
rename : content/html/content/test/imports/file_cycle_5_A.html => dom/html/test/imports/file_cycle_5_A.html
rename : content/html/content/test/imports/file_cycle_5_B.html => dom/html/test/imports/file_cycle_5_B.html
rename : content/html/content/test/imports/file_cycle_5_C.html => dom/html/test/imports/file_cycle_5_C.html
rename : content/html/content/test/imports/file_cycle_5_D.html => dom/html/test/imports/file_cycle_5_D.html
rename : content/html/content/test/imports/file_encoding.html => dom/html/test/imports/file_encoding.html
rename : content/html/content/test/imports/file_importA1.html => dom/html/test/imports/file_importA1.html
rename : content/html/content/test/imports/file_importA2.html => dom/html/test/imports/file_importA2.html
rename : content/html/content/test/imports/file_importB1.html => dom/html/test/imports/file_importB1.html
rename : content/html/content/test/imports/file_importB2.html => dom/html/test/imports/file_importB2.html
rename : content/html/content/test/imports/file_importC1.html => dom/html/test/imports/file_importC1.html
rename : content/html/content/test/imports/file_importC10.html => dom/html/test/imports/file_importC10.html
rename : content/html/content/test/imports/file_importC2.html => dom/html/test/imports/file_importC2.html
rename : content/html/content/test/imports/file_importC3.html => dom/html/test/imports/file_importC3.html
rename : content/html/content/test/imports/file_importC4.html => dom/html/test/imports/file_importC4.html
rename : content/html/content/test/imports/file_importC5.html => dom/html/test/imports/file_importC5.html
rename : content/html/content/test/imports/file_importC6.html => dom/html/test/imports/file_importC6.html
rename : content/html/content/test/imports/file_importC7.html => dom/html/test/imports/file_importC7.html
rename : content/html/content/test/imports/file_importC8.html => dom/html/test/imports/file_importC8.html
rename : content/html/content/test/imports/file_importC9.html => dom/html/test/imports/file_importC9.html
rename : content/html/content/test/imports/file_importD.html => dom/html/test/imports/file_importD.html
rename : content/html/content/test/imports/file_importE.html => dom/html/test/imports/file_importE.html
rename : content/html/content/test/imports/mochitest.ini => dom/html/test/imports/mochitest.ini
rename : content/html/content/test/imports/test_cycle_1.html => dom/html/test/imports/test_cycle_1.html
rename : content/html/content/test/imports/test_cycle_2.html => dom/html/test/imports/test_cycle_2.html
rename : content/html/content/test/imports/test_cycle_3.html => dom/html/test/imports/test_cycle_3.html
rename : content/html/content/test/imports/test_cycle_4.html => dom/html/test/imports/test_cycle_4.html
rename : content/html/content/test/imports/test_cycle_5.html => dom/html/test/imports/test_cycle_5.html
rename : content/html/content/test/imports/test_encoding.html => dom/html/test/imports/test_encoding.html
rename : content/html/content/test/mochitest.ini => dom/html/test/mochitest.ini
rename : content/html/content/test/nnc_lockup.gif => dom/html/test/nnc_lockup.gif
rename : content/html/content/test/reflect.js => dom/html/test/reflect.js
rename : content/html/content/test/test_a_text.html => dom/html/test/test_a_text.html
rename : content/html/content/test/test_allowMedia.html => dom/html/test/test_allowMedia.html
rename : content/html/content/test/test_anchor_href_cache_invalidation.html => dom/html/test/test_anchor_href_cache_invalidation.html
rename : content/html/content/test/test_anchor_ping.html => dom/html/test/test_anchor_ping.html
rename : content/html/content/test/test_applet_attributes_reflection.html => dom/html/test/test_applet_attributes_reflection.html
rename : content/html/content/test/test_audio_wakelock.html => dom/html/test/test_audio_wakelock.html
rename : content/html/content/test/test_base_attributes_reflection.html => dom/html/test/test_base_attributes_reflection.html
rename : content/html/content/test/test_bug1003539.html => dom/html/test/test_bug1003539.html
rename : content/html/content/test/test_bug100533.html => dom/html/test/test_bug100533.html
rename : content/html/document/test/test_bug1013316.html => dom/html/test/test_bug1013316.html
rename : content/html/content/test/test_bug1045270.html => dom/html/test/test_bug1045270.html
rename : content/html/content/test/test_bug109445.html => dom/html/test/test_bug109445.html
rename : content/html/content/test/test_bug109445.xhtml => dom/html/test/test_bug109445.xhtml
rename : content/html/content/test/test_bug1297.html => dom/html/test/test_bug1297.html
rename : content/html/content/test/test_bug1366.html => dom/html/test/test_bug1366.html
rename : content/html/content/test/test_bug1400.html => dom/html/test/test_bug1400.html
rename : content/html/content/test/test_bug143220.html => dom/html/test/test_bug143220.html
rename : content/html/document/test/test_bug1682.html => dom/html/test/test_bug1682.html
rename : content/html/document/test/test_bug172261.html => dom/html/test/test_bug172261.html
rename : content/html/content/test/test_bug182279.html => dom/html/test/test_bug182279.html
rename : content/html/document/test/test_bug1823.html => dom/html/test/test_bug1823.html
rename : content/html/document/test/test_bug196523.html => dom/html/test/test_bug196523.html
rename : content/html/document/test/test_bug199692.html => dom/html/test/test_bug199692.html
rename : content/html/content/test/test_bug2082.html => dom/html/test/test_bug2082.html
rename : content/html/content/test/test_bug209275.xhtml => dom/html/test/test_bug209275.xhtml
rename : content/html/content/test/test_bug237071.html => dom/html/test/test_bug237071.html
rename : content/html/content/test/test_bug242709.html => dom/html/test/test_bug242709.html
rename : content/html/content/test/test_bug24958.html => dom/html/test/test_bug24958.html
rename : content/html/document/test/test_bug255820.html => dom/html/test/test_bug255820.html
rename : content/html/document/test/test_bug259332.html => dom/html/test/test_bug259332.html
rename : content/html/content/test/test_bug274626.html => dom/html/test/test_bug274626.html
rename : content/html/content/test/test_bug277724.html => dom/html/test/test_bug277724.html
rename : content/html/content/test/test_bug277890.html => dom/html/test/test_bug277890.html
rename : content/html/content/test/test_bug287465.html => dom/html/test/test_bug287465.html
rename : content/html/content/test/test_bug295561.html => dom/html/test/test_bug295561.html
rename : content/html/content/test/test_bug297761.html => dom/html/test/test_bug297761.html
rename : content/html/content/test/test_bug300691-1.html => dom/html/test/test_bug300691-1.html
rename : content/html/content/test/test_bug300691-2.html => dom/html/test/test_bug300691-2.html
rename : content/html/content/test/test_bug300691-3.xhtml => dom/html/test/test_bug300691-3.xhtml
rename : content/html/document/test/test_bug311681.html => dom/html/test/test_bug311681.html
rename : content/html/document/test/test_bug311681.xhtml => dom/html/test/test_bug311681.xhtml
rename : content/html/document/test/test_bug324378.html => dom/html/test/test_bug324378.html
rename : content/html/content/test/test_bug330705-1.html => dom/html/test/test_bug330705-1.html
rename : content/html/content/test/test_bug332246.html => dom/html/test/test_bug332246.html
rename : content/html/document/test/test_bug332848.xhtml => dom/html/test/test_bug332848.xhtml
rename : content/html/content/test/test_bug332893-1.html => dom/html/test/test_bug332893-1.html
rename : content/html/content/test/test_bug332893-2.html => dom/html/test/test_bug332893-2.html
rename : content/html/content/test/test_bug332893-3.html => dom/html/test/test_bug332893-3.html
rename : content/html/content/test/test_bug332893-4.html => dom/html/test/test_bug332893-4.html
rename : content/html/content/test/test_bug332893-5.html => dom/html/test/test_bug332893-5.html
rename : content/html/content/test/test_bug332893-6.html => dom/html/test/test_bug332893-6.html
rename : content/html/content/test/test_bug332893-7.html => dom/html/test/test_bug332893-7.html
rename : content/html/content/test/test_bug3348.html => dom/html/test/test_bug3348.html
rename : content/html/document/test/test_bug340017.xhtml => dom/html/test/test_bug340017.xhtml
rename : content/html/content/test/test_bug340800.html => dom/html/test/test_bug340800.html
rename : content/html/content/test/test_bug347174.html => dom/html/test/test_bug347174.html
rename : content/html/content/test/test_bug347174_write.html => dom/html/test/test_bug347174_write.html
rename : content/html/content/test/test_bug347174_xsl.html => dom/html/test/test_bug347174_xsl.html
rename : content/html/content/test/test_bug347174_xslp.html => dom/html/test/test_bug347174_xslp.html
rename : content/html/content/test/test_bug353415-1.html => dom/html/test/test_bug353415-1.html
rename : content/html/content/test/test_bug353415-2.html => dom/html/test/test_bug353415-2.html
rename : content/html/document/test/test_bug359657.html => dom/html/test/test_bug359657.html
rename : content/html/document/test/test_bug369370.html => dom/html/test/test_bug369370.html
rename : content/html/content/test/test_bug371375.html => dom/html/test/test_bug371375.html
rename : content/html/content/test/test_bug372098.html => dom/html/test/test_bug372098.html
rename : content/html/content/test/test_bug373589.html => dom/html/test/test_bug373589.html
rename : content/html/content/test/test_bug375003-1.html => dom/html/test/test_bug375003-1.html
rename : content/html/content/test/test_bug375003-2.html => dom/html/test/test_bug375003-2.html
rename : content/html/content/test/test_bug377624.html => dom/html/test/test_bug377624.html
rename : content/html/document/test/test_bug380383.html => dom/html/test/test_bug380383.html
rename : content/html/content/test/test_bug383383.html => dom/html/test/test_bug383383.html
rename : content/html/content/test/test_bug383383_2.xhtml => dom/html/test/test_bug383383_2.xhtml
rename : content/html/content/test/test_bug384419.html => dom/html/test/test_bug384419.html
rename : content/html/content/test/test_bug386496.html => dom/html/test/test_bug386496.html
rename : content/html/content/test/test_bug386728.html => dom/html/test/test_bug386728.html
rename : content/html/content/test/test_bug386996.html => dom/html/test/test_bug386996.html
rename : content/html/content/test/test_bug388558.html => dom/html/test/test_bug388558.html
rename : content/html/content/test/test_bug388746.html => dom/html/test/test_bug388746.html
rename : content/html/content/test/test_bug388794.html => dom/html/test/test_bug388794.html
rename : content/html/content/test/test_bug389797.html => dom/html/test/test_bug389797.html
rename : content/html/content/test/test_bug390975.html => dom/html/test/test_bug390975.html
rename : content/html/document/test/test_bug391777.html => dom/html/test/test_bug391777.html
rename : content/html/content/test/test_bug391994.html => dom/html/test/test_bug391994.html
rename : content/html/content/test/test_bug392567.html => dom/html/test/test_bug392567.html
rename : content/html/content/test/test_bug394700.html => dom/html/test/test_bug394700.html
rename : content/html/content/test/test_bug395107.html => dom/html/test/test_bug395107.html
rename : content/html/content/test/test_bug401160.xhtml => dom/html/test/test_bug401160.xhtml
rename : content/html/document/test/test_bug402680.html => dom/html/test/test_bug402680.html
rename : content/html/document/test/test_bug403868.html => dom/html/test/test_bug403868.html
rename : content/html/document/test/test_bug403868.xhtml => dom/html/test/test_bug403868.xhtml
rename : content/html/content/test/test_bug405242.html => dom/html/test/test_bug405242.html
rename : content/html/content/test/test_bug406596.html => dom/html/test/test_bug406596.html
rename : content/html/content/test/test_bug417760.html => dom/html/test/test_bug417760.html
rename : content/html/content/test/test_bug421640.html => dom/html/test/test_bug421640.html
rename : content/html/content/test/test_bug424698.html => dom/html/test/test_bug424698.html
rename : content/html/content/test/test_bug428135.xhtml => dom/html/test/test_bug428135.xhtml
rename : content/html/content/test/test_bug430351.html => dom/html/test/test_bug430351.html
rename : content/html/content/test/test_bug430392.html => dom/html/test/test_bug430392.html
rename : content/html/document/test/test_bug435128.html => dom/html/test/test_bug435128.html
rename : content/html/content/test/test_bug441930.html => dom/html/test/test_bug441930.html
rename : content/html/content/test/test_bug442801.html => dom/html/test/test_bug442801.html
rename : content/html/document/test/test_bug445004.html => dom/html/test/test_bug445004.html
rename : content/html/document/test/test_bug446483.html => dom/html/test/test_bug446483.html
rename : content/html/content/test/test_bug448166.html => dom/html/test/test_bug448166.html
rename : content/html/document/test/test_bug448564.html => dom/html/test/test_bug448564.html
rename : content/html/content/test/test_bug456229.html => dom/html/test/test_bug456229.html
rename : content/html/content/test/test_bug458037.xhtml => dom/html/test/test_bug458037.xhtml
rename : content/html/content/test/test_bug460568.html => dom/html/test/test_bug460568.html
rename : content/html/document/test/test_bug463104.html => dom/html/test/test_bug463104.html
rename : content/html/document/test/test_bug478251.html => dom/html/test/test_bug478251.html
rename : content/html/content/test/test_bug481335.xhtml => dom/html/test/test_bug481335.xhtml
rename : content/html/document/test/test_bug481440.html => dom/html/test/test_bug481440.html
rename : content/html/document/test/test_bug481647.html => dom/html/test/test_bug481647.html
rename : content/html/document/test/test_bug482659.html => dom/html/test/test_bug482659.html
rename : content/html/document/test/test_bug486741.html => dom/html/test/test_bug486741.html
rename : content/html/document/test/test_bug489532.html => dom/html/test/test_bug489532.html
rename : content/html/document/test/test_bug497242.xhtml => dom/html/test/test_bug497242.xhtml
rename : content/html/document/test/test_bug499092.html => dom/html/test/test_bug499092.html
rename : content/html/content/test/test_bug500885.html => dom/html/test/test_bug500885.html
rename : content/html/document/test/test_bug512367.html => dom/html/test/test_bug512367.html
rename : content/html/content/test/test_bug514856.html => dom/html/test/test_bug514856.html
rename : content/html/content/test/test_bug518122.html => dom/html/test/test_bug518122.html
rename : content/html/content/test/test_bug519987.html => dom/html/test/test_bug519987.html
rename : content/html/content/test/test_bug523771.html => dom/html/test/test_bug523771.html
rename : content/html/content/test/test_bug529819.html => dom/html/test/test_bug529819.html
rename : content/html/content/test/test_bug529859.html => dom/html/test/test_bug529859.html
rename : content/html/content/test/test_bug535043.html => dom/html/test/test_bug535043.html
rename : content/html/content/test/test_bug536891.html => dom/html/test/test_bug536891.html
rename : content/html/content/test/test_bug536895.html => dom/html/test/test_bug536895.html
rename : content/html/content/test/test_bug546995.html => dom/html/test/test_bug546995.html
rename : content/html/content/test/test_bug547850.html => dom/html/test/test_bug547850.html
rename : content/html/content/test/test_bug551846.html => dom/html/test/test_bug551846.html
rename : content/html/content/test/test_bug555567.html => dom/html/test/test_bug555567.html
rename : content/html/content/test/test_bug556645.html => dom/html/test/test_bug556645.html
rename : content/html/content/test/test_bug557087-1.html => dom/html/test/test_bug557087-1.html
rename : content/html/content/test/test_bug557087-2.html => dom/html/test/test_bug557087-2.html
rename : content/html/content/test/test_bug557087-3.html => dom/html/test/test_bug557087-3.html
rename : content/html/content/test/test_bug557087-4.html => dom/html/test/test_bug557087-4.html
rename : content/html/content/test/test_bug557087-5.html => dom/html/test/test_bug557087-5.html
rename : content/html/content/test/test_bug557087-6.html => dom/html/test/test_bug557087-6.html
rename : content/html/content/test/test_bug557620.html => dom/html/test/test_bug557620.html
rename : content/html/content/test/test_bug558788-1.html => dom/html/test/test_bug558788-1.html
rename : content/html/content/test/test_bug558788-2.html => dom/html/test/test_bug558788-2.html
rename : content/html/content/test/test_bug560112.html => dom/html/test/test_bug560112.html
rename : content/html/content/test/test_bug561634.html => dom/html/test/test_bug561634.html
rename : content/html/content/test/test_bug561636.html => dom/html/test/test_bug561636.html
rename : content/html/content/test/test_bug561640.html => dom/html/test/test_bug561640.html
rename : content/html/content/test/test_bug564001.html => dom/html/test/test_bug564001.html
rename : content/html/content/test/test_bug566046.html => dom/html/test/test_bug566046.html
rename : content/html/content/test/test_bug567938-1.html => dom/html/test/test_bug567938-1.html
rename : content/html/content/test/test_bug567938-2.html => dom/html/test/test_bug567938-2.html
rename : content/html/content/test/test_bug567938-3.html => dom/html/test/test_bug567938-3.html
rename : content/html/content/test/test_bug567938-4.html => dom/html/test/test_bug567938-4.html
rename : content/html/content/test/test_bug569955.html => dom/html/test/test_bug569955.html
rename : content/html/content/test/test_bug573969.html => dom/html/test/test_bug573969.html
rename : content/html/document/test/test_bug57600.html => dom/html/test/test_bug57600.html
rename : content/html/content/test/test_bug579079.html => dom/html/test/test_bug579079.html
rename : content/html/content/test/test_bug582412-1.html => dom/html/test/test_bug582412-1.html
rename : content/html/content/test/test_bug582412-2.html => dom/html/test/test_bug582412-2.html
rename : content/html/content/test/test_bug583514.html => dom/html/test/test_bug583514.html
rename : content/html/content/test/test_bug583533.html => dom/html/test/test_bug583533.html
rename : content/html/content/test/test_bug586763.html => dom/html/test/test_bug586763.html
rename : content/html/content/test/test_bug586786.html => dom/html/test/test_bug586786.html
rename : content/html/content/test/test_bug587469.html => dom/html/test/test_bug587469.html
rename : content/html/content/test/test_bug589.html => dom/html/test/test_bug589.html
rename : content/html/content/test/test_bug590353-1.html => dom/html/test/test_bug590353-1.html
rename : content/html/content/test/test_bug590353-2.html => dom/html/test/test_bug590353-2.html
rename : content/html/content/test/test_bug590363.html => dom/html/test/test_bug590363.html
rename : content/html/content/test/test_bug592802.html => dom/html/test/test_bug592802.html
rename : content/html/content/test/test_bug593689.html => dom/html/test/test_bug593689.html
rename : content/html/content/test/test_bug595429.html => dom/html/test/test_bug595429.html
rename : content/html/content/test/test_bug595447.html => dom/html/test/test_bug595447.html
rename : content/html/content/test/test_bug595449.html => dom/html/test/test_bug595449.html
rename : content/html/content/test/test_bug596350.html => dom/html/test/test_bug596350.html
rename : content/html/content/test/test_bug596511.html => dom/html/test/test_bug596511.html
rename : content/html/content/test/test_bug598643.html => dom/html/test/test_bug598643.html
rename : content/html/content/test/test_bug598833-1.html => dom/html/test/test_bug598833-1.html
rename : content/html/content/test/test_bug600155.html => dom/html/test/test_bug600155.html
rename : content/html/content/test/test_bug601030.html => dom/html/test/test_bug601030.html
rename : content/html/content/test/test_bug605124-1.html => dom/html/test/test_bug605124-1.html
rename : content/html/content/test/test_bug605124-2.html => dom/html/test/test_bug605124-2.html
rename : content/html/content/test/test_bug605125-1.html => dom/html/test/test_bug605125-1.html
rename : content/html/content/test/test_bug605125-2.html => dom/html/test/test_bug605125-2.html
rename : content/html/content/test/test_bug606817.html => dom/html/test/test_bug606817.html
rename : content/html/content/test/test_bug607145.html => dom/html/test/test_bug607145.html
rename : content/html/content/test/test_bug610212.html => dom/html/test/test_bug610212.html
rename : content/html/content/test/test_bug610687.html => dom/html/test/test_bug610687.html
rename : content/html/content/test/test_bug611189.html => dom/html/test/test_bug611189.html
rename : content/html/content/test/test_bug612730.html => dom/html/test/test_bug612730.html
rename : content/html/content/test/test_bug613113.html => dom/html/test/test_bug613113.html
rename : content/html/content/test/test_bug613722.html => dom/html/test/test_bug613722.html
rename : content/html/content/test/test_bug613979.html => dom/html/test/test_bug613979.html
rename : content/html/content/test/test_bug615595.html => dom/html/test/test_bug615595.html
rename : content/html/content/test/test_bug615833.html => dom/html/test/test_bug615833.html
rename : content/html/content/test/test_bug617528.html => dom/html/test/test_bug617528.html
rename : content/html/content/test/test_bug618948.html => dom/html/test/test_bug618948.html
rename : content/html/content/test/test_bug619278.html => dom/html/test/test_bug619278.html
rename : content/html/content/test/test_bug622558.html => dom/html/test/test_bug622558.html
rename : content/html/content/test/test_bug622597.html => dom/html/test/test_bug622597.html
rename : content/html/content/test/test_bug623291.html => dom/html/test/test_bug623291.html
rename : content/html/content/test/test_bug6296.html => dom/html/test/test_bug6296.html
rename : content/html/content/test/test_bug629801.html => dom/html/test/test_bug629801.html
rename : content/html/content/test/test_bug633058.html => dom/html/test/test_bug633058.html
rename : content/html/content/test/test_bug636336.html => dom/html/test/test_bug636336.html
rename : content/html/content/test/test_bug641219.html => dom/html/test/test_bug641219.html
rename : content/html/content/test/test_bug643051.html => dom/html/test/test_bug643051.html
rename : content/html/content/test/test_bug646157.html => dom/html/test/test_bug646157.html
rename : content/html/content/test/test_bug649134.html => dom/html/test/test_bug649134.html
rename : content/html/content/test/test_bug651956.html => dom/html/test/test_bug651956.html
rename : content/html/content/test/test_bug658746.html => dom/html/test/test_bug658746.html
rename : content/html/content/test/test_bug659596.html => dom/html/test/test_bug659596.html
rename : content/html/content/test/test_bug659743.xml => dom/html/test/test_bug659743.xml
rename : content/html/content/test/test_bug660663.html => dom/html/test/test_bug660663.html
rename : content/html/content/test/test_bug660959-1.html => dom/html/test/test_bug660959-1.html
rename : content/html/content/test/test_bug660959-2.html => dom/html/test/test_bug660959-2.html
rename : content/html/content/test/test_bug660959-3.html => dom/html/test/test_bug660959-3.html
rename : content/html/content/test/test_bug666200.html => dom/html/test/test_bug666200.html
rename : content/html/content/test/test_bug666666.html => dom/html/test/test_bug666666.html
rename : content/html/content/test/test_bug669012.html => dom/html/test/test_bug669012.html
rename : content/html/content/test/test_bug674558.html => dom/html/test/test_bug674558.html
rename : content/html/content/test/test_bug674927.html => dom/html/test/test_bug674927.html
rename : content/html/content/test/test_bug677463.html => dom/html/test/test_bug677463.html
rename : content/html/document/test/test_bug677495-1.html => dom/html/test/test_bug677495-1.html
rename : content/html/document/test/test_bug677495.html => dom/html/test/test_bug677495.html
rename : content/html/content/test/test_bug677658.html => dom/html/test/test_bug677658.html
rename : content/html/content/test/test_bug682886.html => dom/html/test/test_bug682886.html
rename : content/html/content/test/test_bug691.html => dom/html/test/test_bug691.html
rename : content/html/content/test/test_bug694.html => dom/html/test/test_bug694.html
rename : content/html/content/test/test_bug694503.html => dom/html/test/test_bug694503.html
rename : content/html/content/test/test_bug696.html => dom/html/test/test_bug696.html
rename : content/html/content/test/test_bug717819.html => dom/html/test/test_bug717819.html
rename : content/html/document/test/test_bug741266.html => dom/html/test/test_bug741266.html
rename : content/html/content/test/test_bug742030.html => dom/html/test/test_bug742030.html
rename : content/html/content/test/test_bug742549.html => dom/html/test/test_bug742549.html
rename : content/html/content/test/test_bug745685.html => dom/html/test/test_bug745685.html
rename : content/html/content/test/test_bug763626.html => dom/html/test/test_bug763626.html
rename : content/html/document/test/test_bug765780.html => dom/html/test/test_bug765780.html
rename : content/html/content/test/test_bug780993.html => dom/html/test/test_bug780993.html
rename : content/html/content/test/test_bug787134.html => dom/html/test/test_bug787134.html
rename : content/html/content/test/test_bug797113.html => dom/html/test/test_bug797113.html
rename : content/html/content/test/test_bug803677.html => dom/html/test/test_bug803677.html
rename : content/html/content/test/test_bug821307.html => dom/html/test/test_bug821307.html
rename : content/html/content/test/test_bug827126.html => dom/html/test/test_bug827126.html
rename : content/html/content/test/test_bug827426.html => dom/html/test/test_bug827426.html
rename : content/html/content/test/test_bug838582.html => dom/html/test/test_bug838582.html
rename : content/html/content/test/test_bug839371.html => dom/html/test/test_bug839371.html
rename : content/html/content/test/test_bug839913.html => dom/html/test/test_bug839913.html
rename : content/html/content/test/test_bug840877.html => dom/html/test/test_bug840877.html
rename : content/html/content/test/test_bug841466.html => dom/html/test/test_bug841466.html
rename : content/html/content/test/test_bug845057.html => dom/html/test/test_bug845057.html
rename : content/html/content/test/test_bug869040.html => dom/html/test/test_bug869040.html
rename : content/html/content/test/test_bug870787.html => dom/html/test/test_bug870787.html
rename : content/html/document/test/test_bug871161.html => dom/html/test/test_bug871161.html
rename : content/html/content/test/test_bug874758.html => dom/html/test/test_bug874758.html
rename : content/html/content/test/test_bug879319.html => dom/html/test/test_bug879319.html
rename : content/html/content/test/test_bug885024.html => dom/html/test/test_bug885024.html
rename : content/html/content/test/test_bug893537.html => dom/html/test/test_bug893537.html
rename : content/html/content/test/test_bug95530.html => dom/html/test/test_bug95530.html
rename : content/html/content/test/test_bug969346.html => dom/html/test/test_bug969346.html
rename : content/html/content/test/test_bug982039.html => dom/html/test/test_bug982039.html
rename : content/html/content/test/test_change_crossorigin.html => dom/html/test/test_change_crossorigin.html
rename : content/html/content/test/test_checked.html => dom/html/test/test_checked.html
rename : content/html/content/test/test_dir_attributes_reflection.html => dom/html/test/test_dir_attributes_reflection.html
rename : content/html/content/test/test_dl_attributes_reflection.html => dom/html/test/test_dl_attributes_reflection.html
rename : content/html/document/test/test_document-element-inserted.html => dom/html/test/test_document-element-inserted.html
rename : content/html/document/test/test_document.watch.html => dom/html/test/test_document.watch.html
rename : content/html/document/test/test_documentAll.html => dom/html/test/test_documentAll.html
rename : content/html/content/test/test_element_prototype.html => dom/html/test/test_element_prototype.html
rename : content/html/content/test/test_embed_attributes_reflection.html => dom/html/test/test_embed_attributes_reflection.html
rename : content/html/document/test/test_form-parsing.html => dom/html/test/test_form-parsing.html
rename : content/html/content/test/test_formData.html => dom/html/test/test_formData.html
rename : content/html/content/test/test_formSubmission.html => dom/html/test/test_formSubmission.html
rename : content/html/content/test/test_formSubmission2.html => dom/html/test/test_formSubmission2.html
rename : content/html/content/test/test_formelements.html => dom/html/test/test_formelements.html
rename : content/html/content/test/test_fragment_form_pointer.html => dom/html/test/test_fragment_form_pointer.html
rename : content/html/content/test/test_fullscreen-api.html => dom/html/test/test_fullscreen-api.html
rename : content/html/content/test/test_hidden.html => dom/html/test/test_hidden.html
rename : content/html/content/test/test_html_attributes_reflection.html => dom/html/test/test_html_attributes_reflection.html
rename : content/html/content/test/test_htmlcollection.html => dom/html/test/test_htmlcollection.html
rename : content/html/content/test/test_iframe_sandbox_general.html => dom/html/test/test_iframe_sandbox_general.html
rename : content/html/content/test/test_iframe_sandbox_inheritance.html => dom/html/test/test_iframe_sandbox_inheritance.html
rename : content/html/content/test/test_iframe_sandbox_modal.html => dom/html/test/test_iframe_sandbox_modal.html
rename : content/html/content/test/test_iframe_sandbox_navigation.html => dom/html/test/test_iframe_sandbox_navigation.html
rename : content/html/content/test/test_iframe_sandbox_navigation2.html => dom/html/test/test_iframe_sandbox_navigation2.html
rename : content/html/content/test/test_iframe_sandbox_plugins.html => dom/html/test/test_iframe_sandbox_plugins.html
rename : content/html/content/test/test_iframe_sandbox_popups.html => dom/html/test/test_iframe_sandbox_popups.html
rename : content/html/content/test/test_iframe_sandbox_popups_inheritance.html => dom/html/test/test_iframe_sandbox_popups_inheritance.html
rename : content/html/content/test/test_iframe_sandbox_redirect.html => dom/html/test/test_iframe_sandbox_redirect.html
rename : content/html/content/test/test_iframe_sandbox_same_origin.html => dom/html/test/test_iframe_sandbox_same_origin.html
rename : content/html/content/test/test_iframe_sandbox_workers.html => dom/html/test/test_iframe_sandbox_workers.html
rename : content/html/content/test/test_ignoreuserfocus.html => dom/html/test/test_ignoreuserfocus.html
rename : content/html/content/test/test_imageSrcSet.html => dom/html/test/test_imageSrcSet.html
rename : content/html/content/test/test_img_attributes_reflection.html => dom/html/test/test_img_attributes_reflection.html
rename : content/html/content/test/test_imports_basics.html => dom/html/test/test_imports_basics.html
rename : content/html/content/test/test_imports_nested.html => dom/html/test/test_imports_nested.html
rename : content/html/content/test/test_imports_nested_2.html => dom/html/test/test_imports_nested_2.html
rename : content/html/content/test/test_imports_nonhttp.html => dom/html/test/test_imports_nonhttp.html
rename : content/html/content/test/test_imports_redirect.html => dom/html/test/test_imports_redirect.html
rename : content/html/content/test/test_input_files_not_nsIFile.html => dom/html/test/test_input_files_not_nsIFile.html
rename : content/html/content/test/test_li_attributes_reflection.html => dom/html/test/test_li_attributes_reflection.html
rename : content/html/content/test/test_link_attributes_reflection.html => dom/html/test/test_link_attributes_reflection.html
rename : content/html/content/test/test_link_sizes.html => dom/html/test/test_link_sizes.html
rename : content/html/content/test/test_map_attributes_reflection.html => dom/html/test/test_map_attributes_reflection.html
rename : content/html/content/test/test_meta_attributes_reflection.html => dom/html/test/test_meta_attributes_reflection.html
rename : content/html/content/test/test_mod_attributes_reflection.html => dom/html/test/test_mod_attributes_reflection.html
rename : content/html/content/test/test_mozaudiochannel.html => dom/html/test/test_mozaudiochannel.html
rename : content/html/content/test/test_named_options.html => dom/html/test/test_named_options.html
rename : content/html/content/test/test_nested_invalid_fieldsets.html => dom/html/test/test_nested_invalid_fieldsets.html
rename : content/html/document/test/test_non-ascii-cookie.html => dom/html/test/test_non-ascii-cookie.html
rename : content/html/document/test/test_non-ascii-cookie.html^headers^ => dom/html/test/test_non-ascii-cookie.html^headers^
rename : content/html/content/test/test_object_attributes_reflection.html => dom/html/test/test_object_attributes_reflection.html
rename : content/html/content/test/test_object_plugin_nav.html => dom/html/test/test_object_plugin_nav.html
rename : content/html/content/test/test_ol_attributes_reflection.html => dom/html/test/test_ol_attributes_reflection.html
rename : content/html/content/test/test_option_defaultSelected.html => dom/html/test/test_option_defaultSelected.html
rename : content/html/content/test/test_option_selected_state.html => dom/html/test/test_option_selected_state.html
rename : content/html/content/test/test_param_attributes_reflection.html => dom/html/test/test_param_attributes_reflection.html
rename : content/html/content/test/test_plugin.tst => dom/html/test/test_plugin.tst
rename : content/html/content/test/test_q_attributes_reflection.html => dom/html/test/test_q_attributes_reflection.html
rename : content/html/content/test/test_restore_from_parser_fragment.html => dom/html/test/test_restore_from_parser_fragment.html
rename : content/html/content/test/test_rowscollection.html => dom/html/test/test_rowscollection.html
rename : content/html/content/test/test_srcdoc-2.html => dom/html/test/test_srcdoc-2.html
rename : content/html/content/test/test_srcdoc.html => dom/html/test/test_srcdoc.html
rename : content/html/content/test/test_style_attributes_reflection.html => dom/html/test/test_style_attributes_reflection.html
rename : content/html/content/test/test_track.html => dom/html/test/test_track.html
rename : content/html/content/test/test_track_disabled.html => dom/html/test/test_track_disabled.html
rename : content/html/content/test/test_ul_attributes_reflection.html => dom/html/test/test_ul_attributes_reflection.html
rename : content/html/content/test/test_undoManager.html => dom/html/test/test_undoManager.html
rename : content/html/content/test/test_video_wakelock.html => dom/html/test/test_video_wakelock.html
rename : content/html/document/test/test_viewport.html => dom/html/test/test_viewport.html
rename : content/html/content/test/wakelock.ogg => dom/html/test/wakelock.ogg
rename : content/html/content/test/wakelock.ogv => dom/html/test/wakelock.ogv
2014-10-25 20:24:55 +03:00

3637 lines
104 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=2 et 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 "nsHTMLDocument.h"
#include "nsIContentPolicy.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/dom/HTMLAllCollection.h"
#include "nsCOMPtr.h"
#include "nsGlobalWindow.h"
#include "nsXPIDLString.h"
#include "nsPrintfCString.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsIHTMLContentSink.h"
#include "nsIXMLContentSink.h"
#include "nsHTMLParts.h"
#include "nsHTMLStyleSheet.h"
#include "nsGkAtoms.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIDOMNode.h" // for Find
#include "nsIDOMNodeList.h"
#include "nsIDOMElement.h"
#include "nsPIDOMWindow.h"
#include "nsDOMString.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"
#include "nsIIOService.h"
#include "nsNetUtil.h"
#include "nsIContentViewerContainer.h"
#include "nsIContentViewer.h"
#include "nsDocShell.h"
#include "nsDocShellLoadTypes.h"
#include "nsIWebNavigation.h"
#include "nsIBaseWindow.h"
#include "nsIWebShellServices.h"
#include "nsIScriptContext.h"
#include "nsIXPConnect.h"
#include "nsContentList.h"
#include "nsError.h"
#include "nsIPrincipal.h"
#include "nsJSPrincipals.h"
#include "nsIScriptSecurityManager.h"
#include "nsAttrName.h"
#include "nsNodeUtils.h"
#include "nsNetCID.h"
#include "nsICookieService.h"
#include "nsIServiceManager.h"
#include "nsIConsoleService.h"
#include "nsIComponentManager.h"
#include "nsParserCIID.h"
#include "nsIDOMHTMLElement.h"
#include "nsIDOMHTMLHeadElement.h"
#include "nsNameSpaceManager.h"
#include "nsGenericHTMLElement.h"
#include "mozilla/css/Loader.h"
#include "nsIHttpChannel.h"
#include "nsIFile.h"
#include "nsFrameSelection.h"
#include "nsISelectionPrivate.h"//for toStringwithformat code
#include "nsContentUtils.h"
#include "nsJSUtils.h"
#include "nsIDocumentInlines.h"
#include "nsIDocumentEncoder.h" //for outputting selection
#include "nsICachingChannel.h"
#include "nsIContentViewer.h"
#include "nsIWyciwygChannel.h"
#include "nsIScriptElement.h"
#include "nsIScriptError.h"
#include "nsIMutableArray.h"
#include "nsArrayUtils.h"
#include "nsIEffectiveTLDService.h"
//AHMED 12-2
#include "nsBidiUtils.h"
#include "mozilla/dom/EncodingUtils.h"
#include "mozilla/dom/FallbackEncoding.h"
#include "mozilla/LoadInfo.h"
#include "nsIEditingSession.h"
#include "nsIEditor.h"
#include "nsNodeInfoManager.h"
#include "nsIPlaintextEditor.h"
#include "nsIHTMLEditor.h"
#include "nsIEditorStyleSheets.h"
#include "nsIInlineSpellChecker.h"
#include "nsRange.h"
#include "mozAutoDocUpdate.h"
#include "nsCCUncollectableMarker.h"
#include "nsHtml5Module.h"
#include "prprf.h"
#include "mozilla/dom/Element.h"
#include "mozilla/Preferences.h"
#include "nsMimeTypes.h"
#include "nsIRequest.h"
#include "nsHtml5TreeOpExecutor.h"
#include "nsHtml5Parser.h"
#include "nsIDOMJSWindow.h"
#include "nsSandboxFlags.h"
#include "nsIImageDocument.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "mozilla/dom/HTMLDocumentBinding.h"
#include "nsCharsetSource.h"
#include "nsIStringBundle.h"
#include "nsDOMClassInfo.h"
using namespace mozilla;
using namespace mozilla::dom;
#define NS_MAX_DOCUMENT_WRITE_DEPTH 20
#include "prtime.h"
//#define DEBUG_charset
static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
uint32_t nsHTMLDocument::gWyciwygSessionCnt = 0;
// this function will return false if the command is not recognized
// inCommandID will be converted as necessary for internal operations
// inParam will be converted as necessary for internal operations
// outParam will be Empty if no parameter is needed or if returning a boolean
// outIsBoolean will determine whether to send param as a boolean or string
// outBooleanParam will not be set unless outIsBoolean
static bool ConvertToMidasInternalCommand(const nsAString & inCommandID,
const nsAString & inParam,
nsACString& outCommandID,
nsACString& outParam,
bool& isBoolean,
bool& boolValue);
static bool ConvertToMidasInternalCommand(const nsAString & inCommandID,
nsACString& outCommandID);
// ==================================================================
// =
// ==================================================================
static nsresult
RemoveFromAgentSheets(nsCOMArray<nsIStyleSheet> &aAgentSheets, const nsAString& url)
{
nsCOMPtr<nsIURI> uri;
nsresult rv = NS_NewURI(getter_AddRefs(uri), url);
NS_ENSURE_SUCCESS(rv, rv);
for (int32_t i = aAgentSheets.Count() - 1; i >= 0; --i) {
nsIStyleSheet* sheet = aAgentSheets[i];
nsIURI* sheetURI = sheet->GetSheetURI();
bool equals = false;
uri->Equals(sheetURI, &equals);
if (equals) {
aAgentSheets.RemoveObjectAt(i);
}
}
return NS_OK;
}
nsresult
NS_NewHTMLDocument(nsIDocument** aInstancePtrResult, bool aLoadedAsData)
{
nsRefPtr<nsHTMLDocument> doc = new nsHTMLDocument();
nsresult rv = doc->Init();
if (NS_FAILED(rv)) {
*aInstancePtrResult = nullptr;
return rv;
}
doc->SetLoadedAsData(aLoadedAsData);
doc.forget(aInstancePtrResult);
return NS_OK;
}
// NOTE! nsDocument::operator new() zeroes out all members, so don't
// bother initializing members to 0.
nsHTMLDocument::nsHTMLDocument()
: nsDocument("text/html")
{
// NOTE! nsDocument::operator new() zeroes out all members, so don't
// bother initializing members to 0.
mType = eHTML;
mDefaultElementType = kNameSpaceID_XHTML;
mCompatMode = eCompatibility_NavQuirks;
}
nsHTMLDocument::~nsHTMLDocument()
{
}
NS_IMPL_CYCLE_COLLECTION_INHERITED(nsHTMLDocument, nsDocument,
mAll,
mImages,
mApplets,
mEmbeds,
mLinks,
mAnchors,
mScripts,
mForms,
mFormControls,
mWyciwygChannel,
mMidasCommandManager)
NS_IMPL_ADDREF_INHERITED(nsHTMLDocument, nsDocument)
NS_IMPL_RELEASE_INHERITED(nsHTMLDocument, nsDocument)
// QueryInterface implementation for nsHTMLDocument
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLDocument)
NS_INTERFACE_TABLE_INHERITED(nsHTMLDocument, nsIHTMLDocument,
nsIDOMHTMLDocument)
NS_INTERFACE_TABLE_TAIL_INHERITING(nsDocument)
JSObject*
nsHTMLDocument::WrapNode(JSContext* aCx)
{
return HTMLDocumentBinding::Wrap(aCx, this);
}
nsresult
nsHTMLDocument::Init()
{
nsresult rv = nsDocument::Init();
NS_ENSURE_SUCCESS(rv, rv);
// Now reset the compatibility mode of the CSSLoader
// to match our compat mode.
CSSLoader()->SetCompatibilityMode(mCompatMode);
return NS_OK;
}
void
nsHTMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
{
nsDocument::Reset(aChannel, aLoadGroup);
if (aChannel) {
aChannel->GetLoadFlags(&mLoadFlags);
}
}
void
nsHTMLDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
nsIPrincipal* aPrincipal)
{
mLoadFlags = nsIRequest::LOAD_NORMAL;
nsDocument::ResetToURI(aURI, aLoadGroup, aPrincipal);
mImages = nullptr;
mApplets = nullptr;
mEmbeds = nullptr;
mLinks = nullptr;
mAnchors = nullptr;
mScripts = nullptr;
mForms = nullptr;
NS_ASSERTION(!mWyciwygChannel,
"nsHTMLDocument::Reset() - Wyciwyg Channel still exists!");
mWyciwygChannel = nullptr;
// Make the content type default to "text/html", we are a HTML
// document, after all. Once we start getting data, this may be
// changed.
SetContentTypeInternal(nsDependentCString("text/html"));
}
already_AddRefed<nsIPresShell>
nsHTMLDocument::CreateShell(nsPresContext* aContext,
nsViewManager* aViewManager,
nsStyleSet* aStyleSet)
{
return doCreateShell(aContext, aViewManager, aStyleSet, mCompatMode);
}
void
nsHTMLDocument::TryHintCharset(nsIContentViewer* aCv,
int32_t& aCharsetSource, nsACString& aCharset)
{
if (aCv) {
int32_t requestCharsetSource;
nsresult rv = aCv->GetHintCharacterSetSource(&requestCharsetSource);
if(NS_SUCCEEDED(rv) && kCharsetUninitialized != requestCharsetSource) {
nsAutoCString requestCharset;
rv = aCv->GetHintCharacterSet(requestCharset);
aCv->SetHintCharacterSetSource((int32_t)(kCharsetUninitialized));
if(requestCharsetSource <= aCharsetSource)
return;
if(NS_SUCCEEDED(rv) && EncodingUtils::IsAsciiCompatible(requestCharset)) {
aCharsetSource = requestCharsetSource;
aCharset = requestCharset;
return;
}
}
}
return;
}
void
nsHTMLDocument::TryUserForcedCharset(nsIContentViewer* aCv,
nsIDocShell* aDocShell,
int32_t& aCharsetSource,
nsACString& aCharset)
{
nsresult rv = NS_OK;
if(kCharsetFromUserForced <= aCharsetSource)
return;
// mCharacterSet not updated yet for channel, so check aCharset, too.
if (WillIgnoreCharsetOverride() || !EncodingUtils::IsAsciiCompatible(aCharset)) {
return;
}
nsAutoCString forceCharsetFromDocShell;
if (aCv) {
// XXX mailnews-only
rv = aCv->GetForceCharacterSet(forceCharsetFromDocShell);
}
if(NS_SUCCEEDED(rv) &&
!forceCharsetFromDocShell.IsEmpty() &&
EncodingUtils::IsAsciiCompatible(forceCharsetFromDocShell)) {
aCharset = forceCharsetFromDocShell;
aCharsetSource = kCharsetFromUserForced;
return;
}
if (aDocShell) {
// This is the Character Encoding menu code path in Firefox
nsAutoCString charset;
rv = aDocShell->GetForcedCharset(charset);
if (NS_SUCCEEDED(rv) && !charset.IsEmpty()) {
if (!EncodingUtils::IsAsciiCompatible(charset)) {
return;
}
aCharset = charset;
aCharsetSource = kCharsetFromUserForced;
aDocShell->SetForcedCharset(NS_LITERAL_CSTRING(""));
}
}
}
void
nsHTMLDocument::TryCacheCharset(nsICachingChannel* aCachingChannel,
int32_t& aCharsetSource,
nsACString& aCharset)
{
nsresult rv;
if (kCharsetFromCache <= aCharsetSource) {
return;
}
nsCString cachedCharset;
rv = aCachingChannel->GetCacheTokenCachedCharset(cachedCharset);
// Check EncodingUtils::IsAsciiCompatible() even in the cache case, because the value
// might be stale and in the case of a stale charset that is not a rough
// ASCII superset, the parser has no way to recover.
if (NS_SUCCEEDED(rv) &&
!cachedCharset.IsEmpty() &&
EncodingUtils::IsAsciiCompatible(cachedCharset))
{
aCharset = cachedCharset;
aCharsetSource = kCharsetFromCache;
}
}
void
nsHTMLDocument::TryParentCharset(nsIDocShell* aDocShell,
int32_t& aCharsetSource,
nsACString& aCharset)
{
if (!aDocShell) {
return;
}
if (aCharsetSource >= kCharsetFromParentForced) {
return;
}
int32_t parentSource;
nsAutoCString parentCharset;
nsCOMPtr<nsIPrincipal> parentPrincipal;
aDocShell->GetParentCharset(parentCharset,
&parentSource,
getter_AddRefs(parentPrincipal));
if (parentCharset.IsEmpty()) {
return;
}
if (kCharsetFromParentForced == parentSource ||
kCharsetFromUserForced == parentSource) {
if (WillIgnoreCharsetOverride() ||
!EncodingUtils::IsAsciiCompatible(aCharset) || // if channel said UTF-16
!EncodingUtils::IsAsciiCompatible(parentCharset)) {
return;
}
aCharset.Assign(parentCharset);
aCharsetSource = kCharsetFromParentForced;
return;
}
if (aCharsetSource >= kCharsetFromParentFrame) {
return;
}
if (kCharsetFromCache <= parentSource) {
// Make sure that's OK
if (!NodePrincipal()->Equals(parentPrincipal) ||
!EncodingUtils::IsAsciiCompatible(parentCharset)) {
return;
}
aCharset.Assign(parentCharset);
aCharsetSource = kCharsetFromParentFrame;
}
}
void
nsHTMLDocument::TryTLD(int32_t& aCharsetSource, nsACString& aCharset)
{
if (aCharsetSource >= kCharsetFromTopLevelDomain) {
return;
}
if (!FallbackEncoding::sGuessFallbackFromTopLevelDomain) {
return;
}
if (!mDocumentURI) {
return;
}
nsAutoCString host;
mDocumentURI->GetAsciiHost(host);
if (host.IsEmpty()) {
return;
}
// First let's see if the host is DNS-absolute and ends with a dot and
// get rid of that one.
if (host.Last() == '.') {
host.SetLength(host.Length() - 1);
if (host.IsEmpty()) {
return;
}
}
// If we still have a dot, the host is weird, so let's continue only
// if we have something other than a dot now.
if (host.Last() == '.') {
return;
}
int32_t index = host.RFindChar('.');
if (index == kNotFound) {
// We have an intranet host, Gecko-internal URL or an IPv6 address.
return;
}
// Since the string didn't end with a dot and we found a dot,
// there is at least one character between the dot and the end of
// the string, so taking the substring below is safe.
nsAutoCString tld;
ToLowerCase(Substring(host, index + 1, host.Length() - (index + 1)), tld);
// Reject generic TLDs and country TLDs that need more research
if (!FallbackEncoding::IsParticipatingTopLevelDomain(tld)) {
return;
}
// Check if we have an IPv4 address
bool seenNonDigit = false;
for (size_t i = 0; i < tld.Length(); ++i) {
char c = tld.CharAt(i);
if (c < '0' || c > '9') {
seenNonDigit = true;
break;
}
}
if (!seenNonDigit) {
return;
}
aCharsetSource = kCharsetFromTopLevelDomain;
FallbackEncoding::FromTopLevelDomain(tld, aCharset);
}
void
nsHTMLDocument::TryFallback(int32_t& aCharsetSource, nsACString& aCharset)
{
if (kCharsetFromFallback <= aCharsetSource)
return;
aCharsetSource = kCharsetFromFallback;
FallbackEncoding::FromLocale(aCharset);
}
void
nsHTMLDocument::SetDocumentCharacterSet(const nsACString& aCharSetID)
{
nsDocument::SetDocumentCharacterSet(aCharSetID);
// Make sure to stash this charset on our channel as needed if it's a wyciwyg
// channel.
nsCOMPtr<nsIWyciwygChannel> wyciwygChannel = do_QueryInterface(mChannel);
if (wyciwygChannel) {
wyciwygChannel->SetCharsetAndSource(GetDocumentCharacterSetSource(),
aCharSetID);
}
}
nsresult
nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
nsISupports* aContainer,
nsIStreamListener **aDocListener,
bool aReset,
nsIContentSink* aSink)
{
if (!aCommand) {
MOZ_ASSERT(false, "Command is mandatory");
return NS_ERROR_INVALID_POINTER;
}
if (aSink) {
MOZ_ASSERT(false, "Got a sink override. Should not happen for HTML doc.");
return NS_ERROR_INVALID_ARG;
}
if (mType != eHTML) {
MOZ_ASSERT(mType == eXHTML);
MOZ_ASSERT(false, "Must not set HTML doc to XHTML mode before load start.");
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
nsAutoCString contentType;
aChannel->GetContentType(contentType);
bool view = !strcmp(aCommand, "view") ||
!strcmp(aCommand, "external-resource");
bool viewSource = !strcmp(aCommand, "view-source");
bool asData = !strcmp(aCommand, kLoadAsData);
bool import = !strcmp(aCommand, "import");
if (!(view || viewSource || asData || import)) {
MOZ_ASSERT(false, "Bad parser command");
return NS_ERROR_INVALID_ARG;
}
bool html = contentType.EqualsLiteral(TEXT_HTML);
bool xhtml = !html && contentType.EqualsLiteral(APPLICATION_XHTML_XML);
bool plainText = !html && !xhtml && nsContentUtils::IsPlainTextType(contentType);
if (!(html || xhtml || plainText || viewSource)) {
MOZ_ASSERT(false, "Channel with bad content type.");
return NS_ERROR_INVALID_ARG;
}
bool loadAsHtml5 = true;
if (!viewSource && xhtml) {
// We're parsing XHTML as XML, remember that.
mType = eXHTML;
mCompatMode = eCompatibility_FullStandards;
loadAsHtml5 = false;
}
// TODO: Proper about:blank treatment is bug 543435
if (loadAsHtml5 && view) {
// mDocumentURI hasn't been set, yet, so get the URI from the channel
nsCOMPtr<nsIURI> uri;
aChannel->GetOriginalURI(getter_AddRefs(uri));
// Adapted from nsDocShell:
// GetSpec can be expensive for some URIs, so check the scheme first.
bool isAbout = false;
if (uri && NS_SUCCEEDED(uri->SchemeIs("about", &isAbout)) && isAbout) {
nsAutoCString str;
uri->GetSpec(str);
if (str.EqualsLiteral("about:blank")) {
loadAsHtml5 = false;
}
}
}
CSSLoader()->SetCompatibilityMode(mCompatMode);
nsresult rv = nsDocument::StartDocumentLoad(aCommand,
aChannel, aLoadGroup,
aContainer,
aDocListener, aReset);
if (NS_FAILED(rv)) {
return rv;
}
// Store the security info for future use with wyciwyg channels.
aChannel->GetSecurityInfo(getter_AddRefs(mSecurityInfo));
nsCOMPtr<nsIURI> uri;
rv = aChannel->GetURI(getter_AddRefs(uri));
if (NS_FAILED(rv)) {
return rv;
}
nsCOMPtr<nsICachingChannel> cachingChan = do_QueryInterface(aChannel);
if (loadAsHtml5) {
mParser = nsHtml5Module::NewHtml5Parser();
if (plainText) {
if (viewSource) {
mParser->MarkAsNotScriptCreated("view-source-plain");
} else {
mParser->MarkAsNotScriptCreated("plain-text");
}
} else if (viewSource && !html) {
mParser->MarkAsNotScriptCreated("view-source-xml");
} else {
mParser->MarkAsNotScriptCreated(aCommand);
}
} else {
mParser = do_CreateInstance(kCParserCID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
}
// Look for the parent document. Note that at this point we don't have our
// content viewer set up yet, and therefore do not have a useful
// mParentDocument.
// in this block of code, if we get an error result, we return it
// but if we get a null pointer, that's perfectly legal for parent
// and parentContentViewer
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aContainer));
nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
if (docShell) {
docShell->GetSameTypeParent(getter_AddRefs(parentAsItem));
}
nsCOMPtr<nsIDocShell> parent(do_QueryInterface(parentAsItem));
nsCOMPtr<nsIContentViewer> parentContentViewer;
if (parent) {
rv = parent->GetContentViewer(getter_AddRefs(parentContentViewer));
NS_ENSURE_SUCCESS(rv, rv);
}
nsCOMPtr<nsIContentViewer> cv;
if (docShell) {
docShell->GetContentViewer(getter_AddRefs(cv));
}
if (!cv) {
cv = parentContentViewer.forget();
}
nsAutoCString urlSpec;
uri->GetSpec(urlSpec);
#ifdef DEBUG_charset
printf("Determining charset for %s\n", urlSpec.get());
#endif
// These are the charset source and charset for our document
int32_t charsetSource;
nsAutoCString charset;
// These are the charset source and charset for the parser. This can differ
// from that for the document if the channel is a wyciwyg channel.
int32_t parserCharsetSource;
nsAutoCString parserCharset;
nsCOMPtr<nsIWyciwygChannel> wyciwygChannel;
// For error reporting
nsHtml5TreeOpExecutor* executor = nullptr;
if (loadAsHtml5) {
executor = static_cast<nsHtml5TreeOpExecutor*> (mParser->GetContentSink());
}
if (!IsHTML() || !docShell) { // no docshell for text/html XHR
charsetSource = IsHTML() ? kCharsetFromFallback
: kCharsetFromDocTypeDefault;
charset.AssignLiteral("UTF-8");
TryChannelCharset(aChannel, charsetSource, charset, executor);
parserCharsetSource = charsetSource;
parserCharset = charset;
} else {
NS_ASSERTION(docShell, "Unexpected null value");
charsetSource = kCharsetUninitialized;
wyciwygChannel = do_QueryInterface(aChannel);
// The following will try to get the character encoding from various
// sources. Each Try* function will return early if the source is already
// at least as large as any of the sources it might look at. Some of
// these functions (like TryHintCharset and TryParentCharset) can set
// charsetSource to various values depending on where the charset they
// end up finding originally comes from.
// Don't actually get the charset from the channel if this is a
// wyciwyg channel; it'll always be UTF-16
if (!wyciwygChannel) {
// Otherwise, try the channel's charset (e.g., charset from HTTP
// "Content-Type" header) first. This way, we get to reject overrides in
// TryParentCharset and TryUserForcedCharset if the channel said UTF-16.
// This is to avoid socially engineered XSS by adding user-supplied
// content to a UTF-16 site such that the byte have a dangerous
// interpretation as ASCII and the user can be lured to using the
// charset menu.
TryChannelCharset(aChannel, charsetSource, charset, executor);
}
TryUserForcedCharset(cv, docShell, charsetSource, charset);
TryHintCharset(cv, charsetSource, charset); // XXX mailnews-only
TryParentCharset(docShell, charsetSource, charset);
if (cachingChan && !urlSpec.IsEmpty()) {
TryCacheCharset(cachingChan, charsetSource, charset);
}
TryTLD(charsetSource, charset);
TryFallback(charsetSource, charset);
if (wyciwygChannel) {
// We know for sure that the parser needs to be using UTF16.
parserCharset = "UTF-16";
parserCharsetSource = charsetSource < kCharsetFromChannel ?
kCharsetFromChannel : charsetSource;
nsAutoCString cachedCharset;
int32_t cachedSource;
rv = wyciwygChannel->GetCharsetAndSource(&cachedSource, cachedCharset);
if (NS_SUCCEEDED(rv)) {
if (cachedSource > charsetSource) {
charsetSource = cachedSource;
charset = cachedCharset;
}
} else {
// Don't propagate this error.
rv = NS_OK;
}
} else {
parserCharset = charset;
parserCharsetSource = charsetSource;
}
}
SetDocumentCharacterSetSource(charsetSource);
SetDocumentCharacterSet(charset);
if (cachingChan) {
NS_ASSERTION(charset == parserCharset,
"How did those end up different here? wyciwyg channels are "
"not nsICachingChannel");
rv = cachingChan->SetCacheTokenCachedCharset(charset);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "cannot SetMetaDataElement");
rv = NS_OK; // don't propagate error
}
// Set the parser as the stream listener for the document loader...
rv = NS_OK;
nsCOMPtr<nsIStreamListener> listener = mParser->GetStreamListener();
listener.forget(aDocListener);
#ifdef DEBUG_charset
printf(" charset = %s source %d\n",
charset.get(), charsetSource);
#endif
mParser->SetDocumentCharset(parserCharset, parserCharsetSource);
mParser->SetCommand(aCommand);
if (!IsHTML()) {
MOZ_ASSERT(!loadAsHtml5);
nsCOMPtr<nsIXMLContentSink> xmlsink;
NS_NewXMLContentSink(getter_AddRefs(xmlsink), this, uri,
docShell, aChannel);
mParser->SetContentSink(xmlsink);
} else {
if (loadAsHtml5) {
nsHtml5Module::Initialize(mParser, this, uri, docShell, aChannel);
} else {
// about:blank *only*
nsCOMPtr<nsIHTMLContentSink> htmlsink;
NS_NewHTMLContentSink(getter_AddRefs(htmlsink), this, uri,
docShell, aChannel);
mParser->SetContentSink(htmlsink);
}
}
if (plainText && !nsContentUtils::IsChildOfSameType(this) &&
Preferences::GetBool("plain_text.wrap_long_lines")) {
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
NS_ASSERTION(NS_SUCCEEDED(rv) && bundleService, "The bundle service could not be loaded");
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://global/locale/browser.properties",
getter_AddRefs(bundle));
NS_ASSERTION(NS_SUCCEEDED(rv) && bundle, "chrome://global/locale/browser.properties could not be loaded");
nsXPIDLString title;
if (bundle) {
bundle->GetStringFromName(MOZ_UTF16("plainText.wordWrap"), getter_Copies(title));
}
SetSelectedStyleSheetSet(title);
}
// parser the content of the URI
mParser->Parse(uri, nullptr, (void *)this);
return rv;
}
void
nsHTMLDocument::StopDocumentLoad()
{
BlockOnload();
// Remove the wyciwyg channel request from the document load group
// that we added in Open() if Open() was called on this doc.
RemoveWyciwygChannel();
NS_ASSERTION(!mWyciwygChannel, "nsHTMLDocument::StopDocumentLoad(): "
"nsIWyciwygChannel could not be removed!");
nsDocument::StopDocumentLoad();
UnblockOnload(false);
return;
}
void
nsHTMLDocument::BeginLoad()
{
if (IsEditingOn()) {
// Reset() blows away all event listeners in the document, and our
// editor relies heavily on those. Midas is turned on, to make it
// work, re-initialize it to give it a chance to add its event
// listeners again.
TurnEditingOff();
EditingStateChanged();
}
nsDocument::BeginLoad();
}
void
nsHTMLDocument::EndLoad()
{
bool turnOnEditing =
mParser && (HasFlag(NODE_IS_EDITABLE) || mContentEditableCount > 0);
// Note: nsDocument::EndLoad nulls out mParser.
nsDocument::EndLoad();
if (turnOnEditing) {
EditingStateChanged();
}
}
void
nsHTMLDocument::SetCompatibilityMode(nsCompatibility aMode)
{
NS_ASSERTION(IsHTML() || aMode == eCompatibility_FullStandards,
"Bad compat mode for XHTML document!");
mCompatMode = aMode;
CSSLoader()->SetCompatibilityMode(mCompatMode);
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
nsPresContext *pc = shell->GetPresContext();
if (pc) {
pc->CompatibilityModeChanged();
}
}
}
//
// nsIDOMHTMLDocument interface implementation
//
already_AddRefed<nsIURI>
nsHTMLDocument::GetDomainURI()
{
nsIPrincipal* principal = NodePrincipal();
nsCOMPtr<nsIURI> uri;
principal->GetDomain(getter_AddRefs(uri));
if (uri) {
return uri.forget();
}
principal->GetURI(getter_AddRefs(uri));
return uri.forget();
}
NS_IMETHODIMP
nsHTMLDocument::GetDomain(nsAString& aDomain)
{
ErrorResult rv;
GetDomain(aDomain, rv);
return rv.ErrorCode();
}
void
nsHTMLDocument::GetDomain(nsAString& aDomain, ErrorResult& rv)
{
nsCOMPtr<nsIURI> uri = GetDomainURI();
if (!uri) {
rv.Throw(NS_ERROR_FAILURE);
return;
}
nsAutoCString hostName;
if (NS_SUCCEEDED(uri->GetHost(hostName))) {
CopyUTF8toUTF16(hostName, aDomain);
} else {
// If we can't get the host from the URI (e.g. about:, javascript:,
// etc), just return an null string.
SetDOMStringToNull(aDomain);
}
}
NS_IMETHODIMP
nsHTMLDocument::SetDomain(const nsAString& aDomain)
{
ErrorResult rv;
SetDomain(aDomain, rv);
return rv.ErrorCode();
}
void
nsHTMLDocument::SetDomain(const nsAString& aDomain, ErrorResult& rv)
{
if (mSandboxFlags & SANDBOXED_DOMAIN) {
// We're sandboxed; disallow setting domain
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
if (aDomain.IsEmpty()) {
rv.Throw(NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN);
return;
}
// Create new URI
nsCOMPtr<nsIURI> uri = GetDomainURI();
if (!uri) {
rv.Throw(NS_ERROR_FAILURE);
return;
}
nsAutoCString newURIString;
if (NS_FAILED(uri->GetScheme(newURIString))) {
rv.Throw(NS_ERROR_FAILURE);
return;
}
nsAutoCString path;
if (NS_FAILED(uri->GetPath(path))) {
rv.Throw(NS_ERROR_FAILURE);
return;
}
newURIString.AppendLiteral("://");
AppendUTF16toUTF8(aDomain, newURIString);
newURIString.Append(path);
nsCOMPtr<nsIURI> newURI;
if (NS_FAILED(NS_NewURI(getter_AddRefs(newURI), newURIString))) {
rv.Throw(NS_ERROR_FAILURE);
return;
}
// Check new domain - must be a superdomain of the current host
// For example, a page from foo.bar.com may set domain to bar.com,
// but not to ar.com, baz.com, or fi.foo.bar.com.
nsAutoCString current, domain;
if (NS_FAILED(uri->GetAsciiHost(current)))
current.Truncate();
if (NS_FAILED(newURI->GetAsciiHost(domain)))
domain.Truncate();
bool ok = current.Equals(domain);
if (current.Length() > domain.Length() &&
StringEndsWith(current, domain) &&
current.CharAt(current.Length() - domain.Length() - 1) == '.') {
// We're golden if the new domain is the current page's base domain or a
// subdomain of it.
nsCOMPtr<nsIEffectiveTLDService> tldService =
do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
if (!tldService) {
rv.Throw(NS_ERROR_NOT_AVAILABLE);
return;
}
nsAutoCString currentBaseDomain;
ok = NS_SUCCEEDED(tldService->GetBaseDomain(uri, 0, currentBaseDomain));
NS_ASSERTION(StringEndsWith(domain, currentBaseDomain) ==
(domain.Length() >= currentBaseDomain.Length()),
"uh-oh! slight optimization wasn't valid somehow!");
ok = ok && domain.Length() >= currentBaseDomain.Length();
}
if (!ok) {
// Error: illegal domain
rv.Throw(NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN);
return;
}
rv = NodePrincipal()->SetDomain(newURI);
}
nsGenericHTMLElement*
nsHTMLDocument::GetBody()
{
Element* html = GetHtmlElement();
if (!html) {
return nullptr;
}
for (nsIContent* child = html->GetFirstChild();
child;
child = child->GetNextSibling()) {
if (child->IsHTML(nsGkAtoms::body) || child->IsHTML(nsGkAtoms::frameset)) {
return static_cast<nsGenericHTMLElement*>(child);
}
}
return nullptr;
}
NS_IMETHODIMP
nsHTMLDocument::GetBody(nsIDOMHTMLElement** aBody)
{
*aBody = nullptr;
nsIContent *body = GetBody();
return body ? CallQueryInterface(body, aBody) : NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
{
nsCOMPtr<nsIContent> newBody = do_QueryInterface(aBody);
MOZ_ASSERT(!newBody || newBody->IsHTML(),
"How could we be an nsIContent but not actually HTML here?");
ErrorResult rv;
SetBody(static_cast<nsGenericHTMLElement*>(newBody.get()), rv);
return rv.ErrorCode();
}
void
nsHTMLDocument::SetBody(nsGenericHTMLElement* newBody, ErrorResult& rv)
{
Element* root = GetRootElement();
// The body element must be either a body tag or a frameset tag. And we must
// have a html root tag, otherwise GetBody will not return the newly set
// body.
if (!newBody || !(newBody->Tag() == nsGkAtoms::body ||
newBody->Tag() == nsGkAtoms::frameset) ||
!root || !root->IsHTML() ||
root->Tag() != nsGkAtoms::html) {
rv.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
return;
}
// Use DOM methods so that we pass through the appropriate security checks.
nsCOMPtr<Element> currentBody = GetBodyElement();
if (currentBody) {
root->ReplaceChild(*newBody, *currentBody, rv);
} else {
root->AppendChild(*newBody, rv);
}
}
NS_IMETHODIMP
nsHTMLDocument::GetHead(nsIDOMHTMLHeadElement** aHead)
{
*aHead = nullptr;
Element* head = GetHeadElement();
return head ? CallQueryInterface(head, aHead) : NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::GetImages(nsIDOMHTMLCollection** aImages)
{
NS_ADDREF(*aImages = Images());
return NS_OK;
}
nsIHTMLCollection*
nsHTMLDocument::Images()
{
if (!mImages) {
mImages = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::img, nsGkAtoms::img);
}
return mImages;
}
NS_IMETHODIMP
nsHTMLDocument::GetApplets(nsIDOMHTMLCollection** aApplets)
{
NS_ADDREF(*aApplets = Applets());
return NS_OK;
}
nsIHTMLCollection*
nsHTMLDocument::Applets()
{
if (!mApplets) {
mApplets = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::applet, nsGkAtoms::applet);
}
return mApplets;
}
bool
nsHTMLDocument::MatchLinks(nsIContent *aContent, int32_t aNamespaceID,
nsIAtom* aAtom, void* aData)
{
nsIDocument* doc = aContent->GetUncomposedDoc();
if (doc) {
NS_ASSERTION(aContent->IsInDoc(),
"This method should never be called on content nodes that "
"are not in a document!");
#ifdef DEBUG
{
nsCOMPtr<nsIHTMLDocument> htmldoc =
do_QueryInterface(aContent->GetUncomposedDoc());
NS_ASSERTION(htmldoc,
"Huh, how did this happen? This should only be used with "
"HTML documents!");
}
#endif
mozilla::dom::NodeInfo *ni = aContent->NodeInfo();
nsIAtom *localName = ni->NameAtom();
if (ni->NamespaceID() == kNameSpaceID_XHTML &&
(localName == nsGkAtoms::a || localName == nsGkAtoms::area)) {
return aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::href);
}
}
return false;
}
NS_IMETHODIMP
nsHTMLDocument::GetLinks(nsIDOMHTMLCollection** aLinks)
{
NS_ADDREF(*aLinks = Links());
return NS_OK;
}
nsIHTMLCollection*
nsHTMLDocument::Links()
{
if (!mLinks) {
mLinks = new nsContentList(this, MatchLinks, nullptr, nullptr);
}
return mLinks;
}
bool
nsHTMLDocument::MatchAnchors(nsIContent *aContent, int32_t aNamespaceID,
nsIAtom* aAtom, void* aData)
{
NS_ASSERTION(aContent->IsInDoc(),
"This method should never be called on content nodes that "
"are not in a document!");
#ifdef DEBUG
{
nsCOMPtr<nsIHTMLDocument> htmldoc =
do_QueryInterface(aContent->GetUncomposedDoc());
NS_ASSERTION(htmldoc,
"Huh, how did this happen? This should only be used with "
"HTML documents!");
}
#endif
if (aContent->NodeInfo()->Equals(nsGkAtoms::a, kNameSpaceID_XHTML)) {
return aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::name);
}
return false;
}
NS_IMETHODIMP
nsHTMLDocument::GetAnchors(nsIDOMHTMLCollection** aAnchors)
{
NS_ADDREF(*aAnchors = Anchors());
return NS_OK;
}
nsIHTMLCollection*
nsHTMLDocument::Anchors()
{
if (!mAnchors) {
mAnchors = new nsContentList(this, MatchAnchors, nullptr, nullptr);
}
return mAnchors;
}
NS_IMETHODIMP
nsHTMLDocument::GetScripts(nsIDOMHTMLCollection** aScripts)
{
NS_ADDREF(*aScripts = Scripts());
return NS_OK;
}
nsIHTMLCollection*
nsHTMLDocument::Scripts()
{
if (!mScripts) {
mScripts = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::script, nsGkAtoms::script);
}
return mScripts;
}
NS_IMETHODIMP
nsHTMLDocument::GetCookie(nsAString& aCookie)
{
ErrorResult rv;
GetCookie(aCookie, rv);
return rv.ErrorCode();
}
void
nsHTMLDocument::GetCookie(nsAString& aCookie, ErrorResult& rv)
{
aCookie.Truncate(); // clear current cookie in case service fails;
// no cookie isn't an error condition.
if (mDisableCookieAccess) {
return;
}
// If the document's sandboxed origin flag is set, access to read cookies
// is prohibited.
if (mSandboxFlags & SANDBOXED_ORIGIN) {
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
// not having a cookie service isn't an error
nsCOMPtr<nsICookieService> service = do_GetService(NS_COOKIESERVICE_CONTRACTID);
if (service) {
// Get a URI from the document principal. We use the original
// codebase in case the codebase was changed by SetDomain
nsCOMPtr<nsIURI> codebaseURI;
NodePrincipal()->GetURI(getter_AddRefs(codebaseURI));
if (!codebaseURI) {
// Document's principal is not a codebase (may be system), so
// can't set cookies
return;
}
nsXPIDLCString cookie;
service->GetCookieString(codebaseURI, mChannel, getter_Copies(cookie));
// CopyUTF8toUTF16 doesn't handle error
// because it assumes that the input is valid.
nsContentUtils::ConvertStringFromEncoding(NS_LITERAL_CSTRING("UTF-8"),
cookie, aCookie);
}
}
NS_IMETHODIMP
nsHTMLDocument::SetCookie(const nsAString& aCookie)
{
ErrorResult rv;
SetCookie(aCookie, rv);
return rv.ErrorCode();
}
void
nsHTMLDocument::SetCookie(const nsAString& aCookie, ErrorResult& rv)
{
if (mDisableCookieAccess) {
return;
}
// If the document's sandboxed origin flag is set, access to write cookies
// is prohibited.
if (mSandboxFlags & SANDBOXED_ORIGIN) {
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
// not having a cookie service isn't an error
nsCOMPtr<nsICookieService> service = do_GetService(NS_COOKIESERVICE_CONTRACTID);
if (service && mDocumentURI) {
// The for getting the URI matches nsNavigator::GetCookieEnabled
nsCOMPtr<nsIURI> codebaseURI;
NodePrincipal()->GetURI(getter_AddRefs(codebaseURI));
if (!codebaseURI) {
// Document's principal is not a codebase (may be system), so
// can't set cookies
return;
}
NS_ConvertUTF16toUTF8 cookie(aCookie);
service->SetCookieString(codebaseURI, nullptr, cookie.get(), mChannel);
}
}
NS_IMETHODIMP
nsHTMLDocument::Open(const nsAString& aContentTypeOrUrl,
const nsAString& aReplaceOrName,
const nsAString& aFeatures,
JSContext* cx, uint8_t aOptionalArgCount,
nsISupports** aReturn)
{
// When called with 3 or more arguments, document.open() calls window.open().
if (aOptionalArgCount > 2) {
ErrorResult rv;
*aReturn = Open(cx, aContentTypeOrUrl, aReplaceOrName, aFeatures,
false, rv).take();
return rv.ErrorCode();
}
nsString type;
if (aOptionalArgCount > 0) {
type = aContentTypeOrUrl;
} else {
type.AssignLiteral("text/html");
}
nsString replace;
if (aOptionalArgCount > 1) {
replace = aReplaceOrName;
}
ErrorResult rv;
*aReturn = Open(cx, type, replace, rv).take();
return rv.ErrorCode();
}
already_AddRefed<nsIDOMWindow>
nsHTMLDocument::Open(JSContext* /* unused */,
const nsAString& aURL,
const nsAString& aName,
const nsAString& aFeatures,
bool aReplace,
ErrorResult& rv)
{
NS_ASSERTION(nsContentUtils::CanCallerAccess(static_cast<nsIDOMHTMLDocument*>(this)),
"XOW should have caught this!");
nsCOMPtr<nsIDOMWindow> window = GetInnerWindow();
if (!window) {
rv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
return nullptr;
}
nsCOMPtr<nsIDOMJSWindow> win = do_QueryInterface(window);
nsCOMPtr<nsIDOMWindow> newWindow;
// XXXbz We ignore aReplace for now.
rv = win->OpenJS(aURL, aName, aFeatures, getter_AddRefs(newWindow));
return newWindow.forget();
}
already_AddRefed<nsIDocument>
nsHTMLDocument::Open(JSContext* cx,
const nsAString& aType,
const nsAString& aReplace,
ErrorResult& rv)
{
NS_ASSERTION(nsContentUtils::CanCallerAccess(static_cast<nsIDOMHTMLDocument*>(this)),
"XOW should have caught this!");
if (!IsHTML() || mDisableDocWrite || !IsMasterDocument()) {
// No calling document.open() on XHTML
rv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
nsAutoCString contentType;
contentType.AssignLiteral("text/html");
nsAutoString type;
nsContentUtils::ASCIIToLower(aType, type);
nsAutoCString actualType, dummy;
NS_ParseContentType(NS_ConvertUTF16toUTF8(type), actualType, dummy);
if (!actualType.EqualsLiteral("text/html") &&
!type.EqualsLiteral("replace")) {
contentType.AssignLiteral("text/plain");
}
// If we already have a parser we ignore the document.open call.
if (mParser || mParserAborted) {
// The WHATWG spec says: "If the document has an active parser that isn't
// a script-created parser, and the insertion point associated with that
// parser's input stream is not undefined (that is, it does point to
// somewhere in the input stream), then the method does nothing. Abort
// these steps and return the Document object on which the method was
// invoked."
// Note that aborting a parser leaves the parser "active" with its
// insertion point "not undefined". We track this using mParserAborted,
// because aborting a parser nulls out mParser.
nsCOMPtr<nsIDocument> ret = this;
return ret.forget();
}
// No calling document.open() without a script global object
if (!mScriptGlobalObject) {
nsCOMPtr<nsIDocument> ret = this;
return ret.forget();
}
nsPIDOMWindow* outer = GetWindow();
if (!outer || (GetInnerWindow() != outer->GetCurrentInnerWindow())) {
nsCOMPtr<nsIDocument> ret = this;
return ret.forget();
}
// check whether we're in the middle of unload. If so, ignore this call.
nsCOMPtr<nsIDocShell> shell(mDocumentContainer);
if (!shell) {
// We won't be able to create a parser anyway.
nsCOMPtr<nsIDocument> ret = this;
return ret.forget();
}
bool inUnload;
shell->GetIsInUnload(&inUnload);
if (inUnload) {
nsCOMPtr<nsIDocument> ret = this;
return ret.forget();
}
// Note: We want to use GetEntryDocument here because this document
// should inherit the security information of the document that's opening us,
// (since if it's secure, then it's presumably trusted).
nsCOMPtr<nsIDocument> callerDoc = GetEntryDocument();
if (!callerDoc) {
// If we're called from C++ or in some other way without an originating
// document we can't do a document.open w/o changing the principal of the
// document to something like about:blank (as that's the only sane thing to
// do when we don't know the origin of this call), and since we can't
// change the principals of a document for security reasons we'll have to
// refuse to go ahead with this call.
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
// Grab a reference to the calling documents security info (if any)
// and URIs as they may be lost in the call to Reset().
nsCOMPtr<nsISupports> securityInfo = callerDoc->GetSecurityInfo();
nsCOMPtr<nsIURI> uri = callerDoc->GetDocumentURI();
nsCOMPtr<nsIURI> baseURI = callerDoc->GetBaseURI();
nsCOMPtr<nsIPrincipal> callerPrincipal = callerDoc->NodePrincipal();
nsCOMPtr<nsIChannel> callerChannel = callerDoc->GetChannel();
// We're called from script. Make sure the script is from the same
// origin, not just that the caller can access the document. This is
// needed to keep document principals from ever changing, which is
// needed because of the way we use our XOW code, and is a sane
// thing to do anyways.
bool equals = false;
if (NS_FAILED(callerPrincipal->Equals(NodePrincipal(), &equals)) ||
!equals) {
#ifdef DEBUG
nsCOMPtr<nsIURI> callerDocURI = callerDoc->GetDocumentURI();
nsCOMPtr<nsIURI> thisURI = nsIDocument::GetDocumentURI();
nsAutoCString callerSpec;
nsAutoCString thisSpec;
if (callerDocURI) {
callerDocURI->GetSpec(callerSpec);
}
if (thisURI) {
thisURI->GetSpec(thisSpec);
}
printf("nsHTMLDocument::Open callerDoc %s this %s\n", callerSpec.get(), thisSpec.get());
#endif
rv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
// Stop current loads targeted at the window this document is in.
if (mScriptGlobalObject) {
nsCOMPtr<nsIContentViewer> cv;
shell->GetContentViewer(getter_AddRefs(cv));
if (cv) {
bool okToUnload;
if (NS_SUCCEEDED(cv->PermitUnload(false, &okToUnload)) && !okToUnload) {
// We don't want to unload, so stop here, but don't throw an
// exception.
nsCOMPtr<nsIDocument> ret = this;
return ret.forget();
}
}
nsCOMPtr<nsIWebNavigation> webnav(do_QueryInterface(shell));
webnav->Stop(nsIWebNavigation::STOP_NETWORK);
// The Stop call may have cancelled the onload blocker request or prevented
// it from getting added, so we need to make sure it gets added to the
// document again otherwise the document could have a non-zero onload block
// count without the onload blocker request being in the loadgroup.
EnsureOnloadBlocker();
}
// The open occurred after the document finished loading.
// So we reset the document and create a new one.
nsCOMPtr<nsIChannel> channel;
nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
rv = NS_NewChannel(getter_AddRefs(channel),
uri,
callerDoc,
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
nsIContentPolicy::TYPE_OTHER,
group);
if (rv.Failed()) {
return nullptr;
}
// We can't depend on channels implementing property bags, so do our
// base URI manually after reset.
if (rv.Failed()) {
return nullptr;
}
if (callerChannel) {
nsLoadFlags callerLoadFlags;
rv = callerChannel->GetLoadFlags(&callerLoadFlags);
if (rv.Failed()) {
return nullptr;
}
nsLoadFlags loadFlags;
rv = channel->GetLoadFlags(&loadFlags);
if (rv.Failed()) {
return nullptr;
}
loadFlags |= callerLoadFlags & nsIRequest::INHIBIT_PERSISTENT_CACHING;
rv = channel->SetLoadFlags(loadFlags);
if (rv.Failed()) {
return nullptr;
}
// If the user has allowed mixed content on the rootDoc, then we should propogate it
// down to the new document channel.
bool rootHasSecureConnection = false;
bool allowMixedContent = false;
bool isDocShellRoot = false;
nsresult rvalue = shell->GetAllowMixedContentAndConnectionData(&rootHasSecureConnection, &allowMixedContent, &isDocShellRoot);
if (NS_SUCCEEDED(rvalue) && allowMixedContent && isDocShellRoot) {
shell->SetMixedContentChannel(channel);
}
}
// Before we reset the doc notify the globalwindow of the change,
// but only if we still have a window (i.e. our window object the
// current inner window in our outer window).
// Hold onto ourselves on the offchance that we're down to one ref
nsCOMPtr<nsIDocument> kungFuDeathGrip = this;
nsPIDOMWindow *window = GetInnerWindow();
if (window) {
// Remember the old scope in case the call to SetNewDocument changes it.
nsCOMPtr<nsIScriptGlobalObject> oldScope(do_QueryReferent(mScopeObject));
#ifdef DEBUG
bool willReparent = mWillReparent;
mWillReparent = true;
nsDocument* templateContentsOwner =
static_cast<nsDocument*>(mTemplateContentsOwner.get());
if (templateContentsOwner) {
templateContentsOwner->mWillReparent = true;
}
#endif
// Should this pass true for aForceReuseInnerWindow?
rv = window->SetNewDocument(this, nullptr, false);
if (rv.Failed()) {
return nullptr;
}
#ifdef DEBUG
if (templateContentsOwner) {
templateContentsOwner->mWillReparent = willReparent;
}
mWillReparent = willReparent;
#endif
// Now make sure we're not flagged as the initial document anymore, now
// that we've had stuff done to us. From now on, if anyone tries to
// document.open() us, they get a new inner window.
SetIsInitialDocument(false);
nsCOMPtr<nsIScriptGlobalObject> newScope(do_QueryReferent(mScopeObject));
JS::Rooted<JSObject*> wrapper(cx, GetWrapper());
if (oldScope && newScope != oldScope && wrapper) {
JSAutoCompartment ac(cx, wrapper);
rv = mozilla::dom::ReparentWrapper(cx, wrapper);
if (rv.Failed()) {
return nullptr;
}
// Also reparent the template contents owner document
// because its global is set to the same as this document.
if (mTemplateContentsOwner) {
JS::Rooted<JSObject*> contentsOwnerWrapper(cx,
mTemplateContentsOwner->GetWrapper());
if (contentsOwnerWrapper) {
rv = mozilla::dom::ReparentWrapper(cx, contentsOwnerWrapper);
if (rv.Failed()) {
return nullptr;
}
}
}
nsIXPConnect *xpc = nsContentUtils::XPConnect();
rv = xpc->RescueOrphansInScope(cx, oldScope->GetGlobalJSObject());
if (rv.Failed()) {
return nullptr;
}
}
}
mDidDocumentOpen = true;
// Call Reset(), this will now do the full reset
Reset(channel, group);
if (baseURI) {
mDocumentBaseURI = baseURI;
}
// Store the security info of the caller now that we're done
// resetting the document.
mSecurityInfo = securityInfo;
mParserAborted = false;
mParser = nsHtml5Module::NewHtml5Parser();
nsHtml5Module::Initialize(mParser, this, uri, shell, channel);
// This will be propagated to the parser when someone actually calls write()
SetContentTypeInternal(contentType);
// Prepare the docshell and the document viewer for the impending
// out of band document.write()
shell->PrepareForNewContentModel();
// Now check whether we were opened with a "replace" argument. If
// so, we need to tell the docshell to not create a new history
// entry for this load. Otherwise, make sure that we're doing a normal load,
// not whatever type of load was previously done on this docshell.
shell->SetLoadType(aReplace.LowerCaseEqualsLiteral("replace") ?
LOAD_NORMAL_REPLACE : LOAD_NORMAL);
nsCOMPtr<nsIContentViewer> cv;
shell->GetContentViewer(getter_AddRefs(cv));
if (cv) {
cv->LoadStart(this);
}
// Add a wyciwyg channel request into the document load group
NS_ASSERTION(!mWyciwygChannel, "nsHTMLDocument::Open(): wyciwyg "
"channel already exists!");
// In case the editor is listening and will see the new channel
// being added, make sure mWriteLevel is non-zero so that the editor
// knows that document.open/write/close() is being called on this
// document.
++mWriteLevel;
CreateAndAddWyciwygChannel();
--mWriteLevel;
SetReadyStateInternal(nsIDocument::READYSTATE_LOADING);
// After changing everything around, make sure that the principal on the
// document's compartment exactly matches NodePrincipal().
DebugOnly<JSObject*> wrapper = GetWrapperPreserveColor();
MOZ_ASSERT_IF(wrapper,
JS_GetCompartmentPrincipals(js::GetObjectCompartment(wrapper)) ==
nsJSPrincipals::get(NodePrincipal()));
return kungFuDeathGrip.forget();
}
NS_IMETHODIMP
nsHTMLDocument::Clear()
{
// This method has been deprecated
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::Close()
{
ErrorResult rv;
Close(rv);
return rv.ErrorCode();
}
void
nsHTMLDocument::Close(ErrorResult& rv)
{
if (!IsHTML()) {
// No calling document.close() on XHTML!
rv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (!mParser || !mParser->IsScriptCreated()) {
return;
}
++mWriteLevel;
rv = (static_cast<nsHtml5Parser*>(mParser.get()))->Parse(
EmptyString(), nullptr, GetContentTypeInternal(), true);
--mWriteLevel;
// Even if that Parse() call failed, do the rest of this method
// XXX Make sure that all the document.written content is
// reflowed. We should remove this call once we change
// nsHTMLDocument::OpenCommon() so that it completely destroys the
// earlier document's content and frame hierarchy. Right now, it
// re-uses the earlier document's root content object and
// corresponding frame objects. These re-used frame objects think
// that they have already been reflowed, so they drop initial
// reflows. For certain cases of document.written content, like a
// frameset document, the dropping of the initial reflow means
// that we end up in document.close() without appended any reflow
// commands to the reflow queue and, consequently, without adding
// the dummy layout request to the load group. Since the dummy
// layout request is not added to the load group, the onload
// handler of the frameset fires before the frames get reflowed
// and loaded. That is the long explanation for why we need this
// one line of code here!
// XXXbz as far as I can tell this may not be needed anymore; all
// the testcases in bug 57636 pass without this line... Leaving
// it be for now, though. In any case, there's no reason to do
// this if we have no presshell, since in that case none of the
// above about reusing frames applies.
//
// XXXhsivonen keeping this around for bug 577508 / 253951 still :-(
if (GetShell()) {
FlushPendingNotifications(Flush_Layout);
}
// Removing the wyciwygChannel here is wrong when document.close() is
// called from within the document itself. However, legacy requires the
// channel to be removed here. Otherwise, the load event never fires.
NS_ASSERTION(mWyciwygChannel, "nsHTMLDocument::Close(): Trying to remove "
"nonexistent wyciwyg channel!");
RemoveWyciwygChannel();
NS_ASSERTION(!mWyciwygChannel, "nsHTMLDocument::Close(): "
"nsIWyciwygChannel could not be removed!");
}
void
nsHTMLDocument::WriteCommon(JSContext *cx,
const Sequence<nsString>& aText,
bool aNewlineTerminate,
mozilla::ErrorResult& rv)
{
// Fast path the common case
if (aText.Length() == 1) {
rv = WriteCommon(cx, aText[0], aNewlineTerminate);
} else {
// XXXbz it would be nice if we could pass all the strings to the parser
// without having to do all this copying and then ask it to start
// parsing....
nsString text;
for (uint32_t i = 0; i < aText.Length(); ++i) {
text.Append(aText[i]);
}
rv = WriteCommon(cx, text, aNewlineTerminate);
}
}
nsresult
nsHTMLDocument::WriteCommon(JSContext *cx,
const nsAString& aText,
bool aNewlineTerminate)
{
mTooDeepWriteRecursion =
(mWriteLevel > NS_MAX_DOCUMENT_WRITE_DEPTH || mTooDeepWriteRecursion);
NS_ENSURE_STATE(!mTooDeepWriteRecursion);
if (!IsHTML() || mDisableDocWrite || !IsMasterDocument()) {
// No calling document.write*() on XHTML!
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
if (mParserAborted) {
// Hixie says aborting the parser doesn't undefine the insertion point.
// However, since we null out mParser in that case, we track the
// theoretically defined insertion point using mParserAborted.
return NS_OK;
}
nsresult rv = NS_OK;
void *key = GenerateParserKey();
if (mParser && !mParser->IsInsertionPointDefined()) {
if (mExternalScriptsBeingEvaluated) {
// Instead of implying a call to document.open(), ignore the call.
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM Events"), this,
nsContentUtils::eDOM_PROPERTIES,
"DocumentWriteIgnored",
nullptr, 0,
mDocumentURI);
return NS_OK;
}
mParser->Terminate();
NS_ASSERTION(!mParser, "mParser should have been null'd out");
}
if (!mParser) {
if (mExternalScriptsBeingEvaluated) {
// Instead of implying a call to document.open(), ignore the call.
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM Events"), this,
nsContentUtils::eDOM_PROPERTIES,
"DocumentWriteIgnored",
nullptr, 0,
mDocumentURI);
return NS_OK;
}
nsCOMPtr<nsISupports> ignored;
rv = Open(NS_LITERAL_STRING("text/html"), EmptyString(), EmptyString(), cx,
1, getter_AddRefs(ignored));
// If Open() fails, or if it didn't create a parser (as it won't
// if the user chose to not discard the current document through
// onbeforeunload), don't write anything.
if (NS_FAILED(rv) || !mParser) {
return rv;
}
NS_ABORT_IF_FALSE(!JS_IsExceptionPending(cx),
"Open() succeeded but JS exception is pending");
}
static NS_NAMED_LITERAL_STRING(new_line, "\n");
// Save the data in cache if the write isn't from within the doc
if (mWyciwygChannel && !key) {
if (!aText.IsEmpty()) {
mWyciwygChannel->WriteToCacheEntry(aText);
}
if (aNewlineTerminate) {
mWyciwygChannel->WriteToCacheEntry(new_line);
}
}
++mWriteLevel;
// This could be done with less code, but for performance reasons it
// makes sense to have the code for two separate Parse() calls here
// since the concatenation of strings costs more than we like. And
// why pay that price when we don't need to?
if (aNewlineTerminate) {
rv = (static_cast<nsHtml5Parser*>(mParser.get()))->Parse(
aText + new_line, key, GetContentTypeInternal(), false);
} else {
rv = (static_cast<nsHtml5Parser*>(mParser.get()))->Parse(
aText, key, GetContentTypeInternal(), false);
}
--mWriteLevel;
mTooDeepWriteRecursion = (mWriteLevel != 0 && mTooDeepWriteRecursion);
return rv;
}
NS_IMETHODIMP
nsHTMLDocument::Write(const nsAString& aText, JSContext *cx)
{
return WriteCommon(cx, aText, false);
}
void
nsHTMLDocument::Write(JSContext* cx, const Sequence<nsString>& aText,
ErrorResult& rv)
{
WriteCommon(cx, aText, false, rv);
}
NS_IMETHODIMP
nsHTMLDocument::Writeln(const nsAString& aText, JSContext *cx)
{
return WriteCommon(cx, aText, true);
}
void
nsHTMLDocument::Writeln(JSContext* cx, const Sequence<nsString>& aText,
ErrorResult& rv)
{
WriteCommon(cx, aText, true, rv);
}
bool
nsHTMLDocument::MatchNameAttribute(nsIContent* aContent, int32_t aNamespaceID,
nsIAtom* aAtom, void* aData)
{
NS_PRECONDITION(aContent, "Must have content node to work with!");
nsString* elementName = static_cast<nsString*>(aData);
return
aContent->GetNameSpaceID() == kNameSpaceID_XHTML &&
aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
*elementName, eCaseMatters);
}
/* static */
void*
nsHTMLDocument::UseExistingNameString(nsINode* aRootNode, const nsString* aName)
{
return const_cast<nsString*>(aName);
}
NS_IMETHODIMP
nsHTMLDocument::GetElementsByName(const nsAString& aElementName,
nsIDOMNodeList** aReturn)
{
*aReturn = GetElementsByName(aElementName).take();
return NS_OK;
}
static bool MatchItems(nsIContent* aContent, int32_t aNameSpaceID,
nsIAtom* aAtom, void* aData)
{
if (!(aContent->IsElement() && aContent->AsElement()->IsHTML())) {
return false;
}
nsGenericHTMLElement* elem = static_cast<nsGenericHTMLElement*>(aContent);
if (!elem->HasAttr(kNameSpaceID_None, nsGkAtoms::itemscope) ||
elem->HasAttr(kNameSpaceID_None, nsGkAtoms::itemprop)) {
return false;
}
nsTArray<nsCOMPtr<nsIAtom> >* tokens = static_cast<nsTArray<nsCOMPtr<nsIAtom> >*>(aData);
if (tokens->IsEmpty()) {
return true;
}
const nsAttrValue* attr = elem->GetParsedAttr(nsGkAtoms::itemtype);
if (!attr)
return false;
for (uint32_t i = 0; i < tokens->Length(); i++) {
if (!attr->Contains(tokens->ElementAt(i), eCaseMatters)) {
return false;
}
}
return true;
}
static void DestroyTokens(void* aData)
{
nsTArray<nsCOMPtr<nsIAtom> >* tokens = static_cast<nsTArray<nsCOMPtr<nsIAtom> >*>(aData);
delete tokens;
}
static void* CreateTokens(nsINode* aRootNode, const nsString* types)
{
nsTArray<nsCOMPtr<nsIAtom> >* tokens = new nsTArray<nsCOMPtr<nsIAtom> >();
nsAString::const_iterator iter, end;
types->BeginReading(iter);
types->EndReading(end);
// skip initial whitespace
while (iter != end && nsContentUtils::IsHTMLWhitespace(*iter)) {
++iter;
}
// parse the tokens
while (iter != end) {
nsAString::const_iterator start(iter);
do {
++iter;
} while (iter != end && !nsContentUtils::IsHTMLWhitespace(*iter));
tokens->AppendElement(do_GetAtom(Substring(start, iter)));
// skip whitespace
while (iter != end && nsContentUtils::IsHTMLWhitespace(*iter)) {
++iter;
}
}
return tokens;
}
NS_IMETHODIMP
nsHTMLDocument::GetItems(const nsAString& types, nsIDOMNodeList** aReturn)
{
*aReturn = GetItems(types).take();
return NS_OK;
}
already_AddRefed<nsINodeList>
nsHTMLDocument::GetItems(const nsAString& aTypeNames)
{
return NS_GetFuncStringNodeList(this, MatchItems, DestroyTokens, CreateTokens,
aTypeNames);
}
void
nsHTMLDocument::AddedForm()
{
++mNumForms;
}
void
nsHTMLDocument::RemovedForm()
{
--mNumForms;
}
int32_t
nsHTMLDocument::GetNumFormsSynchronous()
{
return mNumForms;
}
NS_IMETHODIMP
nsHTMLDocument::GetAlinkColor(nsAString& aAlinkColor)
{
aAlinkColor.Truncate();
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->GetALink(aAlinkColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::SetAlinkColor(const nsAString& aAlinkColor)
{
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->SetALink(aAlinkColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::GetLinkColor(nsAString& aLinkColor)
{
aLinkColor.Truncate();
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->GetLink(aLinkColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::SetLinkColor(const nsAString& aLinkColor)
{
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->SetLink(aLinkColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::GetVlinkColor(nsAString& aVlinkColor)
{
aVlinkColor.Truncate();
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->GetVLink(aVlinkColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::SetVlinkColor(const nsAString& aVlinkColor)
{
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->SetVLink(aVlinkColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::GetBgColor(nsAString& aBgColor)
{
aBgColor.Truncate();
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->GetBgColor(aBgColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::SetBgColor(const nsAString& aBgColor)
{
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->SetBgColor(aBgColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::GetFgColor(nsAString& aFgColor)
{
aFgColor.Truncate();
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->GetText(aFgColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::SetFgColor(const nsAString& aFgColor)
{
HTMLBodyElement* body = GetBodyElement();
if (body) {
body->SetText(aFgColor);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::GetEmbeds(nsIDOMHTMLCollection** aEmbeds)
{
NS_ADDREF(*aEmbeds = Embeds());
return NS_OK;
}
nsIHTMLCollection*
nsHTMLDocument::Embeds()
{
if (!mEmbeds) {
mEmbeds = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::embed, nsGkAtoms::embed);
}
return mEmbeds;
}
NS_IMETHODIMP
nsHTMLDocument::GetSelection(nsISelection** aReturn)
{
ErrorResult rv;
NS_IF_ADDREF(*aReturn = GetSelection(rv));
return rv.ErrorCode();
}
Selection*
nsHTMLDocument::GetSelection(ErrorResult& aRv)
{
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(GetScopeObject());
if (!window) {
return nullptr;
}
NS_ASSERTION(window->IsInnerWindow(), "Should have inner window here!");
if (!window->IsCurrentInnerWindow()) {
return nullptr;
}
return static_cast<nsGlobalWindow*>(window.get())->GetSelection(aRv);
}
NS_IMETHODIMP
nsHTMLDocument::CaptureEvents()
{
WarnOnceAbout(nsIDocument::eUseOfCaptureEvents);
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::ReleaseEvents()
{
WarnOnceAbout(nsIDocument::eUseOfReleaseEvents);
return NS_OK;
}
// Mapped to document.embeds for NS4 compatibility
NS_IMETHODIMP
nsHTMLDocument::GetPlugins(nsIDOMHTMLCollection** aPlugins)
{
*aPlugins = nullptr;
return GetEmbeds(aPlugins);
}
nsIHTMLCollection*
nsHTMLDocument::Plugins()
{
return Embeds();
}
nsISupports*
nsHTMLDocument::ResolveName(const nsAString& aName, nsWrapperCache **aCache)
{
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aName);
if (!entry) {
*aCache = nullptr;
return nullptr;
}
nsBaseContentList *list = entry->GetNameContentList();
uint32_t length = list ? list->Length() : 0;
if (length > 0) {
if (length == 1) {
// Only one element in the list, return the element instead of returning
// the list.
nsIContent *node = list->Item(0);
*aCache = node;
return node;
}
// The list contains more than one element, return the whole list.
*aCache = list;
return list;
}
// No named items were found, see if there's one registerd by id for aName.
Element *e = entry->GetIdElement();
if (e && nsGenericHTMLElement::ShouldExposeIdAsHTMLDocumentProperty(e)) {
*aCache = e;
return e;
}
*aCache = nullptr;
return nullptr;
}
void
nsHTMLDocument::NamedGetter(JSContext* cx, const nsAString& aName, bool& aFound,
JS::MutableHandle<JSObject*> aRetval,
ErrorResult& rv)
{
nsWrapperCache* cache;
nsISupports* supp = ResolveName(aName, &cache);
if (!supp) {
aFound = false;
aRetval.set(nullptr);
return;
}
JS::Rooted<JS::Value> val(cx);
// XXXbz Should we call the (slightly misnamed, really) WrapNativeParent
// here?
if (!dom::WrapObject(cx, supp, cache, nullptr, &val)) {
rv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
aFound = true;
aRetval.set(&val.toObject());
}
bool
nsHTMLDocument::NameIsEnumerable(const nsAString& aName)
{
return true;
}
static PLDHashOperator
IdentifierMapEntryAddNames(nsIdentifierMapEntry* aEntry, void* aArg)
{
nsTArray<nsString>* aNames = static_cast<nsTArray<nsString>*>(aArg);
if (aEntry->HasNameElement() ||
aEntry->HasIdElementExposedAsHTMLDocumentProperty()) {
aNames->AppendElement(aEntry->GetKey());
}
return PL_DHASH_NEXT;
}
void
nsHTMLDocument::GetSupportedNames(unsigned, nsTArray<nsString>& aNames)
{
mIdentifierMap.EnumerateEntries(IdentifierMapEntryAddNames, &aNames);
}
//----------------------------
// forms related stuff
NS_IMETHODIMP
nsHTMLDocument::GetForms(nsIDOMHTMLCollection** aForms)
{
NS_ADDREF(*aForms = nsHTMLDocument::GetForms());
return NS_OK;
}
nsContentList*
nsHTMLDocument::GetForms()
{
if (!mForms) {
mForms = new nsContentList(this, kNameSpaceID_XHTML, nsGkAtoms::form, nsGkAtoms::form);
}
return mForms;
}
static bool MatchFormControls(nsIContent* aContent, int32_t aNamespaceID,
nsIAtom* aAtom, void* aData)
{
return aContent->IsNodeOfType(nsIContent::eHTML_FORM_CONTROL);
}
nsContentList*
nsHTMLDocument::GetFormControls()
{
if (!mFormControls) {
mFormControls = new nsContentList(this, MatchFormControls, nullptr, nullptr);
}
return mFormControls;
}
nsresult
nsHTMLDocument::CreateAndAddWyciwygChannel(void)
{
nsresult rv = NS_OK;
nsAutoCString url, originalSpec;
mDocumentURI->GetSpec(originalSpec);
// Generate the wyciwyg url
url = NS_LITERAL_CSTRING("wyciwyg://")
+ nsPrintfCString("%d", gWyciwygSessionCnt++)
+ NS_LITERAL_CSTRING("/")
+ originalSpec;
nsCOMPtr<nsIURI> wcwgURI;
NS_NewURI(getter_AddRefs(wcwgURI), url);
// Create the nsIWyciwygChannel to store out-of-band
// document.write() script to cache
nsCOMPtr<nsIChannel> channel;
// Create a wyciwyg Channel
rv = NS_NewChannel(getter_AddRefs(channel),
wcwgURI,
NodePrincipal(),
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
nsIContentPolicy::TYPE_OTHER);
NS_ENSURE_SUCCESS(rv, rv);
mWyciwygChannel = do_QueryInterface(channel);
mWyciwygChannel->SetSecurityInfo(mSecurityInfo);
// Note: we want to treat this like a "previous document" hint so that,
// e.g. a <meta> tag in the document.write content can override it.
SetDocumentCharacterSetSource(kCharsetFromHintPrevDoc);
mWyciwygChannel->SetCharsetAndSource(kCharsetFromHintPrevDoc,
GetDocumentCharacterSet());
// Inherit load flags from the original document's channel
channel->SetLoadFlags(mLoadFlags);
nsCOMPtr<nsILoadGroup> loadGroup = GetDocumentLoadGroup();
// Use the Parent document's loadgroup to trigger load notifications
if (loadGroup && channel) {
rv = channel->SetLoadGroup(loadGroup);
NS_ENSURE_SUCCESS(rv, rv);
nsLoadFlags loadFlags = 0;
channel->GetLoadFlags(&loadFlags);
loadFlags |= nsIChannel::LOAD_DOCUMENT_URI;
channel->SetLoadFlags(loadFlags);
channel->SetOriginalURI(wcwgURI);
rv = loadGroup->AddRequest(mWyciwygChannel, nullptr);
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to add request to load group.");
}
return rv;
}
nsresult
nsHTMLDocument::RemoveWyciwygChannel(void)
{
nsCOMPtr<nsILoadGroup> loadGroup = GetDocumentLoadGroup();
// note there can be a write request without a load group if
// this is a synchronously constructed about:blank document
if (loadGroup && mWyciwygChannel) {
mWyciwygChannel->CloseCacheEntry(NS_OK);
loadGroup->RemoveRequest(mWyciwygChannel, nullptr, NS_OK);
}
mWyciwygChannel = nullptr;
return NS_OK;
}
void *
nsHTMLDocument::GenerateParserKey(void)
{
if (!mScriptLoader) {
// If we don't have a script loader, then the parser probably isn't parsing
// anything anyway, so just return null.
return nullptr;
}
// The script loader provides us with the currently executing script element,
// which is guaranteed to be unique per script.
nsIScriptElement* script = mScriptLoader->GetCurrentParserInsertedScript();
if (script && mParser && mParser->IsScriptCreated()) {
nsCOMPtr<nsIParser> creatorParser = script->GetCreatorParser();
if (creatorParser != mParser) {
// Make scripts that aren't inserted by the active parser of this document
// participate in the context of the script that document.open()ed
// this document.
return nullptr;
}
}
return script;
}
/* attribute DOMString designMode; */
NS_IMETHODIMP
nsHTMLDocument::GetDesignMode(nsAString & aDesignMode)
{
if (HasFlag(NODE_IS_EDITABLE)) {
aDesignMode.AssignLiteral("on");
}
else {
aDesignMode.AssignLiteral("off");
}
return NS_OK;
}
void
nsHTMLDocument::MaybeEditingStateChanged()
{
if (!mPendingMaybeEditingStateChanged &&
mUpdateNestLevel == 0 && (mContentEditableCount > 0) != IsEditingOn()) {
if (nsContentUtils::IsSafeToRunScript()) {
EditingStateChanged();
} else if (!mInDestructor) {
nsContentUtils::AddScriptRunner(
NS_NewRunnableMethod(this, &nsHTMLDocument::MaybeEditingStateChanged));
}
}
}
void
nsHTMLDocument::EndUpdate(nsUpdateType aUpdateType)
{
const bool reset = !mPendingMaybeEditingStateChanged;
mPendingMaybeEditingStateChanged = true;
nsDocument::EndUpdate(aUpdateType);
if (reset) {
mPendingMaybeEditingStateChanged = false;
}
MaybeEditingStateChanged();
}
// Helper class, used below in ChangeContentEditableCount().
class DeferredContentEditableCountChangeEvent : public nsRunnable
{
public:
DeferredContentEditableCountChangeEvent(nsHTMLDocument *aDoc,
nsIContent *aElement)
: mDoc(aDoc)
, mElement(aElement)
{
}
NS_IMETHOD Run() {
if (mElement && mElement->OwnerDoc() == mDoc) {
mDoc->DeferredContentEditableCountChange(mElement);
}
return NS_OK;
}
private:
nsRefPtr<nsHTMLDocument> mDoc;
nsCOMPtr<nsIContent> mElement;
};
nsresult
nsHTMLDocument::ChangeContentEditableCount(nsIContent *aElement,
int32_t aChange)
{
NS_ASSERTION(int32_t(mContentEditableCount) + aChange >= 0,
"Trying to decrement too much.");
mContentEditableCount += aChange;
nsContentUtils::AddScriptRunner(
new DeferredContentEditableCountChangeEvent(this, aElement));
return NS_OK;
}
void
nsHTMLDocument::DeferredContentEditableCountChange(nsIContent *aElement)
{
if (mParser ||
(mUpdateNestLevel > 0 && (mContentEditableCount > 0) != IsEditingOn())) {
return;
}
EditingState oldState = mEditingState;
nsresult rv = EditingStateChanged();
NS_ENSURE_SUCCESS_VOID(rv);
if (oldState == mEditingState && mEditingState == eContentEditable) {
// We just changed the contentEditable state of a node, we need to reset
// the spellchecking state of that node.
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aElement);
if (node) {
nsPIDOMWindow *window = GetWindow();
if (!window)
return;
nsIDocShell *docshell = window->GetDocShell();
if (!docshell)
return;
nsCOMPtr<nsIEditor> editor;
docshell->GetEditor(getter_AddRefs(editor));
if (editor) {
nsRefPtr<nsRange> range = new nsRange(aElement);
rv = range->SelectNode(node);
if (NS_FAILED(rv)) {
// The node might be detached from the document at this point,
// which would cause this call to fail. In this case, we can
// safely ignore the contenteditable count change.
return;
}
nsCOMPtr<nsIInlineSpellChecker> spellChecker;
rv = editor->GetInlineSpellChecker(false,
getter_AddRefs(spellChecker));
NS_ENSURE_SUCCESS_VOID(rv);
if (spellChecker) {
rv = spellChecker->SpellCheckRange(range);
}
}
}
}
}
HTMLAllCollection*
nsHTMLDocument::All()
{
if (!mAll) {
mAll = new HTMLAllCollection(this);
}
return mAll;
}
static void
NotifyEditableStateChange(nsINode *aNode, nsIDocument *aDocument)
{
for (nsIContent* child = aNode->GetFirstChild();
child;
child = child->GetNextSibling()) {
if (child->IsElement()) {
child->AsElement()->UpdateState(true);
}
NotifyEditableStateChange(child, aDocument);
}
}
void
nsHTMLDocument::TearingDownEditor(nsIEditor *aEditor)
{
if (IsEditingOn()) {
EditingState oldState = mEditingState;
mEditingState = eTearingDown;
nsCOMPtr<nsIPresShell> presShell = GetShell();
if (!presShell)
return;
nsCOMArray<nsIStyleSheet> agentSheets;
presShell->GetAgentStyleSheets(agentSheets);
RemoveFromAgentSheets(agentSheets, NS_LITERAL_STRING("resource://gre/res/contenteditable.css"));
if (oldState == eDesignMode)
RemoveFromAgentSheets(agentSheets, NS_LITERAL_STRING("resource://gre/res/designmode.css"));
presShell->SetAgentStyleSheets(agentSheets);
presShell->ReconstructStyleData();
}
}
nsresult
nsHTMLDocument::TurnEditingOff()
{
NS_ASSERTION(mEditingState != eOff, "Editing is already off.");
nsPIDOMWindow *window = GetWindow();
if (!window)
return NS_ERROR_FAILURE;
nsIDocShell *docshell = window->GetDocShell();
if (!docshell)
return NS_ERROR_FAILURE;
nsresult rv;
nsCOMPtr<nsIEditingSession> editSession = do_GetInterface(docshell, &rv);
NS_ENSURE_SUCCESS(rv, rv);
// turn editing off
rv = editSession->TearDownEditorOnWindow(window);
NS_ENSURE_SUCCESS(rv, rv);
mEditingState = eOff;
return NS_OK;
}
static bool HasPresShell(nsPIDOMWindow *aWindow)
{
nsIDocShell *docShell = aWindow->GetDocShell();
if (!docShell)
return false;
return docShell->GetPresShell() != nullptr;
}
nsresult
nsHTMLDocument::SetEditingState(EditingState aState)
{
mEditingState = aState;
return NS_OK;
}
nsresult
nsHTMLDocument::EditingStateChanged()
{
if (mRemovedFromDocShell) {
return NS_OK;
}
if (mEditingState == eSettingUp || mEditingState == eTearingDown) {
// XXX We shouldn't recurse.
return NS_OK;
}
bool designMode = HasFlag(NODE_IS_EDITABLE);
EditingState newState = designMode ? eDesignMode :
(mContentEditableCount > 0 ? eContentEditable : eOff);
if (mEditingState == newState) {
// No changes in editing mode.
return NS_OK;
}
if (newState == eOff) {
// Editing is being turned off.
nsAutoScriptBlocker scriptBlocker;
NotifyEditableStateChange(this, this);
return TurnEditingOff();
}
// Flush out style changes on our _parent_ document, if any, so that
// our check for a presshell won't get stale information.
if (mParentDocument) {
mParentDocument->FlushPendingNotifications(Flush_Style);
}
// get editing session, make sure this is a strong reference so the
// window can't get deleted during the rest of this call.
nsCOMPtr<nsPIDOMWindow> window = GetWindow();
if (!window)
return NS_ERROR_FAILURE;
nsIDocShell *docshell = window->GetDocShell();
if (!docshell)
return NS_ERROR_FAILURE;
nsresult rv;
nsCOMPtr<nsIEditingSession> editSession = do_GetInterface(docshell, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIEditor> existingEditor;
editSession->GetEditorForWindow(window, getter_AddRefs(existingEditor));
if (existingEditor) {
// We might already have an editor if it was set up for mail, let's see
// if this is actually the case.
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(existingEditor);
NS_ABORT_IF_FALSE(htmlEditor, "If we have an editor, it must be an HTML editor");
uint32_t flags = 0;
existingEditor->GetFlags(&flags);
if (flags & nsIPlaintextEditor::eEditorMailMask) {
// We already have a mail editor, then we should not attempt to create
// another one.
return NS_OK;
}
}
if (!HasPresShell(window)) {
// We should not make the window editable or setup its editor.
// It's probably style=display:none.
return NS_OK;
}
bool makeWindowEditable = mEditingState == eOff;
bool updateState = false;
bool spellRecheckAll = false;
nsCOMPtr<nsIEditor> editor;
{
EditingState oldState = mEditingState;
nsAutoEditingState push(this, eSettingUp);
if (makeWindowEditable) {
// Editing is being turned on (through designMode or contentEditable)
// Turn on editor.
// XXX This can cause flushing which can change the editing state, so make
// sure to avoid recursing.
rv = editSession->MakeWindowEditable(window, "html", false, false,
true);
NS_ENSURE_SUCCESS(rv, rv);
}
// XXX Need to call TearDownEditorOnWindow for all failures.
docshell->GetEditor(getter_AddRefs(editor));
if (!editor)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIPresShell> presShell = GetShell();
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
// If we're entering the design mode, put the selection at the beginning of
// the document for compatibility reasons.
if (designMode && oldState == eOff) {
editor->BeginningOfDocument();
}
nsCOMArray<nsIStyleSheet> agentSheets;
rv = presShell->GetAgentStyleSheets(agentSheets);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIURI> uri;
rv = NS_NewURI(getter_AddRefs(uri), NS_LITERAL_STRING("resource://gre/res/contenteditable.css"));
NS_ENSURE_SUCCESS(rv, rv);
nsRefPtr<CSSStyleSheet> sheet;
rv = LoadChromeSheetSync(uri, true, getter_AddRefs(sheet));
NS_ENSURE_TRUE(sheet, rv);
bool result = agentSheets.AppendObject(sheet);
NS_ENSURE_TRUE(result, NS_ERROR_OUT_OF_MEMORY);
// Should we update the editable state of all the nodes in the document? We
// need to do this when the designMode value changes, as that overrides
// specific states on the elements.
if (designMode) {
// designMode is being turned on (overrides contentEditable).
rv = NS_NewURI(getter_AddRefs(uri), NS_LITERAL_STRING("resource://gre/res/designmode.css"));
NS_ENSURE_SUCCESS(rv, rv);
rv = LoadChromeSheetSync(uri, true, getter_AddRefs(sheet));
NS_ENSURE_TRUE(sheet, rv);
result = agentSheets.AppendObject(sheet);
NS_ENSURE_TRUE(result, NS_ERROR_OUT_OF_MEMORY);
updateState = true;
spellRecheckAll = oldState == eContentEditable;
}
else if (oldState == eDesignMode) {
// designMode is being turned off (contentEditable is still on).
RemoveFromAgentSheets(agentSheets, NS_LITERAL_STRING("resource://gre/res/designmode.css"));
updateState = true;
}
rv = presShell->SetAgentStyleSheets(agentSheets);
NS_ENSURE_SUCCESS(rv, rv);
presShell->ReconstructStyleData();
}
mEditingState = newState;
if (makeWindowEditable) {
// Set the editor to not insert br's on return when in p
// elements by default.
// XXX Do we only want to do this for designMode?
bool unused;
rv = ExecCommand(NS_LITERAL_STRING("insertBrOnReturn"), false,
NS_LITERAL_STRING("false"), &unused);
if (NS_FAILED(rv)) {
// Editor setup failed. Editing is not on after all.
// XXX Should we reset the editable flag on nodes?
editSession->TearDownEditorOnWindow(window);
mEditingState = eOff;
return rv;
}
}
if (updateState) {
nsAutoScriptBlocker scriptBlocker;
NotifyEditableStateChange(this, this);
}
// Resync the editor's spellcheck state.
if (spellRecheckAll) {
nsCOMPtr<nsISelectionController> selcon;
nsresult rv = editor->GetSelectionController(getter_AddRefs(selcon));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsISelection> spellCheckSelection;
rv = selcon->GetSelection(nsISelectionController::SELECTION_SPELLCHECK,
getter_AddRefs(spellCheckSelection));
if (NS_SUCCEEDED(rv)) {
spellCheckSelection->RemoveAllRanges();
}
}
editor->SyncRealTimeSpell();
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::SetDesignMode(const nsAString & aDesignMode)
{
ErrorResult rv;
SetDesignMode(aDesignMode, rv);
return rv.ErrorCode();
}
void
nsHTMLDocument::SetDesignMode(const nsAString& aDesignMode, ErrorResult& rv)
{
if (!nsContentUtils::SubjectPrincipal()->Subsumes(NodePrincipal())) {
rv.Throw(NS_ERROR_DOM_PROP_ACCESS_DENIED);
return;
}
bool editableMode = HasFlag(NODE_IS_EDITABLE);
if (aDesignMode.LowerCaseEqualsASCII(editableMode ? "off" : "on")) {
SetEditableFlag(!editableMode);
rv = EditingStateChanged();
}
}
nsresult
nsHTMLDocument::GetMidasCommandManager(nsICommandManager** aCmdMgr)
{
// initialize return value
NS_ENSURE_ARG_POINTER(aCmdMgr);
// check if we have it cached
if (mMidasCommandManager) {
NS_ADDREF(*aCmdMgr = mMidasCommandManager);
return NS_OK;
}
*aCmdMgr = nullptr;
nsPIDOMWindow *window = GetWindow();
if (!window)
return NS_ERROR_FAILURE;
nsIDocShell *docshell = window->GetDocShell();
if (!docshell)
return NS_ERROR_FAILURE;
mMidasCommandManager = do_GetInterface(docshell);
if (!mMidasCommandManager)
return NS_ERROR_FAILURE;
NS_ADDREF(*aCmdMgr = mMidasCommandManager);
return NS_OK;
}
struct MidasCommand {
const char* incomingCommandString;
const char* internalCommandString;
const char* internalParamString;
bool useNewParam;
bool convertToBoolean;
};
static const struct MidasCommand gMidasCommandTable[] = {
{ "bold", "cmd_bold", "", true, false },
{ "italic", "cmd_italic", "", true, false },
{ "underline", "cmd_underline", "", true, false },
{ "strikethrough", "cmd_strikethrough", "", true, false },
{ "subscript", "cmd_subscript", "", true, false },
{ "superscript", "cmd_superscript", "", true, false },
{ "cut", "cmd_cut", "", true, false },
{ "copy", "cmd_copy", "", true, false },
{ "paste", "cmd_paste", "", true, false },
{ "delete", "cmd_deleteCharBackward", "", true, false },
{ "forwarddelete", "cmd_deleteCharForward", "", true, false },
{ "selectall", "cmd_selectAll", "", true, false },
{ "undo", "cmd_undo", "", true, false },
{ "redo", "cmd_redo", "", true, false },
{ "indent", "cmd_indent", "", true, false },
{ "outdent", "cmd_outdent", "", true, false },
{ "backcolor", "cmd_highlight", "", false, false },
{ "forecolor", "cmd_fontColor", "", false, false },
{ "hilitecolor", "cmd_highlight", "", false, false },
{ "fontname", "cmd_fontFace", "", false, false },
{ "fontsize", "cmd_fontSize", "", false, false },
{ "increasefontsize", "cmd_increaseFont", "", false, false },
{ "decreasefontsize", "cmd_decreaseFont", "", false, false },
{ "inserthorizontalrule", "cmd_insertHR", "", true, false },
{ "createlink", "cmd_insertLinkNoUI", "", false, false },
{ "insertimage", "cmd_insertImageNoUI", "", false, false },
{ "inserthtml", "cmd_insertHTML", "", false, false },
{ "inserttext", "cmd_insertText", "", false, false },
{ "gethtml", "cmd_getContents", "", false, false },
{ "justifyleft", "cmd_align", "left", true, false },
{ "justifyright", "cmd_align", "right", true, false },
{ "justifycenter", "cmd_align", "center", true, false },
{ "justifyfull", "cmd_align", "justify", true, false },
{ "removeformat", "cmd_removeStyles", "", true, false },
{ "unlink", "cmd_removeLinks", "", true, false },
{ "insertorderedlist", "cmd_ol", "", true, false },
{ "insertunorderedlist", "cmd_ul", "", true, false },
{ "insertparagraph", "cmd_paragraphState", "p", true, false },
{ "formatblock", "cmd_paragraphState", "", false, false },
{ "heading", "cmd_paragraphState", "", false, false },
{ "styleWithCSS", "cmd_setDocumentUseCSS", "", false, true },
{ "contentReadOnly", "cmd_setDocumentReadOnly", "", false, true },
{ "insertBrOnReturn", "cmd_insertBrOnReturn", "", false, true },
{ "enableObjectResizing", "cmd_enableObjectResizing", "", false, true },
{ "enableInlineTableEditing", "cmd_enableInlineTableEditing", "", false, true },
#if 0
// no editor support to remove alignments right now
{ "justifynone", "cmd_align", "", true, false },
// the following will need special review before being turned on
{ "saveas", "cmd_saveAs", "", true, false },
{ "print", "cmd_print", "", true, false },
#endif
{ nullptr, nullptr, nullptr, false, false }
};
#define MidasCommandCount ((sizeof(gMidasCommandTable) / sizeof(struct MidasCommand)) - 1)
static const char* const gBlocks[] = {
"ADDRESS",
"BLOCKQUOTE",
"DD",
"DIV",
"DL",
"DT",
"H1",
"H2",
"H3",
"H4",
"H5",
"H6",
"P",
"PRE"
};
static bool
ConvertToMidasInternalCommandInner(const nsAString& inCommandID,
const nsAString& inParam,
nsACString& outCommandID,
nsACString& outParam,
bool& outIsBoolean,
bool& outBooleanValue,
bool aIgnoreParams)
{
NS_ConvertUTF16toUTF8 convertedCommandID(inCommandID);
// Hack to support old boolean commands that were backwards (see bug 301490).
bool invertBool = false;
if (convertedCommandID.LowerCaseEqualsLiteral("usecss")) {
convertedCommandID.AssignLiteral("styleWithCSS");
invertBool = true;
} else if (convertedCommandID.LowerCaseEqualsLiteral("readonly")) {
convertedCommandID.AssignLiteral("contentReadOnly");
invertBool = true;
}
uint32_t i;
bool found = false;
for (i = 0; i < MidasCommandCount; ++i) {
if (convertedCommandID.Equals(gMidasCommandTable[i].incomingCommandString,
nsCaseInsensitiveCStringComparator())) {
found = true;
break;
}
}
if (!found) {
// reset results if the command is not found in our table
outCommandID.SetLength(0);
outParam.SetLength(0);
outIsBoolean = false;
return false;
}
// set outCommandID (what we use internally)
outCommandID.Assign(gMidasCommandTable[i].internalCommandString);
// set outParam & outIsBoolean based on flags from the table
outIsBoolean = gMidasCommandTable[i].convertToBoolean;
if (aIgnoreParams) {
// No further work to do
return true;
}
if (gMidasCommandTable[i].useNewParam) {
// Just have to copy it, no checking
outParam.Assign(gMidasCommandTable[i].internalParamString);
return true;
}
// handle checking of param passed in
if (outIsBoolean) {
// If this is a boolean value and it's not explicitly false (e.g. no value)
// we default to "true". For old backwards commands we invert the check (see
// bug 301490).
if (invertBool) {
outBooleanValue = inParam.LowerCaseEqualsLiteral("false");
} else {
outBooleanValue = !inParam.LowerCaseEqualsLiteral("false");
}
outParam.Truncate();
return true;
}
// String parameter -- see if we need to convert it (necessary for
// cmd_paragraphState and cmd_fontSize)
if (outCommandID.EqualsLiteral("cmd_paragraphState")) {
const char16_t* start = inParam.BeginReading();
const char16_t* end = inParam.EndReading();
if (start != end && *start == '<' && *(end - 1) == '>') {
++start;
--end;
}
NS_ConvertUTF16toUTF8 convertedParam(Substring(start, end));
uint32_t j;
for (j = 0; j < ArrayLength(gBlocks); ++j) {
if (convertedParam.Equals(gBlocks[j],
nsCaseInsensitiveCStringComparator())) {
outParam.Assign(gBlocks[j]);
break;
}
}
if (j == ArrayLength(gBlocks)) {
outParam.Truncate();
}
} else if (outCommandID.EqualsLiteral("cmd_fontSize")) {
// Per editing spec as of April 23, 2012, we need to reject the value if
// it's not a valid floating-point number surrounded by optional whitespace.
// Otherwise, we parse it as a legacy font size. For now, we just parse as
// a legacy font size regardless (matching WebKit) -- bug 747879.
outParam.Truncate();
int32_t size = nsContentUtils::ParseLegacyFontSize(inParam);
if (size) {
outParam.AppendInt(size);
}
} else {
CopyUTF16toUTF8(inParam, outParam);
}
return true;
}
static bool
ConvertToMidasInternalCommand(const nsAString & inCommandID,
const nsAString & inParam,
nsACString& outCommandID,
nsACString& outParam,
bool& outIsBoolean,
bool& outBooleanValue)
{
return ConvertToMidasInternalCommandInner(inCommandID, inParam, outCommandID,
outParam, outIsBoolean,
outBooleanValue, false);
}
static bool
ConvertToMidasInternalCommand(const nsAString & inCommandID,
nsACString& outCommandID)
{
nsAutoCString dummyCString;
nsAutoString dummyString;
bool dummyBool;
return ConvertToMidasInternalCommandInner(inCommandID, dummyString,
outCommandID, dummyCString,
dummyBool, dummyBool, true);
}
/* TODO: don't let this call do anything if the page is not done loading */
/* boolean execCommand(in DOMString commandID, in boolean doShowUI,
in DOMString value); */
NS_IMETHODIMP
nsHTMLDocument::ExecCommand(const nsAString& commandID,
bool doShowUI,
const nsAString& value,
bool* _retval)
{
ErrorResult rv;
*_retval = ExecCommand(commandID, doShowUI, value, rv);
return rv.ErrorCode();
}
bool
nsHTMLDocument::ExecCommand(const nsAString& commandID,
bool doShowUI,
const nsAString& value,
ErrorResult& rv)
{
// for optional parameters see dom/src/base/nsHistory.cpp: HistoryImpl::Go()
// this might add some ugly JS dependencies?
nsAutoCString cmdToDispatch, paramStr;
bool isBool, boolVal;
if (!ConvertToMidasInternalCommand(commandID, value,
cmdToDispatch, paramStr,
isBool, boolVal)) {
return false;
}
// if editing is not on, bail
if (!IsEditingOnAfterFlush()) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
// if they are requesting UI from us, let's fail since we have no UI
if (doShowUI) {
return false;
}
if (commandID.LowerCaseEqualsLiteral("gethtml")) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
bool restricted = commandID.LowerCaseEqualsLiteral("cut") ||
commandID.LowerCaseEqualsLiteral("copy")||
commandID.LowerCaseEqualsLiteral("paste");
if (restricted && !nsContentUtils::IsCallerChrome()) {
rv = NS_ERROR_DOM_SECURITY_ERR;
return false;
}
// get command manager and dispatch command to our window if it's acceptable
nsCOMPtr<nsICommandManager> cmdMgr;
GetMidasCommandManager(getter_AddRefs(cmdMgr));
if (!cmdMgr) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
nsIDOMWindow* window = GetWindow();
if (!window) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
if ((cmdToDispatch.EqualsLiteral("cmd_fontSize") ||
cmdToDispatch.EqualsLiteral("cmd_insertImageNoUI") ||
cmdToDispatch.EqualsLiteral("cmd_insertLinkNoUI") ||
cmdToDispatch.EqualsLiteral("cmd_paragraphState")) &&
paramStr.IsEmpty()) {
// Invalid value, return false
return false;
}
// Return false for disabled commands (bug 760052)
bool enabled = false;
cmdMgr->IsCommandEnabled(cmdToDispatch.get(), window, &enabled);
if (!enabled) {
return false;
}
if (!isBool && paramStr.IsEmpty()) {
rv = cmdMgr->DoCommand(cmdToDispatch.get(), nullptr, window);
} else {
// we have a command that requires a parameter, create params
nsCOMPtr<nsICommandParams> cmdParams = do_CreateInstance(
NS_COMMAND_PARAMS_CONTRACTID);
if (!cmdParams) {
rv.Throw(NS_ERROR_OUT_OF_MEMORY);
return false;
}
if (isBool) {
rv = cmdParams->SetBooleanValue("state_attribute", boolVal);
} else if (cmdToDispatch.EqualsLiteral("cmd_fontFace")) {
rv = cmdParams->SetStringValue("state_attribute", value);
} else if (cmdToDispatch.EqualsLiteral("cmd_insertHTML") ||
cmdToDispatch.EqualsLiteral("cmd_insertText")) {
rv = cmdParams->SetStringValue("state_data", value);
} else {
rv = cmdParams->SetCStringValue("state_attribute", paramStr.get());
}
if (rv.Failed()) {
return false;
}
rv = cmdMgr->DoCommand(cmdToDispatch.get(), cmdParams, window);
}
return !rv.Failed();
}
/* boolean queryCommandEnabled(in DOMString commandID); */
NS_IMETHODIMP
nsHTMLDocument::QueryCommandEnabled(const nsAString& commandID,
bool* _retval)
{
ErrorResult rv;
*_retval = QueryCommandEnabled(commandID, rv);
return rv.ErrorCode();
}
bool
nsHTMLDocument::QueryCommandEnabled(const nsAString& commandID, ErrorResult& rv)
{
nsAutoCString cmdToDispatch;
if (!ConvertToMidasInternalCommand(commandID, cmdToDispatch)) {
return false;
}
// if editing is not on, bail
if (!IsEditingOnAfterFlush()) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
// get command manager and dispatch command to our window if it's acceptable
nsCOMPtr<nsICommandManager> cmdMgr;
GetMidasCommandManager(getter_AddRefs(cmdMgr));
if (!cmdMgr) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
nsIDOMWindow* window = GetWindow();
if (!window) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
bool retval;
rv = cmdMgr->IsCommandEnabled(cmdToDispatch.get(), window, &retval);
return retval;
}
/* boolean queryCommandIndeterm (in DOMString commandID); */
NS_IMETHODIMP
nsHTMLDocument::QueryCommandIndeterm(const nsAString & commandID,
bool *_retval)
{
ErrorResult rv;
*_retval = QueryCommandIndeterm(commandID, rv);
return rv.ErrorCode();
}
bool
nsHTMLDocument::QueryCommandIndeterm(const nsAString& commandID, ErrorResult& rv)
{
nsAutoCString cmdToDispatch;
if (!ConvertToMidasInternalCommand(commandID, cmdToDispatch)) {
return false;
}
// if editing is not on, bail
if (!IsEditingOnAfterFlush()) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
// get command manager and dispatch command to our window if it's acceptable
nsCOMPtr<nsICommandManager> cmdMgr;
GetMidasCommandManager(getter_AddRefs(cmdMgr));
if (!cmdMgr) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
nsIDOMWindow* window = GetWindow();
if (!window) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
nsresult res;
nsCOMPtr<nsICommandParams> cmdParams = do_CreateInstance(
NS_COMMAND_PARAMS_CONTRACTID, &res);
if (NS_FAILED(res)) {
rv.Throw(res);
return false;
}
rv = cmdMgr->GetCommandState(cmdToDispatch.get(), window, cmdParams);
if (rv.Failed()) {
return false;
}
// If command does not have a state_mixed value, this call fails and sets
// retval to false. This is fine -- we want to return false in that case
// anyway (bug 738385), so we just don't throw regardless.
bool retval = false;
cmdParams->GetBooleanValue("state_mixed", &retval);
return retval;
}
/* boolean queryCommandState(in DOMString commandID); */
NS_IMETHODIMP
nsHTMLDocument::QueryCommandState(const nsAString & commandID, bool *_retval)
{
ErrorResult rv;
*_retval = QueryCommandState(commandID, rv);
return rv.ErrorCode();
}
bool
nsHTMLDocument::QueryCommandState(const nsAString& commandID, ErrorResult& rv)
{
nsAutoCString cmdToDispatch, paramToCheck;
bool dummy, dummy2;
if (!ConvertToMidasInternalCommand(commandID, commandID,
cmdToDispatch, paramToCheck,
dummy, dummy2)) {
return false;
}
// if editing is not on, bail
if (!IsEditingOnAfterFlush()) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
// get command manager and dispatch command to our window if it's acceptable
nsCOMPtr<nsICommandManager> cmdMgr;
GetMidasCommandManager(getter_AddRefs(cmdMgr));
if (!cmdMgr) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
nsIDOMWindow* window = GetWindow();
if (!window) {
rv.Throw(NS_ERROR_FAILURE);
return false;
}
if (commandID.LowerCaseEqualsLiteral("usecss")) {
// Per spec, state is supported for styleWithCSS but not useCSS, so we just
// return false always.
return false;
}
nsCOMPtr<nsICommandParams> cmdParams = do_CreateInstance(
NS_COMMAND_PARAMS_CONTRACTID);
if (!cmdParams) {
rv.Throw(NS_ERROR_OUT_OF_MEMORY);
return false;
}
rv = cmdMgr->GetCommandState(cmdToDispatch.get(), window, cmdParams);
if (rv.Failed()) {
return false;
}
// handle alignment as a special case (possibly other commands too?)
// Alignment is special because the external api is individual
// commands but internally we use cmd_align with different
// parameters. When getting the state of this command, we need to
// return the boolean for this particular alignment rather than the
// string of 'which alignment is this?'
if (cmdToDispatch.EqualsLiteral("cmd_align")) {
char * actualAlignmentType = nullptr;
rv = cmdParams->GetCStringValue("state_attribute", &actualAlignmentType);
bool retval = false;
if (!rv.Failed() && actualAlignmentType && actualAlignmentType[0]) {
retval = paramToCheck.Equals(actualAlignmentType);
}
if (actualAlignmentType) {
nsMemory::Free(actualAlignmentType);
}
return retval;
}
// If command does not have a state_all value, this call fails and sets
// retval to false. This is fine -- we want to return false in that case
// anyway (bug 738385), so we just succeed and return false regardless.
bool retval = false;
cmdParams->GetBooleanValue("state_all", &retval);
return retval;
}
/* boolean queryCommandSupported(in DOMString commandID); */
NS_IMETHODIMP
nsHTMLDocument::QueryCommandSupported(const nsAString & commandID,
bool *_retval)
{
*_retval = QueryCommandSupported(commandID);
return NS_OK;
}
bool
nsHTMLDocument::QueryCommandSupported(const nsAString& commandID)
{
// commandID is supported if it can be converted to a Midas command
nsAutoCString cmdToDispatch;
return ConvertToMidasInternalCommand(commandID, cmdToDispatch);
}
/* DOMString queryCommandValue(in DOMString commandID); */
NS_IMETHODIMP
nsHTMLDocument::QueryCommandValue(const nsAString & commandID,
nsAString &_retval)
{
ErrorResult rv;
QueryCommandValue(commandID, _retval, rv);
return rv.ErrorCode();
}
void
nsHTMLDocument::QueryCommandValue(const nsAString& commandID,
nsAString& aValue,
ErrorResult& rv)
{
aValue.Truncate();
nsAutoCString cmdToDispatch, paramStr;
if (!ConvertToMidasInternalCommand(commandID, cmdToDispatch)) {
// Return empty string
return;
}
// if editing is not on, bail
if (!IsEditingOnAfterFlush()) {
rv.Throw(NS_ERROR_FAILURE);
return;
}
// get command manager and dispatch command to our window if it's acceptable
nsCOMPtr<nsICommandManager> cmdMgr;
GetMidasCommandManager(getter_AddRefs(cmdMgr));
if (!cmdMgr) {
rv.Throw(NS_ERROR_FAILURE);
return;
}
nsIDOMWindow* window = GetWindow();
if (!window) {
rv.Throw(NS_ERROR_FAILURE);
return;
}
// create params
nsCOMPtr<nsICommandParams> cmdParams = do_CreateInstance(
NS_COMMAND_PARAMS_CONTRACTID);
if (!cmdParams) {
rv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
// this is a special command since we are calling DoCommand rather than
// GetCommandState like the other commands
if (cmdToDispatch.EqualsLiteral("cmd_getContents")) {
rv = cmdParams->SetBooleanValue("selection_only", true);
if (rv.Failed()) {
return;
}
rv = cmdParams->SetCStringValue("format", "text/html");
if (rv.Failed()) {
return;
}
rv = cmdMgr->DoCommand(cmdToDispatch.get(), cmdParams, window);
if (rv.Failed()) {
return;
}
rv = cmdParams->GetStringValue("result", aValue);
return;
}
rv = cmdParams->SetCStringValue("state_attribute", paramStr.get());
if (rv.Failed()) {
return;
}
rv = cmdMgr->GetCommandState(cmdToDispatch.get(), window, cmdParams);
if (rv.Failed()) {
return;
}
// If command does not have a state_attribute value, this call fails, and
// aValue will wind up being the empty string. This is fine -- we want to
// return "" in that case anyway (bug 738385), so we just return NS_OK
// regardless.
nsXPIDLCString cStringResult;
cmdParams->GetCStringValue("state_attribute",
getter_Copies(cStringResult));
CopyUTF8toUTF16(cStringResult, aValue);
}
nsresult
nsHTMLDocument::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const
{
NS_ASSERTION(aNodeInfo->NodeInfoManager() == mNodeInfoManager,
"Can't import this document into another document!");
nsRefPtr<nsHTMLDocument> clone = new nsHTMLDocument();
nsresult rv = CloneDocHelper(clone.get());
NS_ENSURE_SUCCESS(rv, rv);
// State from nsHTMLDocument
clone->mLoadFlags = mLoadFlags;
return CallQueryInterface(clone.get(), aResult);
}
bool
nsHTMLDocument::IsEditingOnAfterFlush()
{
nsIDocument* doc = GetParentDocument();
if (doc) {
// Make sure frames are up to date, since that can affect whether
// we're editable.
doc->FlushPendingNotifications(Flush_Frames);
}
return IsEditingOn();
}
void
nsHTMLDocument::RemovedFromDocShell()
{
mEditingState = eOff;
nsDocument::RemovedFromDocShell();
}
/* virtual */ void
nsHTMLDocument::DocAddSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const
{
nsDocument::DocAddSizeOfExcludingThis(aWindowSizes);
// Measurement of the following members may be added later if DMD finds it is
// worthwhile:
// - mImages
// - mApplets
// - mEmbeds
// - mLinks
// - mAnchors
// - mScripts
// - mForms
// - mFormControls
// - mWyciwygChannel
// - mMidasCommandManager
}
bool
nsHTMLDocument::WillIgnoreCharsetOverride()
{
if (mType != eHTML) {
MOZ_ASSERT(mType == eXHTML);
return true;
}
if (mCharacterSetSource == kCharsetFromByteOrderMark) {
return true;
}
if (!EncodingUtils::IsAsciiCompatible(mCharacterSet)) {
return true;
}
nsCOMPtr<nsIWyciwygChannel> wyciwyg = do_QueryInterface(mChannel);
if (wyciwyg) {
return true;
}
nsIURI* uri = GetOriginalURI();
if (uri) {
bool schemeIs = false;
uri->SchemeIs("about", &schemeIs);
if (schemeIs) {
return true;
}
bool isResource;
nsresult rv = NS_URIChainHasFlags(uri,
nsIProtocolHandler::URI_IS_UI_RESOURCE,
&isResource);
if (NS_FAILED(rv) || isResource) {
return true;
}
}
return false;
}