forked from mirrors/gecko-dev
		
	 afb5cd9a82
			
		
	
	
		afb5cd9a82
		
	
	
	
	
		
			
			--HG-- rename : embedding/browser/nsCTooltipTextProvider.h => docshell/base/nsCTooltipTextProvider.h rename : embedding/browser/nsContextMenuInfo.cpp => docshell/base/nsContextMenuInfo.cpp rename : embedding/browser/nsContextMenuInfo.h => docshell/base/nsContextMenuInfo.h rename : embedding/browser/nsDocShellTreeOwner.cpp => docshell/base/nsDocShellTreeOwner.cpp rename : embedding/browser/nsDocShellTreeOwner.h => docshell/base/nsDocShellTreeOwner.h rename : embedding/browser/nsIContextMenuListener.idl => docshell/base/nsIContextMenuListener.idl rename : embedding/browser/nsIContextMenuListener2.idl => docshell/base/nsIContextMenuListener2.idl rename : embedding/browser/nsITooltipListener.idl => docshell/base/nsITooltipListener.idl rename : embedding/browser/nsITooltipTextProvider.idl => docshell/base/nsITooltipTextProvider.idl rename : embedding/components/commandhandler/moz.build => dom/commandhandler/moz.build rename : embedding/components/commandhandler/nsBaseCommandController.cpp => dom/commandhandler/nsBaseCommandController.cpp rename : embedding/components/commandhandler/nsBaseCommandController.h => dom/commandhandler/nsBaseCommandController.h rename : embedding/components/commandhandler/nsCommandGroup.cpp => dom/commandhandler/nsCommandGroup.cpp rename : embedding/components/commandhandler/nsCommandGroup.h => dom/commandhandler/nsCommandGroup.h rename : embedding/components/commandhandler/nsCommandManager.cpp => dom/commandhandler/nsCommandManager.cpp rename : embedding/components/commandhandler/nsCommandManager.h => dom/commandhandler/nsCommandManager.h rename : embedding/components/commandhandler/nsCommandParams.cpp => dom/commandhandler/nsCommandParams.cpp rename : embedding/components/commandhandler/nsCommandParams.h => dom/commandhandler/nsCommandParams.h rename : embedding/components/commandhandler/nsControllerCommandTable.cpp => dom/commandhandler/nsControllerCommandTable.cpp rename : embedding/components/commandhandler/nsControllerCommandTable.h => dom/commandhandler/nsControllerCommandTable.h rename : embedding/components/commandhandler/nsICommandManager.idl => dom/commandhandler/nsICommandManager.idl rename : embedding/components/commandhandler/nsICommandParams.idl => dom/commandhandler/nsICommandParams.idl rename : embedding/components/commandhandler/nsIControllerCommand.idl => dom/commandhandler/nsIControllerCommand.idl rename : embedding/components/commandhandler/nsIControllerCommandTable.idl => dom/commandhandler/nsIControllerCommandTable.idl rename : embedding/components/commandhandler/nsIControllerContext.idl => dom/commandhandler/nsIControllerContext.idl rename : embedding/components/commandhandler/nsPICommandUpdater.idl => dom/commandhandler/nsPICommandUpdater.idl rename : embedding/components/webbrowserpersist/PWebBrowserPersistDocument.ipdl => dom/webbrowserpersist/PWebBrowserPersistDocument.ipdl rename : embedding/components/webbrowserpersist/PWebBrowserPersistResources.ipdl => dom/webbrowserpersist/PWebBrowserPersistResources.ipdl rename : embedding/components/webbrowserpersist/PWebBrowserPersistSerialize.ipdl => dom/webbrowserpersist/PWebBrowserPersistSerialize.ipdl rename : embedding/components/webbrowserpersist/WebBrowserPersistDocumentChild.cpp => dom/webbrowserpersist/WebBrowserPersistDocumentChild.cpp rename : embedding/components/webbrowserpersist/WebBrowserPersistDocumentChild.h => dom/webbrowserpersist/WebBrowserPersistDocumentChild.h rename : embedding/components/webbrowserpersist/WebBrowserPersistDocumentParent.cpp => dom/webbrowserpersist/WebBrowserPersistDocumentParent.cpp rename : embedding/components/webbrowserpersist/WebBrowserPersistDocumentParent.h => dom/webbrowserpersist/WebBrowserPersistDocumentParent.h rename : embedding/components/webbrowserpersist/WebBrowserPersistLocalDocument.cpp => dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp rename : embedding/components/webbrowserpersist/WebBrowserPersistLocalDocument.h => dom/webbrowserpersist/WebBrowserPersistLocalDocument.h rename : embedding/components/webbrowserpersist/WebBrowserPersistRemoteDocument.cpp => dom/webbrowserpersist/WebBrowserPersistRemoteDocument.cpp rename : embedding/components/webbrowserpersist/WebBrowserPersistRemoteDocument.h => dom/webbrowserpersist/WebBrowserPersistRemoteDocument.h rename : embedding/components/webbrowserpersist/WebBrowserPersistResourcesChild.cpp => dom/webbrowserpersist/WebBrowserPersistResourcesChild.cpp rename : embedding/components/webbrowserpersist/WebBrowserPersistResourcesChild.h => dom/webbrowserpersist/WebBrowserPersistResourcesChild.h rename : embedding/components/webbrowserpersist/WebBrowserPersistResourcesParent.cpp => dom/webbrowserpersist/WebBrowserPersistResourcesParent.cpp rename : embedding/components/webbrowserpersist/WebBrowserPersistResourcesParent.h => dom/webbrowserpersist/WebBrowserPersistResourcesParent.h rename : embedding/components/webbrowserpersist/WebBrowserPersistSerializeChild.cpp => dom/webbrowserpersist/WebBrowserPersistSerializeChild.cpp rename : embedding/components/webbrowserpersist/WebBrowserPersistSerializeChild.h => dom/webbrowserpersist/WebBrowserPersistSerializeChild.h rename : embedding/components/webbrowserpersist/WebBrowserPersistSerializeParent.cpp => dom/webbrowserpersist/WebBrowserPersistSerializeParent.cpp rename : embedding/components/webbrowserpersist/WebBrowserPersistSerializeParent.h => dom/webbrowserpersist/WebBrowserPersistSerializeParent.h rename : embedding/components/webbrowserpersist/moz.build => dom/webbrowserpersist/moz.build rename : embedding/components/webbrowserpersist/nsCWebBrowserPersist.idl => dom/webbrowserpersist/nsCWebBrowserPersist.idl rename : embedding/components/webbrowserpersist/nsIWebBrowserPersist.idl => dom/webbrowserpersist/nsIWebBrowserPersist.idl rename : embedding/components/webbrowserpersist/nsIWebBrowserPersistDocument.idl => dom/webbrowserpersist/nsIWebBrowserPersistDocument.idl rename : embedding/components/webbrowserpersist/nsIWebBrowserPersistable.idl => dom/webbrowserpersist/nsIWebBrowserPersistable.idl rename : embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp => dom/webbrowserpersist/nsWebBrowserPersist.cpp rename : embedding/components/webbrowserpersist/nsWebBrowserPersist.h => dom/webbrowserpersist/nsWebBrowserPersist.h rename : embedding/browser/build/moz.build => toolkit/components/browser/build/moz.build rename : embedding/browser/build/nsWebBrowserModule.cpp => toolkit/components/browser/build/nsWebBrowserModule.cpp rename : embedding/browser/nsCWebBrowser.idl => toolkit/components/browser/nsCWebBrowser.idl rename : embedding/browser/nsCommandHandler.cpp => toolkit/components/browser/nsCommandHandler.cpp rename : embedding/browser/nsCommandHandler.h => toolkit/components/browser/nsCommandHandler.h rename : embedding/nsEmbedCID.h => toolkit/components/browser/nsEmbedCID.h rename : embedding/browser/nsEmbedStream.cpp => toolkit/components/browser/nsEmbedStream.cpp rename : embedding/browser/nsEmbedStream.h => toolkit/components/browser/nsEmbedStream.h rename : embedding/browser/nsICommandHandler.idl => toolkit/components/browser/nsICommandHandler.idl rename : embedding/browser/nsIEmbeddingSiteWindow.idl => toolkit/components/browser/nsIEmbeddingSiteWindow.idl rename : embedding/browser/nsIPrintPreviewNavigation.idl => toolkit/components/browser/nsIPrintPreviewNavigation.idl rename : embedding/browser/nsIWebBrowser.idl => toolkit/components/browser/nsIWebBrowser.idl rename : embedding/browser/nsIWebBrowserChrome.idl => toolkit/components/browser/nsIWebBrowserChrome.idl rename : embedding/browser/nsIWebBrowserChrome2.idl => toolkit/components/browser/nsIWebBrowserChrome2.idl rename : embedding/browser/nsIWebBrowserChrome3.idl => toolkit/components/browser/nsIWebBrowserChrome3.idl rename : embedding/browser/nsIWebBrowserChromeFocus.idl => toolkit/components/browser/nsIWebBrowserChromeFocus.idl rename : embedding/browser/nsIWebBrowserFocus.idl => toolkit/components/browser/nsIWebBrowserFocus.idl rename : embedding/browser/nsIWebBrowserPrint.idl => toolkit/components/browser/nsIWebBrowserPrint.idl rename : embedding/browser/nsIWebBrowserSetup.idl => toolkit/components/browser/nsIWebBrowserSetup.idl rename : embedding/browser/nsIWebBrowserStream.idl => toolkit/components/browser/nsIWebBrowserStream.idl rename : embedding/browser/nsWebBrowser.cpp => toolkit/components/browser/nsWebBrowser.cpp rename : embedding/browser/nsWebBrowser.h => toolkit/components/browser/nsWebBrowser.h rename : embedding/browser/nsWebBrowserContentPolicy.cpp => toolkit/components/browser/nsWebBrowserContentPolicy.cpp rename : embedding/browser/nsWebBrowserContentPolicy.h => toolkit/components/browser/nsWebBrowserContentPolicy.h rename : embedding/components/find/nsFind.cpp => toolkit/components/find/nsFind.cpp rename : embedding/components/find/nsFind.h => toolkit/components/find/nsFind.h rename : embedding/components/find/nsIFind.idl => toolkit/components/find/nsIFind.idl rename : embedding/components/find/nsIWebBrowserFind.idl => toolkit/components/find/nsIWebBrowserFind.idl rename : embedding/components/find/nsWebBrowserFind.cpp => toolkit/components/find/nsWebBrowserFind.cpp rename : embedding/components/find/nsWebBrowserFind.h => toolkit/components/find/nsWebBrowserFind.h rename : embedding/components/printingui/ipc/PPrintProgressDialog.ipdl => toolkit/components/printingui/ipc/PPrintProgressDialog.ipdl rename : embedding/components/printingui/ipc/PPrintSettingsDialog.ipdl => toolkit/components/printingui/ipc/PPrintSettingsDialog.ipdl rename : embedding/components/printingui/ipc/PPrinting.ipdl => toolkit/components/printingui/ipc/PPrinting.ipdl rename : embedding/components/printingui/ipc/PPrintingTypes.ipdlh => toolkit/components/printingui/ipc/PPrintingTypes.ipdlh rename : embedding/components/printingui/ipc/PrintDataUtils.cpp => toolkit/components/printingui/ipc/PrintDataUtils.cpp rename : embedding/components/printingui/ipc/PrintDataUtils.h => toolkit/components/printingui/ipc/PrintDataUtils.h rename : embedding/components/printingui/ipc/PrintProgressDialogChild.cpp => toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp rename : embedding/components/printingui/ipc/PrintProgressDialogChild.h => toolkit/components/printingui/ipc/PrintProgressDialogChild.h rename : embedding/components/printingui/ipc/PrintProgressDialogParent.cpp => toolkit/components/printingui/ipc/PrintProgressDialogParent.cpp rename : embedding/components/printingui/ipc/PrintProgressDialogParent.h => toolkit/components/printingui/ipc/PrintProgressDialogParent.h rename : embedding/components/printingui/ipc/PrintSettingsDialogChild.cpp => toolkit/components/printingui/ipc/PrintSettingsDialogChild.cpp rename : embedding/components/printingui/ipc/PrintSettingsDialogChild.h => toolkit/components/printingui/ipc/PrintSettingsDialogChild.h rename : embedding/components/printingui/ipc/PrintSettingsDialogParent.cpp => toolkit/components/printingui/ipc/PrintSettingsDialogParent.cpp rename : embedding/components/printingui/ipc/PrintSettingsDialogParent.h => toolkit/components/printingui/ipc/PrintSettingsDialogParent.h rename : embedding/components/printingui/ipc/PrintingParent.cpp => toolkit/components/printingui/ipc/PrintingParent.cpp rename : embedding/components/printingui/ipc/PrintingParent.h => toolkit/components/printingui/ipc/PrintingParent.h rename : embedding/components/printingui/ipc/moz.build => toolkit/components/printingui/ipc/moz.build rename : embedding/components/printingui/ipc/nsPrintingProxy.cpp => toolkit/components/printingui/ipc/nsPrintingProxy.cpp rename : embedding/components/printingui/ipc/nsPrintingProxy.h => toolkit/components/printingui/ipc/nsPrintingProxy.h rename : embedding/components/printingui/mac/moz.build => toolkit/components/printingui/mac/moz.build rename : embedding/components/printingui/mac/nsPrintProgress.cpp => toolkit/components/printingui/mac/nsPrintProgress.cpp rename : embedding/components/printingui/mac/nsPrintProgress.h => toolkit/components/printingui/mac/nsPrintProgress.h rename : embedding/components/printingui/win/nsPrintProgressParams.cpp => toolkit/components/printingui/mac/nsPrintProgressParams.cpp rename : embedding/components/printingui/mac/nsPrintProgressParams.h => toolkit/components/printingui/mac/nsPrintProgressParams.h rename : embedding/components/printingui/mac/nsPrintingPromptService.h => toolkit/components/printingui/mac/nsPrintingPromptService.h rename : embedding/components/printingui/mac/nsPrintingPromptServiceX.mm => toolkit/components/printingui/mac/nsPrintingPromptServiceX.mm rename : embedding/components/printingui/moz.build => toolkit/components/printingui/moz.build rename : embedding/components/printingui/unixshared/moz.build => toolkit/components/printingui/unixshared/moz.build rename : embedding/components/printingui/unixshared/nsPrintProgress.cpp => toolkit/components/printingui/unixshared/nsPrintProgress.cpp rename : embedding/components/printingui/unixshared/nsPrintProgress.h => toolkit/components/printingui/unixshared/nsPrintProgress.h rename : embedding/components/printingui/unixshared/nsPrintProgressParams.cpp => toolkit/components/printingui/unixshared/nsPrintProgressParams.cpp rename : embedding/components/printingui/unixshared/nsPrintProgressParams.h => toolkit/components/printingui/unixshared/nsPrintProgressParams.h rename : embedding/components/printingui/unixshared/nsPrintingPromptService.cpp => toolkit/components/printingui/unixshared/nsPrintingPromptService.cpp rename : embedding/components/printingui/unixshared/nsPrintingPromptService.h => toolkit/components/printingui/unixshared/nsPrintingPromptService.h rename : embedding/components/printingui/win/moz.build => toolkit/components/printingui/win/moz.build rename : embedding/components/printingui/win/nsPrintDialogUtil.cpp => toolkit/components/printingui/win/nsPrintDialogUtil.cpp rename : embedding/components/printingui/win/nsPrintDialogUtil.h => toolkit/components/printingui/win/nsPrintDialogUtil.h rename : embedding/components/printingui/win/nsPrintProgress.cpp => toolkit/components/printingui/win/nsPrintProgress.cpp rename : embedding/components/printingui/win/nsPrintProgress.h => toolkit/components/printingui/win/nsPrintProgress.h rename : embedding/components/printingui/mac/nsPrintProgressParams.cpp => toolkit/components/printingui/win/nsPrintProgressParams.cpp rename : embedding/components/printingui/win/nsPrintProgressParams.h => toolkit/components/printingui/win/nsPrintProgressParams.h rename : embedding/components/printingui/win/nsPrintingPromptService.cpp => toolkit/components/printingui/win/nsPrintingPromptService.cpp rename : embedding/components/printingui/win/nsPrintingPromptService.h => toolkit/components/printingui/win/nsPrintingPromptService.h rename : embedding/nsIWindowCreator.idl => toolkit/components/windowcreator/nsIWindowCreator.idl rename : embedding/nsIWindowCreator2.idl => toolkit/components/windowcreator/nsIWindowCreator2.idl rename : embedding/nsIWindowProvider.idl => toolkit/components/windowcreator/nsIWindowProvider.idl rename : embedding/test/320x240.ogv => toolkit/components/windowcreator/test/320x240.ogv rename : embedding/test/browser.ini => toolkit/components/windowcreator/test/browser.ini rename : embedding/test/browser_bug1204626.js => toolkit/components/windowcreator/test/browser_bug1204626.js rename : embedding/test/bug1170334_iframe.xml => toolkit/components/windowcreator/test/bug1170334_iframe.xml rename : embedding/test/bug1170334_style.css => toolkit/components/windowcreator/test/bug1170334_style.css rename : embedding/test/bug1204626_doc0.html => toolkit/components/windowcreator/test/bug1204626_doc0.html rename : embedding/test/bug1204626_doc1.html => toolkit/components/windowcreator/test/bug1204626_doc1.html rename : embedding/test/bug293834_form.html => toolkit/components/windowcreator/test/bug293834_form.html rename : embedding/test/bug449141_page.html => toolkit/components/windowcreator/test/bug449141_page.html rename : embedding/test/chrome.ini => toolkit/components/windowcreator/test/chrome.ini rename : embedding/test/mochitest.ini => toolkit/components/windowcreator/test/mochitest.ini rename : embedding/test/moz.build => toolkit/components/windowcreator/test/moz.build rename : embedding/test/test_bug1170334_wbp_xmlstyle.html => toolkit/components/windowcreator/test/test_bug1170334_wbp_xmlstyle.html rename : embedding/test/test_bug1192654.html => toolkit/components/windowcreator/test/test_bug1192654.html rename : embedding/test/test_bug293834.html => toolkit/components/windowcreator/test/test_bug293834.html rename : embedding/test/test_bug449141.html => toolkit/components/windowcreator/test/test_bug449141.html rename : embedding/test/test_bug499115.html => toolkit/components/windowcreator/test/test_bug499115.html rename : embedding/test/test_nsFind.html => toolkit/components/windowcreator/test/test_nsFind.html rename : embedding/test/test_private_window_from_content.html => toolkit/components/windowcreator/test/test_private_window_from_content.html rename : embedding/test/test_window_open_position_constraint.html => toolkit/components/windowcreator/test/test_window_open_position_constraint.html rename : embedding/test/test_window_open_units.html => toolkit/components/windowcreator/test/test_window_open_units.html rename : embedding/tests/unit/test_wwauthpromptfactory.js => toolkit/components/windowcreator/tests/unit/test_wwauthpromptfactory.js rename : embedding/tests/unit/test_wwpromptfactory.js => toolkit/components/windowcreator/tests/unit/test_wwpromptfactory.js rename : embedding/tests/unit/xpcshell.ini => toolkit/components/windowcreator/tests/unit/xpcshell.ini rename : embedding/components/windowwatcher/moz.build => toolkit/components/windowwatcher/moz.build rename : embedding/components/windowwatcher/nsAutoWindowStateHelper.cpp => toolkit/components/windowwatcher/nsAutoWindowStateHelper.cpp rename : embedding/components/windowwatcher/nsAutoWindowStateHelper.h => toolkit/components/windowwatcher/nsAutoWindowStateHelper.h rename : embedding/components/windowwatcher/nsDialogParamBlock.cpp => toolkit/components/windowwatcher/nsDialogParamBlock.cpp rename : embedding/components/windowwatcher/nsDialogParamBlock.h => toolkit/components/windowwatcher/nsDialogParamBlock.h rename : embedding/components/windowwatcher/nsIDialogParamBlock.idl => toolkit/components/windowwatcher/nsIDialogParamBlock.idl rename : embedding/components/windowwatcher/nsIPromptFactory.idl => toolkit/components/windowwatcher/nsIPromptFactory.idl rename : embedding/components/windowwatcher/nsIPromptService.idl => toolkit/components/windowwatcher/nsIPromptService.idl rename : embedding/components/windowwatcher/nsIPromptService2.idl => toolkit/components/windowwatcher/nsIPromptService2.idl rename : embedding/components/windowwatcher/nsIWindowWatcher.idl => toolkit/components/windowwatcher/nsIWindowWatcher.idl rename : embedding/components/windowwatcher/nsPIPromptService.idl => toolkit/components/windowwatcher/nsPIPromptService.idl rename : embedding/components/windowwatcher/nsPIWindowWatcher.idl => toolkit/components/windowwatcher/nsPIWindowWatcher.idl rename : embedding/components/windowwatcher/nsPromptUtils.h => toolkit/components/windowwatcher/nsPromptUtils.h rename : embedding/components/windowwatcher/nsWindowWatcher.cpp => toolkit/components/windowwatcher/nsWindowWatcher.cpp rename : embedding/components/windowwatcher/nsWindowWatcher.h => toolkit/components/windowwatcher/nsWindowWatcher.h rename : embedding/components/windowwatcher/test/browser.ini => toolkit/components/windowwatcher/test/browser.ini rename : embedding/components/windowwatcher/test/browser_new_content_window_chromeflags.js => toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js rename : embedding/components/windowwatcher/test/browser_new_content_window_from_chrome_principal.js => toolkit/components/windowwatcher/test/browser_new_content_window_from_chrome_principal.js rename : embedding/components/windowwatcher/test/browser_new_remote_window_flags.js => toolkit/components/windowwatcher/test/browser_new_remote_window_flags.js rename : embedding/components/windowwatcher/test/browser_new_sized_window.js => toolkit/components/windowwatcher/test/browser_new_sized_window.js rename : embedding/components/windowwatcher/test/chrome.ini => toolkit/components/windowwatcher/test/chrome.ini rename : embedding/components/windowwatcher/test/file_storage_copied.html => toolkit/components/windowwatcher/test/file_storage_copied.html rename : embedding/components/windowwatcher/test/file_test_dialog.html => toolkit/components/windowwatcher/test/file_test_dialog.html rename : embedding/components/windowwatcher/test/mochitest.ini => toolkit/components/windowwatcher/test/mochitest.ini rename : embedding/components/windowwatcher/test/moz.build => toolkit/components/windowwatcher/test/moz.build rename : embedding/components/windowwatcher/test/test_blank_named_window.html => toolkit/components/windowwatcher/test/test_blank_named_window.html rename : embedding/components/windowwatcher/test/test_dialog_arguments.html => toolkit/components/windowwatcher/test/test_dialog_arguments.html rename : embedding/components/windowwatcher/test/test_modal_windows.html => toolkit/components/windowwatcher/test/test_modal_windows.html rename : embedding/components/windowwatcher/test/test_named_window.html => toolkit/components/windowwatcher/test/test_named_window.html rename : embedding/components/windowwatcher/test/test_storage_copied.html => toolkit/components/windowwatcher/test/test_storage_copied.html rename : embedding/components/appstartup/nsAppStartupNotifier.cpp => toolkit/xre/nsAppStartupNotifier.cpp rename : embedding/components/appstartup/nsAppStartupNotifier.h => toolkit/xre/nsAppStartupNotifier.h rename : embedding/components/build/nsEmbeddingModule.cpp => toolkit/xre/nsEmbeddingModule.cpp rename : embedding/components/appstartup/nsIAppStartupNotifier.h => toolkit/xre/nsIAppStartupNotifier.h
		
			
				
	
	
		
			326 lines
		
	
	
	
		
			9.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			326 lines
		
	
	
	
		
			9.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 | |
| /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 | |
| /* This Source Code Form is subject to the terms of the Mozilla Public
 | |
|  * License, v. 2.0. If a copy of the MPL was not distributed with this
 | |
|  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 | |
| 
 | |
| #include "nsContextMenuInfo.h"
 | |
| 
 | |
| #include "nsIImageLoadingContent.h"
 | |
| #include "imgLoader.h"
 | |
| #include "nsIDOMDocument.h"
 | |
| #include "nsIDOMHTMLDocument.h"
 | |
| #include "nsIDOMHTMLElement.h"
 | |
| #include "nsIDOMHTMLHtmlElement.h"
 | |
| #include "nsIDOMHTMLAnchorElement.h"
 | |
| #include "nsIDOMHTMLImageElement.h"
 | |
| #include "nsIDOMHTMLAreaElement.h"
 | |
| #include "nsIDOMHTMLLinkElement.h"
 | |
| #include "nsIDOMWindow.h"
 | |
| #include "nsICSSDeclaration.h"
 | |
| #include "nsIDOMCSSValue.h"
 | |
| #include "nsIDOMCSSPrimitiveValue.h"
 | |
| #include "nsNetUtil.h"
 | |
| #include "nsUnicharUtils.h"
 | |
| #include "nsIDocument.h"
 | |
| #include "nsIPrincipal.h"
 | |
| #include "nsIContentSecurityPolicy.h"
 | |
| #include "nsIContentPolicy.h"
 | |
| #include "imgRequestProxy.h"
 | |
| 
 | |
| using mozilla::dom::Element;
 | |
| using mozilla::ErrorResult;
 | |
| 
 | |
| NS_IMPL_ISUPPORTS(nsContextMenuInfo, nsIContextMenuInfo)
 | |
| 
 | |
| nsContextMenuInfo::nsContextMenuInfo()
 | |
| {
 | |
| }
 | |
| 
 | |
| nsContextMenuInfo::~nsContextMenuInfo()
 | |
| {
 | |
| }
 | |
| 
 | |
| NS_IMETHODIMP
 | |
| nsContextMenuInfo::GetMouseEvent(nsIDOMEvent** aEvent)
 | |
| {
 | |
|   NS_ENSURE_ARG_POINTER(aEvent);
 | |
|   NS_IF_ADDREF(*aEvent = mMouseEvent);
 | |
|   return NS_OK;
 | |
| }
 | |
| 
 | |
| NS_IMETHODIMP
 | |
| nsContextMenuInfo::GetTargetNode(nsIDOMNode** aNode)
 | |
| {
 | |
|   NS_ENSURE_ARG_POINTER(aNode);
 | |
|   NS_IF_ADDREF(*aNode = mDOMNode);
 | |
|   return NS_OK;
 | |
| }
 | |
| 
 | |
| NS_IMETHODIMP
 | |
| nsContextMenuInfo::GetAssociatedLink(nsAString& aHRef)
 | |
| {
 | |
|   NS_ENSURE_STATE(mAssociatedLink);
 | |
|   aHRef.Truncate(0);
 | |
| 
 | |
|   nsCOMPtr<nsIDOMElement> content(do_QueryInterface(mAssociatedLink));
 | |
|   nsAutoString localName;
 | |
|   if (content) {
 | |
|     content->GetLocalName(localName);
 | |
|   }
 | |
| 
 | |
|   nsCOMPtr<nsIDOMElement> linkContent;
 | |
|   ToLowerCase(localName);
 | |
|   if (localName.EqualsLiteral("a") ||
 | |
|       localName.EqualsLiteral("area") ||
 | |
|       localName.EqualsLiteral("link")) {
 | |
|     bool hasAttr;
 | |
|     content->HasAttribute(NS_LITERAL_STRING("href"), &hasAttr);
 | |
|     if (hasAttr) {
 | |
|       linkContent = content;
 | |
|       nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(linkContent));
 | |
|       if (anchor) {
 | |
|         anchor->GetHref(aHRef);
 | |
|       } else {
 | |
|         nsCOMPtr<nsIDOMHTMLAreaElement> area(do_QueryInterface(linkContent));
 | |
|         if (area) {
 | |
|           area->GetHref(aHRef);
 | |
|         } else {
 | |
|           nsCOMPtr<nsIDOMHTMLLinkElement> link(do_QueryInterface(linkContent));
 | |
|           if (link) {
 | |
|             link->GetHref(aHRef);
 | |
|           }
 | |
|         }
 | |
|       }
 | |
|     }
 | |
|   } else {
 | |
|     nsCOMPtr<nsIDOMNode> curr;
 | |
|     mAssociatedLink->GetParentNode(getter_AddRefs(curr));
 | |
|     while (curr) {
 | |
|       content = do_QueryInterface(curr);
 | |
|       if (!content) {
 | |
|         break;
 | |
|       }
 | |
|       content->GetLocalName(localName);
 | |
|       ToLowerCase(localName);
 | |
|       if (localName.EqualsLiteral("a")) {
 | |
|         bool hasAttr;
 | |
|         content->HasAttribute(NS_LITERAL_STRING("href"), &hasAttr);
 | |
|         if (hasAttr) {
 | |
|           linkContent = content;
 | |
|           nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(
 | |
|             do_QueryInterface(linkContent));
 | |
|           if (anchor) {
 | |
|             anchor->GetHref(aHRef);
 | |
|           }
 | |
|         } else {
 | |
|           linkContent = nullptr; // Links can't be nested.
 | |
|         }
 | |
|         break;
 | |
|       }
 | |
| 
 | |
|       nsCOMPtr<nsIDOMNode> temp = curr;
 | |
|       temp->GetParentNode(getter_AddRefs(curr));
 | |
|     }
 | |
|   }
 | |
| 
 | |
|   return NS_OK;
 | |
| }
 | |
| 
 | |
| NS_IMETHODIMP
 | |
| nsContextMenuInfo::GetImageContainer(imgIContainer** aImageContainer)
 | |
| {
 | |
|   NS_ENSURE_ARG_POINTER(aImageContainer);
 | |
|   NS_ENSURE_STATE(mDOMNode);
 | |
| 
 | |
|   nsCOMPtr<imgIRequest> request;
 | |
|   GetImageRequest(mDOMNode, getter_AddRefs(request));
 | |
|   if (request) {
 | |
|     return request->GetImage(aImageContainer);
 | |
|   }
 | |
| 
 | |
|   return NS_ERROR_FAILURE;
 | |
| }
 | |
| 
 | |
| NS_IMETHODIMP
 | |
| nsContextMenuInfo::GetImageSrc(nsIURI** aURI)
 | |
| {
 | |
|   NS_ENSURE_ARG_POINTER(aURI);
 | |
|   NS_ENSURE_STATE(mDOMNode);
 | |
| 
 | |
|   nsCOMPtr<nsIImageLoadingContent> content(do_QueryInterface(mDOMNode));
 | |
|   NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
 | |
|   return content->GetCurrentURI(aURI);
 | |
| }
 | |
| 
 | |
| NS_IMETHODIMP
 | |
| nsContextMenuInfo::GetBackgroundImageContainer(imgIContainer** aImageContainer)
 | |
| {
 | |
|   NS_ENSURE_ARG_POINTER(aImageContainer);
 | |
|   NS_ENSURE_STATE(mDOMNode);
 | |
| 
 | |
|   RefPtr<imgRequestProxy> request;
 | |
|   GetBackgroundImageRequest(mDOMNode, getter_AddRefs(request));
 | |
|   if (request) {
 | |
|     return request->GetImage(aImageContainer);
 | |
|   }
 | |
| 
 | |
|   return NS_ERROR_FAILURE;
 | |
| }
 | |
| 
 | |
| NS_IMETHODIMP
 | |
| nsContextMenuInfo::GetBackgroundImageSrc(nsIURI** aURI)
 | |
| {
 | |
|   NS_ENSURE_ARG_POINTER(aURI);
 | |
|   NS_ENSURE_STATE(mDOMNode);
 | |
| 
 | |
|   RefPtr<imgRequestProxy> request;
 | |
|   GetBackgroundImageRequest(mDOMNode, getter_AddRefs(request));
 | |
|   if (request) {
 | |
|     return request->GetURI(aURI);
 | |
|   }
 | |
| 
 | |
|   return NS_ERROR_FAILURE;
 | |
| }
 | |
| 
 | |
| nsresult
 | |
| nsContextMenuInfo::GetImageRequest(nsIDOMNode* aDOMNode, imgIRequest** aRequest)
 | |
| {
 | |
|   NS_ENSURE_ARG(aDOMNode);
 | |
|   NS_ENSURE_ARG_POINTER(aRequest);
 | |
| 
 | |
|   // Get content
 | |
|   nsCOMPtr<nsIImageLoadingContent> content(do_QueryInterface(aDOMNode));
 | |
|   NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
 | |
| 
 | |
|   return content->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST, aRequest);
 | |
| }
 | |
| 
 | |
| bool
 | |
| nsContextMenuInfo::HasBackgroundImage(nsIDOMNode* aDOMNode)
 | |
| {
 | |
|   NS_ENSURE_TRUE(aDOMNode, false);
 | |
| 
 | |
|   RefPtr<imgRequestProxy> request;
 | |
|   GetBackgroundImageRequest(aDOMNode, getter_AddRefs(request));
 | |
| 
 | |
|   return (request != nullptr);
 | |
| }
 | |
| 
 | |
| nsresult
 | |
| nsContextMenuInfo::GetBackgroundImageRequest(nsIDOMNode* aDOMNode,
 | |
|                                              imgRequestProxy** aRequest)
 | |
| {
 | |
| 
 | |
|   NS_ENSURE_ARG(aDOMNode);
 | |
|   NS_ENSURE_ARG_POINTER(aRequest);
 | |
| 
 | |
|   nsCOMPtr<nsIDOMNode> domNode = aDOMNode;
 | |
| 
 | |
|   // special case for the <html> element: if it has no background-image
 | |
|   // we'll defer to <body>
 | |
|   nsCOMPtr<nsIDOMHTMLHtmlElement> htmlElement = do_QueryInterface(domNode);
 | |
|   if (htmlElement) {
 | |
|     nsCOMPtr<nsIDOMHTMLElement> element = do_QueryInterface(domNode);
 | |
|     nsAutoString nameSpace;
 | |
|     element->GetNamespaceURI(nameSpace);
 | |
|     if (nameSpace.IsEmpty()) {
 | |
|       nsresult rv = GetBackgroundImageRequestInternal(domNode, aRequest);
 | |
|       if (NS_SUCCEEDED(rv) && *aRequest) {
 | |
|         return NS_OK;
 | |
|       }
 | |
| 
 | |
|       // no background-image found
 | |
|       nsCOMPtr<nsIDOMDocument> document;
 | |
|       domNode->GetOwnerDocument(getter_AddRefs(document));
 | |
|       nsCOMPtr<nsIDOMHTMLDocument> htmlDocument(do_QueryInterface(document));
 | |
|       NS_ENSURE_TRUE(htmlDocument, NS_ERROR_FAILURE);
 | |
| 
 | |
|       nsCOMPtr<nsIDOMHTMLElement> body;
 | |
|       htmlDocument->GetBody(getter_AddRefs(body));
 | |
|       domNode = do_QueryInterface(body);
 | |
|       NS_ENSURE_TRUE(domNode, NS_ERROR_FAILURE);
 | |
|     }
 | |
|   }
 | |
|   return GetBackgroundImageRequestInternal(domNode, aRequest);
 | |
| }
 | |
| 
 | |
| nsresult
 | |
| nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode* aDOMNode,
 | |
|                                                      imgRequestProxy** aRequest)
 | |
| {
 | |
|   NS_ENSURE_ARG_POINTER(aDOMNode);
 | |
| 
 | |
|   nsCOMPtr<nsIDOMNode> domNode = aDOMNode;
 | |
|   nsCOMPtr<nsIDOMNode> parentNode;
 | |
| 
 | |
|   nsCOMPtr<nsIDOMDocument> document;
 | |
|   domNode->GetOwnerDocument(getter_AddRefs(document));
 | |
|   NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
 | |
| 
 | |
|   nsCOMPtr<mozIDOMWindowProxy> window;
 | |
|   document->GetDefaultView(getter_AddRefs(window));
 | |
|   NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
 | |
| 
 | |
|   auto* piWindow = nsPIDOMWindowOuter::From(window);
 | |
|   nsPIDOMWindowInner* innerWindow = piWindow->GetCurrentInnerWindow();
 | |
|   MOZ_ASSERT(innerWindow);
 | |
| 
 | |
|   nsCOMPtr<nsIDOMCSSPrimitiveValue> primitiveValue;
 | |
|   nsAutoString bgStringValue;
 | |
| 
 | |
|   nsCOMPtr<nsIDocument> doc(do_QueryInterface(document));
 | |
|   nsCOMPtr<nsIPrincipal> principal = doc ? doc->NodePrincipal() : nullptr;
 | |
| 
 | |
|   while (true) {
 | |
|     nsCOMPtr<Element> domElement(do_QueryInterface(domNode));
 | |
|     // bail for the parent node of the root element or null argument
 | |
|     if (!domElement) {
 | |
|       break;
 | |
|     }
 | |
| 
 | |
|     ErrorResult dummy;
 | |
|     nsCOMPtr<nsICSSDeclaration> computedStyle =
 | |
|       innerWindow->GetComputedStyle(*domElement, EmptyString(), dummy);
 | |
|     dummy.SuppressException();
 | |
|     if (computedStyle) {
 | |
|       nsCOMPtr<nsIDOMCSSValue> cssValue;
 | |
|       computedStyle->GetPropertyCSSValue(NS_LITERAL_STRING("background-image"),
 | |
|                                          getter_AddRefs(cssValue));
 | |
|       primitiveValue = do_QueryInterface(cssValue);
 | |
|       if (primitiveValue) {
 | |
|         primitiveValue->GetStringValue(bgStringValue);
 | |
|         if (!bgStringValue.EqualsLiteral("none")) {
 | |
|           nsCOMPtr<nsIURI> bgUri;
 | |
|           NS_NewURI(getter_AddRefs(bgUri), bgStringValue);
 | |
|           NS_ENSURE_TRUE(bgUri, NS_ERROR_FAILURE);
 | |
| 
 | |
|           imgLoader* il = imgLoader::NormalLoader();
 | |
|           NS_ENSURE_TRUE(il, NS_ERROR_FAILURE);
 | |
| 
 | |
|           return il->LoadImage(bgUri, nullptr, nullptr,
 | |
|                                doc->GetReferrerPolicy(), principal, nullptr,
 | |
|                                nullptr, nullptr, nullptr, nsIRequest::LOAD_NORMAL,
 | |
|                                nullptr, nsIContentPolicy::TYPE_INTERNAL_IMAGE,
 | |
|                                EmptyString(), aRequest);
 | |
|         }
 | |
|       }
 | |
| 
 | |
|       // bail if we encounter non-transparent background-color
 | |
|       computedStyle->GetPropertyCSSValue(NS_LITERAL_STRING("background-color"),
 | |
|                                          getter_AddRefs(cssValue));
 | |
|       primitiveValue = do_QueryInterface(cssValue);
 | |
|       if (primitiveValue) {
 | |
|         primitiveValue->GetStringValue(bgStringValue);
 | |
|         if (!bgStringValue.EqualsLiteral("transparent")) {
 | |
|           return NS_ERROR_FAILURE;
 | |
|         }
 | |
|       }
 | |
|     }
 | |
| 
 | |
|     domNode->GetParentNode(getter_AddRefs(parentNode));
 | |
|     domNode = parentNode;
 | |
|   }
 | |
| 
 | |
|   return NS_ERROR_FAILURE;
 | |
| }
 |