зеркало из https://github.com/mozilla/gecko-dev.git
merge m-c to devtools
This commit is contained in:
Коммит
1e7e540ad1
|
@ -45,8 +45,6 @@
|
|||
#include "nsCoreUtils.h"
|
||||
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include "nsAccEvent.h"
|
||||
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsIDOMXULMultSelectCntrlEl.h"
|
||||
|
@ -203,7 +203,7 @@ AccEvent::CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput)
|
|||
return;
|
||||
}
|
||||
|
||||
nsIEventStateManager *esm = presShell->GetPresContext()->EventStateManager();
|
||||
nsEventStateManager *esm = presShell->GetPresContext()->EventStateManager();
|
||||
if (!esm) {
|
||||
NS_NOTREACHED("There should always be an ESM for an event");
|
||||
return;
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
#include "nsRootAccessibleWrap.h"
|
||||
#include "nsTextFragment.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsXULAlertAccessible.h"
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
#include "nsWhitespaceTokenizer.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
#include "nsIDOMCharacterData.h"
|
||||
|
|
|
@ -43,15 +43,12 @@
|
|||
#include "nsAccessNode.h"
|
||||
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOM3Node.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsIDocShell.h"
|
||||
|
@ -60,7 +57,7 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsISelection2.h"
|
||||
#include "nsISelectionController.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
@ -206,7 +203,7 @@ nsCoreUtils::GetAccessKeyFor(nsIContent *aContent)
|
|||
|
||||
// Accesskeys are registered by @accesskey attribute only. At first check
|
||||
// whether it is presented on the given element to avoid the slow
|
||||
// nsIEventStateManager::GetRegisteredAccessKey() method.
|
||||
// nsEventStateManager::GetRegisteredAccessKey() method.
|
||||
if (!aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::accesskey))
|
||||
return 0;
|
||||
|
||||
|
@ -222,13 +219,11 @@ nsCoreUtils::GetAccessKeyFor(nsIContent *aContent)
|
|||
if (!presContext)
|
||||
return 0;
|
||||
|
||||
nsIEventStateManager *esm = presContext->EventStateManager();
|
||||
nsEventStateManager *esm = presContext->EventStateManager();
|
||||
if (!esm)
|
||||
return 0;
|
||||
|
||||
PRUint32 key = 0;
|
||||
esm->GetRegisteredAccessKey(aContent, &key);
|
||||
return key;
|
||||
return esm->GetRegisteredAccessKey(aContent);
|
||||
}
|
||||
|
||||
nsIContent *
|
||||
|
@ -427,13 +422,12 @@ nsCoreUtils::GetScreenCoordsForWindow(nsINode *aNode)
|
|||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_GetInterface(rootTreeItem);
|
||||
nsCOMPtr<nsIDOMDocumentView> docView(do_QueryInterface(domDoc));
|
||||
if (!docView)
|
||||
if (!domDoc)
|
||||
return coords;
|
||||
|
||||
nsCOMPtr<nsIDOMAbstractView> abstractView;
|
||||
docView->GetDefaultView(getter_AddRefs(abstractView));
|
||||
nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(abstractView));
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
domDoc->GetDefaultView(getter_AddRefs(window));
|
||||
nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(window));
|
||||
if (!windowInter)
|
||||
return coords;
|
||||
|
||||
|
@ -599,14 +593,14 @@ nsCoreUtils::GetComputedStyleDeclaration(const nsAString& aPseudoElt,
|
|||
if (!document)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIDOMViewCSS> viewCSS(do_QueryInterface(document->GetWindow()));
|
||||
if (!viewCSS)
|
||||
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(document->GetWindow());
|
||||
if (!window)
|
||||
return nsnull;
|
||||
|
||||
nsIDOMCSSStyleDeclaration* cssDecl = nsnull;
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
|
||||
nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(content));
|
||||
viewCSS->GetComputedStyle(domElement, aPseudoElt, &cssDecl);
|
||||
return cssDecl;
|
||||
window->GetComputedStyle(domElement, aPseudoElt, getter_AddRefs(cssDecl));
|
||||
return cssDecl.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIBoxObject>
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
|
||||
/**
|
||||
* Return an accesskey registered on the given element by
|
||||
* nsIEventStateManager or 0 if there is no registered accesskey.
|
||||
* nsEventStateManager or 0 if there is no registered accesskey.
|
||||
*
|
||||
* @param aContent - the given element.
|
||||
*/
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMXULPopupElement.h"
|
||||
#include "nsIEditingSession.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsHTMLSelectAccessible.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "States.h"
|
||||
#include "nsCoreUtils.h"
|
||||
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHTMLLinkAccessible
|
||||
|
|
|
@ -47,11 +47,9 @@
|
|||
|
||||
#include "nsIClipboard.h"
|
||||
#include "nsContentCID.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMCharacterData.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIDOMNSRange.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMNSHTMLElement.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIPrefService.h"
|
||||
|
|
|
@ -401,7 +401,7 @@ nsXULMenuitemAccessible::GetKeyboardShortcut(nsAString& aAccessKey)
|
|||
static PRInt32 gMenuAccesskeyModifier = -1; // magic value of -1 indicates unitialized state
|
||||
|
||||
// We do not use nsCoreUtils::GetAccesskeyFor() because accesskeys for
|
||||
// menu are't registered by nsIEventStateManager.
|
||||
// menu are't registered by nsEventStateManager.
|
||||
nsAutoString accesskey;
|
||||
mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::accesskey,
|
||||
accesskey);
|
||||
|
|
|
@ -84,7 +84,7 @@ include $(topsrcdir)/config/rules.mk
|
|||
else
|
||||
# Build a binary bootstrapping with XRE_main
|
||||
|
||||
ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
|
||||
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
|
||||
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
|
||||
else
|
||||
PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
|
||||
|
@ -161,16 +161,8 @@ include $(topsrcdir)/config/config.mk
|
|||
ifdef _MSC_VER
|
||||
# Always enter a Windows program through wmain, whether or not we're
|
||||
# a console application.
|
||||
ifdef WINCE
|
||||
WIN32_EXE_LDFLAGS += -ENTRY:mainWCRTStartup
|
||||
else
|
||||
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef WINCE
|
||||
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME,corelibc)
|
||||
endif
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
include $(topsrcdir)/config/static-config.mk
|
||||
|
@ -189,7 +181,7 @@ OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 v
|
|||
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
|
||||
endif
|
||||
|
||||
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
RCINCLUDE = splash.rc
|
||||
ifndef GNU_CC
|
||||
RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
|
||||
|
@ -248,7 +240,7 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(filter-out OS2 WINNT WINCE,$(OS_ARCH)))
|
||||
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
|
||||
|
||||
$(MOZ_APP_NAME):: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS)
|
||||
cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \
|
||||
|
@ -290,13 +282,6 @@ libs::
|
|||
endif
|
||||
endif
|
||||
|
||||
ifdef WINCE
|
||||
ifdef MOZ_FASTSTART
|
||||
libs::
|
||||
cp -f $(DIST)/bin/faststartstub.exe $(DIST)/bin/$(MOZ_APP_NAME)faststart.exe
|
||||
endif
|
||||
endif
|
||||
|
||||
libs:: $(srcdir)/profile/prefs.js
|
||||
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
|
||||
|
||||
|
|
|
@ -308,12 +308,7 @@ pref("browser.download.saveLinkAsFilenameTimeout", 1000);
|
|||
|
||||
pref("browser.download.useDownloadDir", true);
|
||||
|
||||
#ifdef WINCE
|
||||
pref("browser.download.folderList", 2);
|
||||
pref("browser.download.dir", "\\Storage Card");
|
||||
#else
|
||||
pref("browser.download.folderList", 1);
|
||||
#endif
|
||||
pref("browser.download.manager.showAlertOnComplete", true);
|
||||
pref("browser.download.manager.showAlertInterval", 2000);
|
||||
pref("browser.download.manager.retention", 2);
|
||||
|
@ -371,11 +366,7 @@ pref("browser.link.open_newwindow", 3);
|
|||
pref("browser.link.open_newwindow.restriction", 2);
|
||||
|
||||
// Tabbed browser
|
||||
#ifndef WINCE
|
||||
pref("browser.tabs.autoHide", false);
|
||||
#else
|
||||
pref("browser.tabs.autoHide", true);
|
||||
#endif
|
||||
pref("browser.tabs.closeWindowWithLastTab", true);
|
||||
pref("browser.tabs.insertRelatedAfterCurrent", true);
|
||||
pref("browser.tabs.warnOnClose", true);
|
||||
|
@ -425,11 +416,6 @@ pref("javascript.options.showInConsole", true);
|
|||
pref("general.warnOnAboutConfig", false);
|
||||
#endif
|
||||
|
||||
#ifdef WINCE
|
||||
// Set the threshold higher to avoid some slow script warnings
|
||||
pref("dom.max_script_run_time", 20);
|
||||
#endif
|
||||
|
||||
// This is the pref to control the location bar, change this to true to
|
||||
// force this - this makes the origin of popup windows more obvious to avoid
|
||||
// spoofing. We would rather not do it by default because it affects UE for web
|
||||
|
@ -775,11 +761,7 @@ pref("browser.rights.3.shown", false);
|
|||
pref("browser.rights.override", true);
|
||||
#endif
|
||||
|
||||
#ifdef WINCE
|
||||
pref("browser.sessionstore.resume_from_crash", false);
|
||||
#else
|
||||
pref("browser.sessionstore.resume_from_crash", true);
|
||||
#endif
|
||||
pref("browser.sessionstore.resume_session_once", false);
|
||||
|
||||
// minimal interval between two save operations in milliseconds
|
||||
|
@ -899,39 +881,6 @@ pref("browser.bookmarks.editDialog.firstEditField", "namePicker");
|
|||
pref("geo.wifi.uri", "https://www.google.com/loc/json");
|
||||
pref("geo.wifi.protocol", 0);
|
||||
|
||||
#ifdef WINCE
|
||||
|
||||
// tweak awesomebar -- increase the delay until a search happens.
|
||||
pref("browser.urlbar.delay", 250);
|
||||
|
||||
// disable safe browsing, due to perf hit
|
||||
pref("browser.safebrowsing.enabled", false);
|
||||
pref("browser.safebrowsing.malware.enabled", false);
|
||||
|
||||
// don't check for default browser
|
||||
pref("browser.shell.checkDefaultBrowser", false);
|
||||
|
||||
// disable bfcache for memory
|
||||
pref("browser.sessionhistory.max_total_viewers", 0);
|
||||
|
||||
pref("browser.sessionhistory.optimize_eviction", false);
|
||||
|
||||
// tweak default content sink prefs
|
||||
pref("content.sink.interactive_deflect_count", 10); /* default 0 */
|
||||
pref("content.sink.perf_deflect_count", 50); /* default 200 */
|
||||
pref("content.sink.interactive_parse_time", 5000); /* default 3000 */
|
||||
pref("content.sink.perf_parse_time", 150000); /* default 360000 */
|
||||
pref("content.sink.pending_event_mode", 0); /* default 1 */
|
||||
pref("content.sink.event_probe_rate", 1); /* default 1 */
|
||||
pref("content.sink.interactive_time", 750000); /* default 750000 */
|
||||
pref("content.sink.initial_perf_time", 500000); /* default 2000000 */
|
||||
pref("content.sink.enable_perf_mode", 0); /* default 0; 0 == switch, 1 == stay interactive, 2 == stay perf */
|
||||
|
||||
// Write sessionstore.js less often
|
||||
pref("browser.sessionstore.interval", 60000);
|
||||
|
||||
#endif /* WINCE */
|
||||
|
||||
// Whether to use a panel that looks like an OS X sheet for customization
|
||||
#ifdef XP_MACOSX
|
||||
pref("toolbar.customization.usesheet", true);
|
||||
|
@ -954,7 +903,6 @@ pref("dom.ipc.plugins.enabled", true);
|
|||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
#ifndef WINCE
|
||||
pref("browser.taskbar.previews.enable", false);
|
||||
pref("browser.taskbar.previews.max", 20);
|
||||
pref("browser.taskbar.previews.cachetime", 5);
|
||||
|
@ -965,7 +913,6 @@ pref("browser.taskbar.lists.maxListItemCount", 7);
|
|||
pref("browser.taskbar.lists.tasks.enabled", true);
|
||||
pref("browser.taskbar.lists.refreshInSeconds", 120);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
// The sync engines to use.
|
||||
|
|
|
@ -75,10 +75,8 @@ DEFINES += -DHAVE_SHELL_SERVICE=1
|
|||
endif
|
||||
|
||||
ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
|
||||
ifneq ($(OS_ARCH),WINCE)
|
||||
DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(filter windows, $(MOZ_WIDGET_TOOLKIT)))
|
||||
DEFINES += -DCAN_DRAW_IN_TITLEBAR=1
|
||||
|
|
|
@ -91,7 +91,6 @@
|
|||
accesskey="&sendPageCmd.accesskey;"
|
||||
command="Browser:SendLink"/>
|
||||
<menuseparator/>
|
||||
#ifndef WINCE
|
||||
<menuitem id="menu_printSetup"
|
||||
label="&printSetupCmd.label;"
|
||||
accesskey="&printSetupCmd.accesskey;"
|
||||
|
@ -114,7 +113,6 @@
|
|||
oncommand="BrowserImport();"/>
|
||||
#ifndef XP_MACOSX
|
||||
<menuseparator/>
|
||||
#endif
|
||||
#endif
|
||||
<menuitem id="goOfflineMenuitem"
|
||||
label="&goOfflineCmd.label;"
|
||||
|
|
|
@ -42,6 +42,8 @@ let TabView = {
|
|||
_window: null,
|
||||
_firstUseExperienced: false,
|
||||
_browserKeyHandlerInitialized: false,
|
||||
_isFrameLoading: false,
|
||||
_initFrameCallbacks: [],
|
||||
VISIBILITY_IDENTIFIER: "tabview-visibility",
|
||||
|
||||
// ----------
|
||||
|
@ -128,34 +130,52 @@ let TabView = {
|
|||
// Creates the frame and calls the callback once it's loaded.
|
||||
// If the frame already exists, calls the callback immediately.
|
||||
_initFrame: function TabView__initFrame(callback) {
|
||||
let hasCallback = typeof callback == "function";
|
||||
|
||||
if (this._window) {
|
||||
if (typeof callback == "function")
|
||||
if (hasCallback)
|
||||
callback();
|
||||
} else {
|
||||
// ___ find the deck
|
||||
this._deck = document.getElementById("tab-view-deck");
|
||||
return;
|
||||
}
|
||||
|
||||
// ___ create the frame
|
||||
this._iframe = document.createElement("iframe");
|
||||
this._iframe.id = "tab-view";
|
||||
this._iframe.setAttribute("transparent", "true");
|
||||
this._iframe.flex = 1;
|
||||
if (hasCallback)
|
||||
this._initFrameCallbacks.push(callback);
|
||||
|
||||
if (typeof callback == "function")
|
||||
window.addEventListener("tabviewframeinitialized", callback, false);
|
||||
if (this._isFrameLoading)
|
||||
return;
|
||||
|
||||
this._iframe.setAttribute("src", "chrome://browser/content/tabview.html");
|
||||
this._deck.appendChild(this._iframe);
|
||||
this._window = this._iframe.contentWindow;
|
||||
this._isFrameLoading = true;
|
||||
|
||||
if (this._tabShowEventListener) {
|
||||
// ___ find the deck
|
||||
this._deck = document.getElementById("tab-view-deck");
|
||||
|
||||
// ___ create the frame
|
||||
this._iframe = document.createElement("iframe");
|
||||
this._iframe.id = "tab-view";
|
||||
this._iframe.setAttribute("transparent", "true");
|
||||
this._iframe.flex = 1;
|
||||
|
||||
let self = this;
|
||||
|
||||
window.addEventListener("tabviewframeinitialized", function onInit() {
|
||||
window.removeEventListener("tabviewframeinitialized", onInit, false);
|
||||
|
||||
self._isFrameLoading = false;
|
||||
self._window = self._iframe.contentWindow;
|
||||
self._setBrowserKeyHandlers();
|
||||
|
||||
if (self._tabShowEventListener) {
|
||||
gBrowser.tabContainer.removeEventListener(
|
||||
"TabShow", this._tabShowEventListener, true);
|
||||
this._tabShowEventListener = null;
|
||||
"TabShow", self._tabShowEventListener, true);
|
||||
self._tabShowEventListener = null;
|
||||
}
|
||||
|
||||
this._setBrowserKeyHandlers();
|
||||
}
|
||||
self._initFrameCallbacks.forEach(function (cb) cb());
|
||||
self._initFrameCallbacks = [];
|
||||
}, false);
|
||||
|
||||
this._iframe.setAttribute("src", "chrome://browser/content/tabview.html");
|
||||
this._deck.appendChild(this._iframe);
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
|
|
@ -189,7 +189,6 @@ let gInitialPages = [
|
|||
|
||||
XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
|
||||
#ifdef XP_WIN
|
||||
#ifndef WINCE
|
||||
const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
|
||||
if (WINTASKBAR_CONTRACTID in Cc &&
|
||||
Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
|
||||
|
@ -205,7 +204,6 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
|
|||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -467,11 +467,7 @@
|
|||
|
||||
<toolbox id="navigator-toolbox"
|
||||
defaultmode="icons" mode="icons"
|
||||
#ifdef WINCE
|
||||
defaulticonsize="small" iconsize="small"
|
||||
#else
|
||||
iconsize="large"
|
||||
#endif
|
||||
tabsontop="true"
|
||||
persist="tabsontop">
|
||||
<!-- Menu -->
|
||||
|
@ -499,13 +495,8 @@
|
|||
<toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
|
||||
toolbarname="&navbarCmd.label;" accesskey="&navbarCmd.accesskey;"
|
||||
fullscreentoolbar="true" mode="icons" customizable="true"
|
||||
#ifdef WINCE
|
||||
iconsize="small" defaulticonsize="small"
|
||||
defaultset="unified-back-forward-button,urlbar-container,reload-button,stop-button,search-container,home-button,bookmarks-menu-button-container,navigator-throbber,fullscreenflex,window-controls"
|
||||
#else
|
||||
iconsize="large"
|
||||
defaultset="unified-back-forward-button,urlbar-container,reload-button,stop-button,search-container,home-button,bookmarks-menu-button-container,fullscreenflex,window-controls"
|
||||
#endif
|
||||
context="toolbar-context-menu">
|
||||
|
||||
<toolbaritem id="unified-back-forward-button" class="chromeclass-toolbar-additional"
|
||||
|
|
|
@ -374,5 +374,7 @@ function previousVisitCount(host, endTimeReference) {
|
|||
|
||||
var result = historyService.executeQuery(query, options);
|
||||
result.root.containerOpen = true;
|
||||
return result.root.childCount;
|
||||
var cc = result.root.childCount;
|
||||
result.root.containerOpen = false;
|
||||
return cc;
|
||||
}
|
||||
|
|
|
@ -166,8 +166,10 @@ function GroupItem(listOfEls, options) {
|
|||
this.$titleShield = iQ('.title-shield', this.$titlebar);
|
||||
this.setTitle(options.title);
|
||||
|
||||
var handleKeyDown = function(e) {
|
||||
if (e.which == 13 || e.which == 27) { // return & escape
|
||||
var handleKeyPress = function (e) {
|
||||
if (e.keyCode == KeyEvent.DOM_VK_ESCAPE ||
|
||||
e.keyCode == KeyEvent.DOM_VK_RETURN ||
|
||||
e.keyCode == KeyEvent.DOM_VK_ENTER) {
|
||||
(self.$title)[0].blur();
|
||||
self.$title
|
||||
.addClass("transparentBorder")
|
||||
|
@ -204,7 +206,7 @@ function GroupItem(listOfEls, options) {
|
|||
.mousedown(function(e) {
|
||||
e.stopPropagation();
|
||||
})
|
||||
.keydown(handleKeyDown)
|
||||
.keypress(handleKeyPress)
|
||||
.keyup(handleKeyUp);
|
||||
|
||||
this.$titleShield
|
||||
|
|
|
@ -705,88 +705,6 @@ function test_renotify_installed() {
|
|||
},
|
||||
|
||||
function test_cancel_restart() {
|
||||
// If the XPI is already cached then the HTTP observer won't see the request
|
||||
var cacheService = Cc["@mozilla.org/network/cache-service;1"].
|
||||
getService(Ci.nsICacheService);
|
||||
try {
|
||||
cacheService.evictEntries(Components.interfaces.nsICache.STORE_ANYWHERE);
|
||||
} catch(ex) {}
|
||||
|
||||
// Must be registered before any request starts
|
||||
var observerService = Cc["@mozilla.org/network/http-activity-distributor;1"].
|
||||
getService(Ci.nsIHttpActivityDistributor);
|
||||
observerService.addObserver({
|
||||
observeActivity: function(aChannel, aType, aSubtype, aTimestamp, aSizeData,
|
||||
aStringData) {
|
||||
aChannel.QueryInterface(Ci.nsIChannel);
|
||||
|
||||
// Wait for the first event for the download
|
||||
if (aChannel.URI.spec != TESTROOT + "unsigned.xpi" ||
|
||||
aType != Ci.nsIHttpActivityObserver.ACTIVITY_TYPE_HTTP_TRANSACTION ||
|
||||
aSubtype != Ci.nsIHttpActivityObserver.ACTIVITY_SUBTYPE_REQUEST_HEADER)
|
||||
return;
|
||||
|
||||
observerService.removeObserver(this);
|
||||
|
||||
info("Replacing channel");
|
||||
aChannel.QueryInterface(Ci.nsITraceableChannel);
|
||||
var listener = aChannel.setNewListener({
|
||||
onStartRequest: function(aRequest, aContext) {
|
||||
listener.onStartRequest(aRequest, aContext);
|
||||
},
|
||||
|
||||
onDataAvailable: function(aRequest, aContext, aInputStream, aOffset, aCount) {
|
||||
listener.onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount);
|
||||
},
|
||||
|
||||
onStopRequest: function(aRequest, aContext, aStatusCode) {
|
||||
listener.onStopRequest(aRequest, aContext, aStatusCode);
|
||||
|
||||
// Request should have been cancelled
|
||||
is(aStatusCode, Components.results.NS_BINDING_ABORTED, "Should have seen a cancelled request");
|
||||
|
||||
// Notification should have changed to cancelled
|
||||
let notification = PopupNotifications.panel.childNodes[0];
|
||||
is(notification.id, "addon-install-cancelled-notification", "Should have seen the cancelled notification");
|
||||
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification(function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-install-complete-notification", "Should have seen the install complete");
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
"XPI Test will be installed after you restart " + gApp + ".",
|
||||
"Should have seen the right message");
|
||||
|
||||
AddonManager.getAllInstalls(function(aInstalls) {
|
||||
is(aInstalls.length, 1, "Should be one pending install");
|
||||
aInstalls[0].cancel();
|
||||
|
||||
Services.perms.remove("example.com", "install");
|
||||
wait_for_notification_close(runNextTest);
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
});
|
||||
});
|
||||
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
|
||||
// Restart the download
|
||||
info("Restarting download");
|
||||
EventUtils.synthesizeMouse(notification.button, 20, 10, {});
|
||||
|
||||
// Should be back to a progress notification
|
||||
ok(PopupNotifications.isPanelOpen, "Notification should still be open");
|
||||
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
|
||||
notification = PopupNotifications.panel.childNodes[0];
|
||||
is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Wait for the progress notification
|
||||
wait_for_notification(function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
|
@ -806,8 +724,44 @@ function test_cancel_restart() {
|
|||
let button = document.getAnonymousElementByAttribute(notification, "anonid", "cancel");
|
||||
|
||||
// Cancel the download
|
||||
info("Cancelling download");
|
||||
EventUtils.synthesizeMouse(button, 2, 2, {});
|
||||
|
||||
// Notification should have changed to cancelled
|
||||
notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-install-cancelled-notification", "Should have seen the cancelled notification");
|
||||
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification(function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-install-complete-notification", "Should have seen the install complete");
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
"XPI Test will be installed after you restart " + gApp + ".",
|
||||
"Should have seen the right message");
|
||||
|
||||
AddonManager.getAllInstalls(function(aInstalls) {
|
||||
is(aInstalls.length, 1, "Should be one pending install");
|
||||
aInstalls[0].cancel();
|
||||
|
||||
Services.perms.remove("example.com", "install");
|
||||
wait_for_notification_close(runNextTest);
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
});
|
||||
});
|
||||
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
|
||||
// Restart the download
|
||||
EventUtils.synthesizeMouse(notification.button, 20, 10, {});
|
||||
|
||||
// Should be back to a progress notification
|
||||
ok(PopupNotifications.isPanelOpen, "Notification should still be open");
|
||||
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
|
||||
notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
|
||||
});
|
||||
|
||||
var pm = Services.perms;
|
||||
|
|
|
@ -131,6 +131,8 @@ _BROWSER_FILES = \
|
|||
browser_tabview_bug644097.js \
|
||||
browser_tabview_bug645653.js \
|
||||
browser_tabview_bug649006.js \
|
||||
browser_tabview_bug649307.js \
|
||||
browser_tabview_bug651311.js \
|
||||
browser_tabview_dragdrop.js \
|
||||
browser_tabview_exit_button.js \
|
||||
browser_tabview_expander.js \
|
||||
|
|
|
@ -34,7 +34,7 @@ function setupTwo(win) {
|
|||
|
||||
// force all canvases to update, and hook in imageData save detection
|
||||
tabItems.forEach(function(tabItem) {
|
||||
contentWindow.TabItems._update(tabItem.tab);
|
||||
contentWindow.TabItems.update(tabItem.tab);
|
||||
tabItem.addSubscriber(tabItem, "savedCachedImageData", function(item) {
|
||||
item.removeSubscriber(item, "savedCachedImageData");
|
||||
--numTabsToSave;
|
||||
|
@ -70,8 +70,7 @@ function setupTwo(win) {
|
|||
restoredWin.removeEventListener(
|
||||
"tabviewframeinitialized", onTabViewFrameInitialized, false);
|
||||
|
||||
let restoredContentWindow =
|
||||
restoredWin.document.getElementById("tab-view").contentWindow;
|
||||
let restoredContentWindow = restoredWin.TabView.getContentWindow();
|
||||
// prevent TabItems._update being called before checking cached images
|
||||
restoredContentWindow.TabItems._pauseUpdateForTest = true;
|
||||
|
||||
|
@ -134,8 +133,7 @@ let gTabsProgressListener = {
|
|||
|
||||
function updateAndCheck() {
|
||||
// force all canvas to update
|
||||
let contentWindow =
|
||||
restoredWin.document.getElementById("tab-view").contentWindow;
|
||||
let contentWindow = restoredWin.TabView.getContentWindow();
|
||||
|
||||
contentWindow.TabItems._pauseUpdateForTest = false;
|
||||
|
||||
|
|
|
@ -3,74 +3,46 @@
|
|||
|
||||
// Tests that groups behave properly when closing all tabs but app tabs.
|
||||
|
||||
let appTab, contentWindow;
|
||||
let originalGroup, originalGroupTab, newGroup, newGroupTab;
|
||||
|
||||
function test() {
|
||||
let cw, win, groupItem;
|
||||
|
||||
let onLoad = function (tvwin) {
|
||||
win = tvwin;
|
||||
registerCleanupFunction(function () win.close());
|
||||
win.gBrowser.pinTab(win.gBrowser.tabs[0]);
|
||||
win.gBrowser.loadOneTab("about:blank", {inBackground: true});
|
||||
};
|
||||
|
||||
let onShow = function () {
|
||||
cw = win.TabView.getContentWindow();
|
||||
is(cw.GroupItems.groupItems.length, 1, "There's only one group");
|
||||
|
||||
groupItem = createEmptyGroupItem(cw, 200, 200, 20);
|
||||
cw.GroupItems.setActiveGroupItem(groupItem);
|
||||
|
||||
executeSoon(function () hideTabView(onHide, win));
|
||||
};
|
||||
|
||||
let onHide = function () {
|
||||
let tab = win.gBrowser.loadOneTab("about:blank", {inBackground: true});
|
||||
is(groupItem.getChildren().length, 1, "One tab is in the new group");
|
||||
|
||||
executeSoon(function () {
|
||||
is(win.gBrowser.visibleTabs.length, 2, "There are two tabs displayed");
|
||||
win.gBrowser.removeTab(tab);
|
||||
|
||||
is(groupItem.getChildren().length, 0, "No tabs are in the new group");
|
||||
is(win.gBrowser.visibleTabs.length, 1, "There is one tab displayed");
|
||||
is(cw.GroupItems.groupItems.length, 2, "There are two groups still");
|
||||
|
||||
showTabView(function () {
|
||||
is(cw.GroupItems.groupItems.length, 1, "There is now only one group");
|
||||
waitForFocus(finish);
|
||||
}, win);
|
||||
});
|
||||
};
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
appTab = gBrowser.selectedTab;
|
||||
gBrowser.pinTab(appTab);
|
||||
originalGroupTab = gBrowser.addTab();
|
||||
|
||||
addEventListener("tabviewshown", createGroup, false);
|
||||
TabView.toggle();
|
||||
newWindowWithTabView(onShow, onLoad);
|
||||
}
|
||||
|
||||
function createGroup() {
|
||||
removeEventListener("tabviewshown", createGroup, false);
|
||||
|
||||
contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
is(contentWindow.GroupItems.groupItems.length, 1, "There's only one group");
|
||||
|
||||
originalGroup = contentWindow.GroupItems.groupItems[0];
|
||||
|
||||
// Create a new group.
|
||||
let box = new contentWindow.Rect(20, 400, 300, 300);
|
||||
newGroup = new contentWindow.GroupItem([], { bounds: box });
|
||||
|
||||
contentWindow.GroupItems.setActiveGroupItem(newGroup);
|
||||
|
||||
addEventListener("tabviewhidden", addTab, false);
|
||||
TabView.toggle();
|
||||
}
|
||||
|
||||
function addTab() {
|
||||
removeEventListener("tabviewhidden", addTab, false);
|
||||
|
||||
newGroupTab = gBrowser.addTab();
|
||||
is(newGroup.getChildren().length, 1, "One tab is in the new group");
|
||||
executeSoon(removeTab);
|
||||
}
|
||||
|
||||
function removeTab() {
|
||||
is(gBrowser.visibleTabs.length, 2, "There are two tabs displayed");
|
||||
gBrowser.removeTab(newGroupTab);
|
||||
|
||||
is(newGroup.getChildren().length, 0, "No tabs are in the new group");
|
||||
is(gBrowser.visibleTabs.length, 1, "There is one tab displayed");
|
||||
is(contentWindow.GroupItems.groupItems.length, 2,
|
||||
"There are two groups still");
|
||||
|
||||
addEventListener("tabviewshown", checkForRemovedGroup, false);
|
||||
TabView.toggle();
|
||||
}
|
||||
|
||||
function checkForRemovedGroup() {
|
||||
removeEventListener("tabviewshown", checkForRemovedGroup, false);
|
||||
|
||||
is(contentWindow.GroupItems.groupItems.length, 1,
|
||||
"There is now only one group");
|
||||
|
||||
addEventListener("tabviewhidden", finishTest, false);
|
||||
TabView.toggle();
|
||||
}
|
||||
|
||||
function finishTest() {
|
||||
removeEventListener("tabviewhidden", finishTest, false);
|
||||
|
||||
gBrowser.removeTab(originalGroupTab);
|
||||
gBrowser.unpinTab(appTab);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
newWindowWithTabView(function (win) {
|
||||
let cw = win.TabView.getContentWindow();
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
cw.gPrefBranch.clearUserPref("animate_zoom");
|
||||
win.close();
|
||||
});
|
||||
|
||||
cw.gPrefBranch.setBoolPref("animate_zoom", false);
|
||||
|
||||
let groupItem = cw.GroupItems.groupItems[0];
|
||||
let shield = groupItem.$titleShield[0];
|
||||
let keys = ["RETURN", "ENTER", "ESCAPE"];
|
||||
|
||||
ok(win.TabView.isVisible(), "tabview is visible");
|
||||
|
||||
let simulateKeyPress = function () {
|
||||
let key = keys.shift();
|
||||
|
||||
if (!key) {
|
||||
ok(win.TabView.isVisible(), "tabview is still visible");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(shield, {}, cw);
|
||||
EventUtils.synthesizeKey("VK_" + key, {}, cw);
|
||||
|
||||
executeSoon(function () {
|
||||
ok(win.TabView.isVisible(), "tabview is still visible [" + key + "]");
|
||||
simulateKeyPress();
|
||||
});
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(simulateKeyPress, cw);
|
||||
});
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let callCount = 0;
|
||||
|
||||
newWindow(function (win) {
|
||||
registerCleanupFunction(function () win.close());
|
||||
|
||||
win.TabView._initFrame(function () {
|
||||
is(callCount++, 0, "call count is zero");
|
||||
ok(win.TabView.getContentWindow().UI, "content window is loaded");
|
||||
});
|
||||
|
||||
win.TabView._initFrame(function () {
|
||||
is(callCount++, 1, "call count is one");
|
||||
ok(win.TabView.getContentWindow().UI, "content window is loaded");
|
||||
});
|
||||
|
||||
win.TabView._initFrame(function () {
|
||||
is(callCount, 2, "call count is two");
|
||||
ok(win.TabView.getContentWindow().UI, "content window is loaded");
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function newWindow(callback) {
|
||||
let opts = "chrome,all,dialog=no,height=800,width=800";
|
||||
let win = window.openDialog(getBrowserURL(), "_blank", opts);
|
||||
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
callback(win);
|
||||
}, false);
|
||||
}
|
|
@ -64,7 +64,7 @@
|
|||
<children/>
|
||||
<html:input anonid="input"
|
||||
class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
|
||||
flex="1" allowevents="true"
|
||||
allowevents="true"
|
||||
xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
|
||||
</xul:hbox>
|
||||
<children includes="hbox"/>
|
||||
|
|
|
@ -70,17 +70,12 @@ PARALLEL_DIRS = \
|
|||
sessionstore \
|
||||
shell \
|
||||
sidebar \
|
||||
migration \
|
||||
$(NULL)
|
||||
|
||||
ifndef WINCE
|
||||
PARALLEL_DIRS += migration
|
||||
endif
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
|
||||
ifndef WINCE
|
||||
PARALLEL_DIRS += wintaskbar
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_SAFE_BROWSING
|
||||
PARALLEL_DIRS += safebrowsing
|
||||
|
|
|
@ -54,13 +54,10 @@ endif
|
|||
|
||||
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib)
|
||||
|
||||
# migration requires mozreg, which doesn't build on WINCE; only include
|
||||
# it on non-CE
|
||||
ifndef WINCE
|
||||
# migration requires mozreg
|
||||
LOCAL_INCLUDES += -I$(srcdir)/../migration/src
|
||||
SHARED_LIBRARY_LIBS += ../migration/src/$(LIB_PREFIX)migration_s.$(LIB_SUFFIX)
|
||||
EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/lib/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
# This has to come after the above chunk, because mozreg_s has dependencies on
|
||||
# stuff in MOZ_COMPONENT_LIBS.
|
||||
|
|
|
@ -49,8 +49,6 @@
|
|||
#include "nsGNOMEShellService.h"
|
||||
#endif
|
||||
|
||||
#ifndef WINCE
|
||||
|
||||
#include "nsProfileMigrator.h"
|
||||
#include "nsDogbertProfileMigrator.h"
|
||||
#if !defined(XP_OS2)
|
||||
|
@ -68,8 +66,6 @@
|
|||
#include "nsICabProfileMigrator.h"
|
||||
#endif
|
||||
|
||||
#endif // WINCE
|
||||
|
||||
#include "rdf.h"
|
||||
#include "nsFeedSniffer.h"
|
||||
#include "AboutRedirector.h"
|
||||
|
@ -91,8 +87,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
|
||||
#endif
|
||||
|
||||
#ifndef WINCE
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDogbertProfileMigrator)
|
||||
#if !defined(XP_OS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsOperaProfileMigrator)
|
||||
|
@ -110,8 +104,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsCaminoProfileMigrator)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsICabProfileMigrator)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrivateBrowsingServiceWrapper, Init)
|
||||
|
@ -124,7 +116,6 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
|
|||
#endif
|
||||
NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
|
||||
#ifndef WINCE
|
||||
NS_DEFINE_NAMED_CID(NS_FIREFOX_PROFILEMIGRATOR_CID);
|
||||
#if defined(XP_WIN) && !defined(__MINGW32__)
|
||||
NS_DEFINE_NAMED_CID(NS_WINIEPROFILEMIGRATOR_CID);
|
||||
|
@ -142,7 +133,6 @@ NS_DEFINE_NAMED_CID(NS_OPERAPROFILEMIGRATOR_CID);
|
|||
NS_DEFINE_NAMED_CID(NS_DOGBERTPROFILEMIGRATOR_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_PHOENIXPROFILEMIGRATOR_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_SEAMONKEYPROFILEMIGRATOR_CID);
|
||||
#endif /* WINCE */
|
||||
NS_DEFINE_NAMED_CID(NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID);
|
||||
|
||||
static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
|
||||
|
@ -154,7 +144,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
|
|||
#endif
|
||||
{ &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
|
||||
{ &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, NULL, AboutRedirector::Create },
|
||||
#ifndef WINCE
|
||||
{ &kNS_FIREFOX_PROFILEMIGRATOR_CID, false, NULL, nsProfileMigratorConstructor },
|
||||
#if defined(XP_WIN) && !defined(__MINGW32__)
|
||||
{ &kNS_WINIEPROFILEMIGRATOR_CID, false, NULL, nsIEProfileMigratorConstructor },
|
||||
|
@ -172,7 +161,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
|
|||
{ &kNS_DOGBERTPROFILEMIGRATOR_CID, false, NULL, nsDogbertProfileMigratorConstructor },
|
||||
{ &kNS_PHOENIXPROFILEMIGRATOR_CID, false, NULL, nsPhoenixProfileMigratorConstructor },
|
||||
{ &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor },
|
||||
#endif /* WINCE */
|
||||
{ &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID, false, NULL, nsPrivateBrowsingServiceWrapperConstructor },
|
||||
{ NULL }
|
||||
};
|
||||
|
@ -198,7 +186,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
|
|||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
#endif
|
||||
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
|
||||
#ifndef WINCE
|
||||
{ NS_PROFILEMIGRATOR_CONTRACTID, &kNS_FIREFOX_PROFILEMIGRATOR_CID },
|
||||
#if defined(XP_WIN) && !defined(__MINGW32__)
|
||||
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "ie", &kNS_WINIEPROFILEMIGRATOR_CID },
|
||||
|
@ -216,7 +203,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
|
|||
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "dogbert", &kNS_DOGBERTPROFILEMIGRATOR_CID },
|
||||
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "phoenix", &kNS_PHOENIXPROFILEMIGRATOR_CID },
|
||||
{ NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID },
|
||||
#endif /* WINCE */
|
||||
{ NS_PRIVATE_BROWSING_SERVICE_CONTRACTID, &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID },
|
||||
{ NULL }
|
||||
};
|
||||
|
|
|
@ -370,7 +370,6 @@ BrowserGlue.prototype = {
|
|||
// the first browser window has finished initializing
|
||||
_onFirstWindowLoaded: function BG__onFirstWindowLoaded() {
|
||||
#ifdef XP_WIN
|
||||
#ifndef WINCE
|
||||
// For windows seven, initialize the jump list module.
|
||||
const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
|
||||
if (WINTASKBAR_CONTRACTID in Cc &&
|
||||
|
@ -379,26 +378,11 @@ BrowserGlue.prototype = {
|
|||
Cu.import("resource://gre/modules/WindowsJumpLists.jsm", temp);
|
||||
temp.WinTaskbarJumpList.startup();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
},
|
||||
|
||||
// profile shutdown handler (contains profile cleanup routines)
|
||||
_onProfileShutdown: function BG__onProfileShutdown() {
|
||||
#ifdef MOZ_UPDATER
|
||||
#ifdef WINCE
|
||||
// If there's a pending update, clear cache to free up disk space.
|
||||
try {
|
||||
let um = Cc["@mozilla.org/updates/update-manager;1"].
|
||||
getService(Ci.nsIUpdateManager);
|
||||
if (um.activeUpdate && um.activeUpdate.state == "pending") {
|
||||
let cacheService = Cc["@mozilla.org/network/cache-service;1"].
|
||||
getService(Ci.nsICacheService);
|
||||
cacheService.evictEntries(Ci.nsICache.STORE_ANYWHERE);
|
||||
}
|
||||
} catch (e) { }
|
||||
#endif
|
||||
#endif
|
||||
this._shutdownPlaces();
|
||||
this._sanitizer.onShutdown();
|
||||
},
|
||||
|
|
|
@ -39,8 +39,10 @@ function onLibraryReady() {
|
|||
tests.makeHistVisit();
|
||||
tests.makeTag();
|
||||
tests.focusTag();
|
||||
tests.copyHistNode();
|
||||
tests.waitForClipboard();
|
||||
waitForClipboard(function(aData) !!aData,
|
||||
tests.copyHistNode,
|
||||
onClipboardReady,
|
||||
PlacesUtils.TYPE_X_MOZ_PLACE);
|
||||
}
|
||||
|
||||
function onClipboardReady() {
|
||||
|
@ -114,24 +116,6 @@ let tests = {
|
|||
PlacesOrganizer._content.controller.copy();
|
||||
},
|
||||
|
||||
waitForClipboard: function (){
|
||||
try {
|
||||
let xferable = Cc["@mozilla.org/widget/transferable;1"].
|
||||
createInstance(Ci.nsITransferable);
|
||||
xferable.addDataFlavor(PlacesUtils.TYPE_X_MOZ_PLACE);
|
||||
let clipboard = Cc["@mozilla.org/widget/clipboard;1"].
|
||||
getService(Ci.nsIClipboard);
|
||||
clipboard.getData(xferable, Ci.nsIClipboard.kGlobalClipboard);
|
||||
let data = { }, type = { };
|
||||
xferable.getAnyTransferData(type, data, { });
|
||||
// Data is in the clipboard
|
||||
onClipboardReady();
|
||||
} catch (ex) {
|
||||
// check again after 100ms.
|
||||
setTimeout(arguments.callee, 100);
|
||||
}
|
||||
},
|
||||
|
||||
pasteToTag: function (){
|
||||
// paste history node into tag
|
||||
this.focusTag(true);
|
||||
|
|
|
@ -237,6 +237,7 @@ function test() {
|
|||
false, "cannot move a child of a read-only folder");
|
||||
is(PlacesControllerDragHelper.canMoveNode(childFolder),
|
||||
false, "cannot move a child node of a read-only folder node");
|
||||
readOnlyFolder.containerOpen = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -246,5 +247,6 @@ function test() {
|
|||
aTest.validate();
|
||||
});
|
||||
|
||||
rootNode.containerOpen = false;
|
||||
PlacesUtils.bookmarks.removeItem(rootId);
|
||||
}
|
||||
|
|
|
@ -78,6 +78,8 @@ function test() {
|
|||
var rawNode = PlacesUtils.unwrapNodes(serializedNode, PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER).shift();
|
||||
// confirm serialization
|
||||
ok(rawNode.type, "confirm json node");
|
||||
folderANode.containerOpen = false;
|
||||
|
||||
var transaction = PlacesUIUtils.makeTransaction(rawNode,
|
||||
PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER,
|
||||
testRootId,
|
||||
|
|
|
@ -2855,7 +2855,9 @@ SessionStoreService.prototype = {
|
|||
if (activeIndex >= tabData.entries.length)
|
||||
activeIndex = tabData.entries.length - 1;
|
||||
|
||||
// Reset currentURI.
|
||||
// Reset currentURI. This creates a new session history entry with a new
|
||||
// doc identifier, so we need to explicitly save and restore the old doc
|
||||
// identifier (corresponding to the SHEntry at activeIndex) below.
|
||||
browser.webNavigation.setCurrentURI(this._getURIFromString("about:blank"));
|
||||
|
||||
// Attach data that will be restored on "load" event, after tab is restored.
|
||||
|
|
|
@ -77,9 +77,7 @@
|
|||
<menupopup>
|
||||
<menuitem label="¢er.label;" value="CENTER"/>
|
||||
<menuitem label="&tile.label;" value="TILE"/>
|
||||
#ifndef WINCE
|
||||
<menuitem label="&stretch.label;" value="STRETCH"/>
|
||||
#endif
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<spacer flex="1"/>
|
||||
|
|
|
@ -47,7 +47,7 @@ XPIDL_MODULE = shellservice
|
|||
|
||||
XPIDLSRCS = nsIShellService.idl
|
||||
|
||||
ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
XPIDLSRCS += nsIWindowsShellService.idl
|
||||
endif
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ USE_STATIC_LIBS = 1
|
|||
endif
|
||||
|
||||
|
||||
ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
CPPSRCS = nsWindowsShellService.cpp
|
||||
else
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
|
|
|
@ -91,11 +91,7 @@
|
|||
|
||||
#define NS_TASKBAR_CONTRACTID "@mozilla.org/windows-taskbar;1"
|
||||
|
||||
#ifndef WINCE
|
||||
NS_IMPL_ISUPPORTS2(nsWindowsShellService, nsIWindowsShellService, nsIShellService)
|
||||
#else
|
||||
NS_IMPL_ISUPPORTS1(nsWindowsShellService, nsIShellService)
|
||||
#endif
|
||||
|
||||
static nsresult
|
||||
OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey)
|
||||
|
@ -115,33 +111,6 @@ OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef WINCE
|
||||
static nsresult
|
||||
OpenKeyForWriting(HKEY aStartKey, const nsAString& aKeyName, HKEY* aKey)
|
||||
{
|
||||
const nsString &flatName = PromiseFlatString(aKeyName);
|
||||
|
||||
DWORD dwDisp = 0;
|
||||
DWORD res = ::RegCreateKeyExW(aStartKey, flatName.get(), 0, NULL,
|
||||
0, KEY_READ | KEY_WRITE, NULL, aKey,
|
||||
&dwDisp);
|
||||
switch (res) {
|
||||
case ERROR_SUCCESS:
|
||||
break;
|
||||
case ERROR_ACCESS_DENIED:
|
||||
return NS_ERROR_FILE_ACCESS_DENIED;
|
||||
case ERROR_FILE_NOT_FOUND:
|
||||
res = ::RegCreateKeyExW(aStartKey, flatName.get(), 0, NULL,
|
||||
0, KEY_READ | KEY_WRITE, NULL, aKey,
|
||||
NULL);
|
||||
if (res != ERROR_SUCCESS)
|
||||
return NS_ERROR_FILE_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Default Browser Registry Settings
|
||||
//
|
||||
|
@ -217,23 +186,15 @@ typedef struct {
|
|||
char* valueData;
|
||||
} SETTING;
|
||||
|
||||
#ifndef WINCE
|
||||
#define APP_REG_NAME L"Firefox"
|
||||
#define CLS_HTML "FirefoxHTML"
|
||||
#define CLS_URL "FirefoxURL"
|
||||
#define CPL_DESKTOP L"Control Panel\\Desktop"
|
||||
#define VAL_OPEN "\"%APPPATH%\" -requestPending -osint -url \"%1\""
|
||||
#define VAL_FILE_ICON "%APPPATH%,1"
|
||||
#else
|
||||
#define CPL_DESKTOP L"ControlPanel\\Desktop"
|
||||
#define VAL_OPEN "\"%APPPATH%\" -osint -url \"%1\""
|
||||
#define VAL_FILE_ICON "%APPPATH%,-2"
|
||||
#endif
|
||||
|
||||
#define DI "\\DefaultIcon"
|
||||
#define SOP "\\shell\\open\\command"
|
||||
|
||||
|
||||
#define MAKE_KEY_NAME1(PREFIX, MID) \
|
||||
PREFIX MID
|
||||
|
||||
|
@ -243,28 +204,11 @@ typedef struct {
|
|||
// Handlers. see http://msdn2.microsoft.com/en-us/library/aa969357.aspx for
|
||||
// more info.
|
||||
static SETTING gSettings[] = {
|
||||
#ifndef WINCE
|
||||
// File Handler Class
|
||||
{ MAKE_KEY_NAME1(CLS_HTML, SOP), "", VAL_OPEN },
|
||||
|
||||
// Protocol Handler Class - for Vista and above
|
||||
{ MAKE_KEY_NAME1(CLS_URL, SOP), "", VAL_OPEN },
|
||||
#else
|
||||
{ MAKE_KEY_NAME1("FTP", DI), "", VAL_FILE_ICON },
|
||||
{ MAKE_KEY_NAME1("FTP", SOP), "", VAL_OPEN },
|
||||
|
||||
// File handlers for Windows CE
|
||||
{ MAKE_KEY_NAME1("bmpfile", DI), "", VAL_FILE_ICON },
|
||||
{ MAKE_KEY_NAME1("bmpfile", SOP), "", VAL_OPEN },
|
||||
{ MAKE_KEY_NAME1("giffile", DI), "", VAL_FILE_ICON },
|
||||
{ MAKE_KEY_NAME1("giffile", SOP), "", VAL_OPEN },
|
||||
{ MAKE_KEY_NAME1("jpegfile", DI), "", VAL_FILE_ICON },
|
||||
{ MAKE_KEY_NAME1("jpegfile", SOP), "", VAL_OPEN },
|
||||
{ MAKE_KEY_NAME1("pngfile", DI), "", VAL_FILE_ICON },
|
||||
{ MAKE_KEY_NAME1("pngfile", SOP), "", VAL_OPEN },
|
||||
{ MAKE_KEY_NAME1("htmlfile", DI), "", VAL_FILE_ICON },
|
||||
{ MAKE_KEY_NAME1("htmlfile", SOP), "", VAL_OPEN },
|
||||
#endif
|
||||
|
||||
// Protocol Handlers
|
||||
{ MAKE_KEY_NAME1("HTTP", DI), "", VAL_FILE_ICON },
|
||||
|
@ -273,7 +217,6 @@ static SETTING gSettings[] = {
|
|||
{ MAKE_KEY_NAME1("HTTPS", SOP), "", VAL_OPEN }
|
||||
};
|
||||
|
||||
#if !defined(WINCE)
|
||||
nsresult
|
||||
GetHelperPath(nsAutoString& aPath)
|
||||
{
|
||||
|
@ -313,12 +256,10 @@ LaunchHelper(nsAutoString& aPath)
|
|||
CloseHandle(pi.hThread);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif // !defined(WINCE)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowsShellService::ShortcutMaintenance()
|
||||
{
|
||||
#if !defined(WINCE)
|
||||
nsresult rv;
|
||||
|
||||
// Launch helper.exe so it can update the application user model ids on
|
||||
|
@ -388,13 +329,8 @@ nsWindowsShellService::ShortcutMaintenance()
|
|||
appHelperPath.AppendLiteral(" /UpdateShortcutAppUserModelIds");
|
||||
|
||||
return LaunchHelper(appHelperPath);
|
||||
#else
|
||||
NS_NOTREACHED("ShortcutMaintenance not implemented on wince!");
|
||||
return NS_OK;
|
||||
#endif // !defined(WINCE)
|
||||
}
|
||||
|
||||
#ifndef WINCE
|
||||
PRBool
|
||||
nsWindowsShellService::IsDefaultBrowserVista(PRBool* aIsDefaultBrowser)
|
||||
{
|
||||
|
@ -418,7 +354,6 @@ nsWindowsShellService::IsDefaultBrowserVista(PRBool* aIsDefaultBrowser)
|
|||
#endif
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
|
||||
|
@ -439,12 +374,10 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
|
|||
if (!::GetModuleFileNameW(0, exePath, MAX_BUF))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
#ifndef WINCE
|
||||
// Convert the path to a long path since GetModuleFileNameW returns the path
|
||||
// that was used to launch Firefox which is not necessarily a long path.
|
||||
if (!::GetLongPathNameW(exePath, exePath, MAX_BUF))
|
||||
return NS_ERROR_FAILURE;
|
||||
#endif
|
||||
|
||||
nsAutoString appLongPath(exePath);
|
||||
|
||||
|
@ -478,12 +411,10 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef WINCE
|
||||
// Only check if Firefox is the default browser on Vista if the previous
|
||||
// checks show that Firefox is the default browser.
|
||||
if (*aIsDefaultBrowser)
|
||||
IsDefaultBrowserVista(aIsDefaultBrowser);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -491,7 +422,6 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck,
|
|||
NS_IMETHODIMP
|
||||
nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUsers)
|
||||
{
|
||||
#ifndef WINCE
|
||||
nsAutoString appHelperPath;
|
||||
if (NS_FAILED(GetHelperPath(appHelperPath)))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -503,91 +433,8 @@ nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUs
|
|||
}
|
||||
|
||||
return LaunchHelper(appHelperPath);
|
||||
#else
|
||||
SETTING* settings;
|
||||
SETTING* end = gSettings + sizeof(gSettings)/sizeof(SETTING);
|
||||
|
||||
PRUnichar exePath[MAX_BUF];
|
||||
if (!::GetModuleFileNameW(0, exePath, MAX_BUF))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsAutoString appLongPath(exePath);
|
||||
|
||||
// The .png registry key isn't present by default so also add Content Type.
|
||||
SetRegKey(NS_LITERAL_STRING(".png"), EmptyString(),
|
||||
NS_LITERAL_STRING("pngfile"));
|
||||
SetRegKey(NS_LITERAL_STRING(".png"), NS_LITERAL_STRING("Content Type"),
|
||||
NS_LITERAL_STRING("image/png"));
|
||||
|
||||
// Set these keys to their default value for a clean install in case another
|
||||
// app has changed these keys.
|
||||
SetRegKey(NS_LITERAL_STRING(".htm"), EmptyString(),
|
||||
NS_LITERAL_STRING("htmlfile"));
|
||||
SetRegKey(NS_LITERAL_STRING(".html"), EmptyString(),
|
||||
NS_LITERAL_STRING("htmlfile"));
|
||||
SetRegKey(NS_LITERAL_STRING(".bmp"), EmptyString(),
|
||||
NS_LITERAL_STRING("bmpfile"));
|
||||
SetRegKey(NS_LITERAL_STRING(".gif"), EmptyString(),
|
||||
NS_LITERAL_STRING("giffile"));
|
||||
SetRegKey(NS_LITERAL_STRING(".jpe"), EmptyString(),
|
||||
NS_LITERAL_STRING("jpegfile"));
|
||||
SetRegKey(NS_LITERAL_STRING(".jpg"), EmptyString(),
|
||||
NS_LITERAL_STRING("jpegfile"));
|
||||
SetRegKey(NS_LITERAL_STRING(".jpeg"), EmptyString(),
|
||||
NS_LITERAL_STRING("jpegfile"));
|
||||
|
||||
for (settings = gSettings; settings < end; ++settings) {
|
||||
NS_ConvertUTF8toUTF16 dataLongPath(settings->valueData);
|
||||
NS_ConvertUTF8toUTF16 key(settings->keyName);
|
||||
NS_ConvertUTF8toUTF16 value(settings->valueName);
|
||||
PRInt32 offset = dataLongPath.Find("%APPPATH%");
|
||||
dataLongPath.Replace(offset, 9, appLongPath);
|
||||
SetRegKey(key, value, dataLongPath);
|
||||
}
|
||||
// On Windows CE RegFlushKey can negatively impact performance if there are a
|
||||
// lot of pending writes to the HKEY_CLASSES_ROOT registry hive but it is
|
||||
// necessary to save the values in the case where the user performs a hard
|
||||
// power off of the device.
|
||||
::RegFlushKey(HKEY_CLASSES_ROOT);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef WINCE
|
||||
void
|
||||
nsWindowsShellService::SetRegKey(const nsString& aKeyName,
|
||||
const nsString& aValueName,
|
||||
const nsString& aValue)
|
||||
{
|
||||
PRUnichar buf[MAX_BUF];
|
||||
DWORD len = sizeof buf;
|
||||
|
||||
HKEY theKey;
|
||||
nsresult rv = OpenKeyForWriting(HKEY_CLASSES_ROOT, aKeyName, &theKey);
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
|
||||
// Get the current value.
|
||||
DWORD res = ::RegQueryValueExW(theKey, PromiseFlatString(aValueName).get(),
|
||||
NULL, NULL, (LPBYTE)buf, &len);
|
||||
|
||||
// Set the new value if it doesn't exist or it is different than the current
|
||||
// value.
|
||||
nsAutoString current(buf);
|
||||
if (REG_FAILED(res) || !current.Equals(aValue)) {
|
||||
const nsString &flatValue = PromiseFlatString(aValue);
|
||||
|
||||
::RegSetValueExW(theKey, PromiseFlatString(aValueName).get(),
|
||||
0, REG_SZ, (const BYTE *)flatValue.get(),
|
||||
(flatValue.Length() + 1) * sizeof(PRUnichar));
|
||||
}
|
||||
|
||||
// Close the key we opened.
|
||||
::RegCloseKey(theKey);
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowsShellService::GetShouldCheckDefaultBrowser(PRBool* aResult)
|
||||
{
|
||||
|
@ -768,7 +615,6 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
|||
0, NULL, REG_OPTION_NON_VOLATILE,
|
||||
KEY_WRITE, NULL, &key, &dwDisp);
|
||||
if (REG_SUCCEEDED(res)) {
|
||||
#ifndef WINCE
|
||||
PRUnichar tile[2], style[2];
|
||||
switch (aPosition) {
|
||||
case BACKGROUND_TILE:
|
||||
|
@ -795,25 +641,9 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
|||
0, REG_SZ, (const BYTE *)style, size);
|
||||
::SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, (PVOID)path.get(),
|
||||
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
|
||||
#else
|
||||
DWORD tile = (aPosition == BACKGROUND_TILE);
|
||||
::RegSetValueExW(key, L"Tile",
|
||||
0, REG_DWORD, (const BYTE *)&tile, sizeof(DWORD));
|
||||
// On WinCE SPI_SETDESKWALLPAPER isn't available, so set the registry
|
||||
// entry ourselves and then broadcast UI change
|
||||
PRInt32 size = (path.Length() + 1) * sizeof(PRUnichar);
|
||||
::RegSetValueExW(key, L"Wallpaper",
|
||||
0, REG_SZ, (const BYTE *)path.get(), size);
|
||||
::SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, NULL, 0);
|
||||
#endif
|
||||
|
||||
// Close the key we opened.
|
||||
::RegCloseKey(key);
|
||||
|
||||
#ifdef WINCE
|
||||
// Ensure that the writes are flushed in case of hard reboot
|
||||
::RegFlushKey(HKEY_CURRENT_USER);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
|
@ -939,9 +769,6 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
|
|||
|
||||
::SetSysColors(sizeof(aParameters) / sizeof(int), aParameters, colors);
|
||||
|
||||
// SetSysColors is persisting across sessions on Windows CE, so no need to
|
||||
// write to registry
|
||||
#ifndef WINCE
|
||||
PRBool result = PR_FALSE;
|
||||
DWORD dwDisp = 0;
|
||||
HKEY key;
|
||||
|
@ -963,11 +790,9 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
|
|||
|
||||
// Close the key we opened.
|
||||
::RegCloseKey(key);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifndef WINCE
|
||||
NS_IMETHODIMP
|
||||
nsWindowsShellService::GetUnreadMailCount(PRUint32* aCount)
|
||||
{
|
||||
|
@ -1027,7 +852,6 @@ nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
|
|||
::RegCloseKey(mailKey);
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,
|
||||
|
|
|
@ -46,11 +46,7 @@
|
|||
#include <windows.h>
|
||||
#include <ole2.h>
|
||||
|
||||
#ifndef WINCE
|
||||
class nsWindowsShellService : public nsIWindowsShellService
|
||||
#else
|
||||
class nsWindowsShellService : public nsIShellService
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
nsWindowsShellService() : mCheckedThisSession(PR_FALSE) {};
|
||||
|
@ -58,20 +54,12 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSISHELLSERVICE
|
||||
#ifndef WINCE
|
||||
NS_DECL_NSIWINDOWSSHELLSERVICE
|
||||
#endif
|
||||
|
||||
protected:
|
||||
#ifndef WINCE
|
||||
PRBool IsDefaultBrowserVista(PRBool* aIsDefaultBrowser);
|
||||
|
||||
PRBool GetMailAccountKey(HKEY* aResult);
|
||||
#else
|
||||
void SetRegKey(const nsString& aKeyName,
|
||||
const nsString& aValueName,
|
||||
const nsString& aValue);
|
||||
#endif
|
||||
|
||||
private:
|
||||
PRBool mCheckedThisSession;
|
||||
|
|
|
@ -37,10 +37,8 @@
|
|||
@BINPATH@/updater.ini
|
||||
@BINPATH@/dictionaries/*
|
||||
#ifdef XP_WIN32
|
||||
#ifndef WINCE
|
||||
@BINPATH@/uninstall/helper.exe
|
||||
#endif
|
||||
#endif
|
||||
|
||||
[xpcom]
|
||||
@BINPATH@/dependentlibs.list
|
||||
|
@ -62,9 +60,7 @@
|
|||
#else
|
||||
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@
|
||||
#endif
|
||||
#ifdef WINCE
|
||||
@BINPATH@/mozce_shunt.dll
|
||||
#elifdef XP_WIN32
|
||||
#ifdef XP_WIN32
|
||||
#ifndef MOZ_MEMORY
|
||||
#if _MSC_VER == 1400
|
||||
@BINPATH@/Microsoft.VC80.CRT.manifest
|
||||
|
@ -200,9 +196,7 @@
|
|||
@BINPATH@/components/layout_xul.xpt
|
||||
@BINPATH@/components/locale.xpt
|
||||
@BINPATH@/components/lwbrk.xpt
|
||||
#ifndef WINCE
|
||||
@BINPATH@/components/migration.xpt
|
||||
#endif
|
||||
@BINPATH@/components/mimetype.xpt
|
||||
@BINPATH@/components/mozfind.xpt
|
||||
@BINPATH@/components/necko_about.xpt
|
||||
|
@ -563,25 +557,6 @@ bin/libfreebl_32int64_3.so
|
|||
bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
||||
#endif
|
||||
|
||||
; [ActiveX]
|
||||
#ifdef WINCE
|
||||
#ifndef MOZ_NO_ACTIVEX_SUPPORT
|
||||
@BINPATH@/components/nsAxSecurityPolicy.js
|
||||
@BINPATH@/@PREF_DIR@/activex.js
|
||||
@BINPATH@/plugins/npmozax.dll
|
||||
@BINPATH@/plugins/nsIMozAxPlugin.xpt
|
||||
#endif
|
||||
#endif
|
||||
|
||||
; [FastStart]
|
||||
#ifdef WINCE
|
||||
#ifdef MOZ_FASTSTART
|
||||
@BINPATH@/firefoxfaststart.exe
|
||||
@BINPATH@/components/FastStartup.manifest
|
||||
@BINPATH@/components/FastStartup.js
|
||||
#endif
|
||||
#endif
|
||||
|
||||
; [OS/2]
|
||||
#ifdef XP_OS2
|
||||
@BINPATH@/MozSounds.cmd
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
REG_APP_DESC=$BrandShortName delivers safe, easy web browsing. A familiar user interface, enhanced security features including protection from online identity theft, and integrated search let you get the most out of the web.
|
||||
CONTEXT_OPTIONS=$BrandShortName &Options
|
||||
CONTEXT_SAFE_MODE=$BrandShortName &Safe Mode
|
||||
SAFE_MODE=Safe Mode
|
||||
OPTIONS_PAGE_TITLE=Setup Type
|
||||
OPTIONS_PAGE_SUBTITLE=Choose setup options
|
||||
SHORTCUTS_PAGE_TITLE=Set Up Shortcuts
|
||||
|
|
|
@ -64,6 +64,7 @@ include $(topsrcdir)/config/rules.mk
|
|||
|
||||
ifndef MOZ_MEMORY
|
||||
ifdef WIN32_REDIST_DIR
|
||||
ifndef MOZ_DEBUG
|
||||
|
||||
ifeq (1400,$(_MSC_VER))
|
||||
REDIST_FILES = \
|
||||
|
@ -96,5 +97,6 @@ libs::
|
|||
install --preserve-timestamps $(foreach f,$(REDIST_FILES),"$(WIN32_REDIST_DIR)"/$(f)) $(FINAL_TARGET)
|
||||
endif
|
||||
|
||||
endif # ! MOZ_DEBUG
|
||||
endif # WIN32_REDIST_DIR
|
||||
endif # ! MOZ_MEMORY
|
||||
|
|
|
@ -7256,7 +7256,7 @@ fi
|
|||
if test -z "$MOZ_MEMORY"; then
|
||||
case "${target}" in
|
||||
*-mingw*)
|
||||
if test -z "$WIN32_REDIST_DIR"; then
|
||||
if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
|
||||
AC_MSG_WARN([When not building jemalloc, you need to set WIN32_REDIST_DIR to the path to the Visual C++ Redist (usually VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT, for VC++ v8) if you intend to distribute your build.])
|
||||
fi
|
||||
;;
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
|
||||
function boom()
|
||||
{
|
||||
var f = document.getElementById("f");
|
||||
var w = f.contentWindow;
|
||||
f.parentNode.removeChild(f);
|
||||
w.localStorage;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom();"><iframe id="f" src="data:text/html,1"></iframe></body>
|
||||
</html>
|
|
@ -86,6 +86,7 @@ load 593302-2.html
|
|||
load 610571-1.html
|
||||
load 604262-1.html
|
||||
load 628599-1.html
|
||||
load 642022-1.html
|
||||
load 637214-1.svg
|
||||
load 637214-2.svg
|
||||
load 642022-1.html
|
||||
asserts(1) load 646184.html # Bug 651842
|
||||
|
|
|
@ -53,7 +53,6 @@ nsIContentIterator.h \
|
|||
nsContentErrors.h \
|
||||
nsContentPolicyUtils.h \
|
||||
nsContentUtils.h \
|
||||
nsIContentUtils.h \
|
||||
nsIDocument.h \
|
||||
nsIDocumentObserver.h \
|
||||
nsIMutationObserver.h \
|
||||
|
|
|
@ -132,6 +132,7 @@ class nsPresContext;
|
|||
class nsIChannel;
|
||||
struct nsIntMargin;
|
||||
class nsPIDOMWindow;
|
||||
class nsIDocumentLoaderFactory;
|
||||
|
||||
#ifndef have_PrefChangedFunc_typedef
|
||||
typedef int (*PR_CALLBACK PrefChangedFunc)(const char *, void *);
|
||||
|
@ -1758,6 +1759,18 @@ public:
|
|||
*/
|
||||
static bool AllowXULXBLForPrincipal(nsIPrincipal* aPrincipal);
|
||||
|
||||
enum ContentViewerType
|
||||
{
|
||||
TYPE_UNSUPPORTED,
|
||||
TYPE_CONTENT,
|
||||
TYPE_PLUGIN,
|
||||
TYPE_UNKNOWN
|
||||
};
|
||||
|
||||
static already_AddRefed<nsIDocumentLoaderFactory>
|
||||
FindInternalContentViewer(const char* aType,
|
||||
ContentViewerType* aLoaderType = nsnull);
|
||||
|
||||
private:
|
||||
static PRBool InitializeEventTable();
|
||||
|
||||
|
|
|
@ -789,7 +789,7 @@ public:
|
|||
/**
|
||||
* Method to get the _intrinsic_ content state of this content node. This is
|
||||
* the state that is independent of the node's presentation. To get the full
|
||||
* content state, use nsIEventStateManager. Also see nsIEventStateManager
|
||||
* content state, use nsEventStateManager. Also see nsEventStateManager
|
||||
* for the possible bits that could be set here.
|
||||
*/
|
||||
virtual nsEventStates IntrinsicState() const;
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#ifndef nsIContentUtils_h__
|
||||
#define nsIContentUtils_h__
|
||||
|
||||
#include "nsIDocumentLoaderFactory.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAString.h"
|
||||
#include "nsMargin.h"
|
||||
|
||||
class nsIInterfaceRequestor;
|
||||
|
||||
// {3682DD99-8560-44f4-9B8F-CCCE9D7B96FB}
|
||||
#define NS_ICONTENTUTILS_IID \
|
||||
{ 0x3682dd99, 0x8560, 0x44f4, \
|
||||
{ 0x9b, 0x8f, 0xcc, 0xce, 0x9d, 0x7b, 0x96, 0xfb } }
|
||||
|
||||
class nsIContentUtils : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTUTILS_IID)
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual PRBool IsSafeToRunScript();
|
||||
virtual PRBool ParseIntMarginValue(const nsAString& aString, nsIntMargin& result);
|
||||
|
||||
enum ContentViewerType
|
||||
{
|
||||
TYPE_UNSUPPORTED,
|
||||
TYPE_CONTENT,
|
||||
TYPE_PLUGIN,
|
||||
TYPE_UNKNOWN
|
||||
};
|
||||
|
||||
virtual already_AddRefed<nsIDocumentLoaderFactory>
|
||||
FindInternalContentViewer(const char* aType,
|
||||
ContentViewerType* aLoaderType = NULL);
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentUtils, NS_ICONTENTUTILS_IID)
|
||||
|
||||
// {c7193287-3e3d-467f-b6da-47b914eb4c83}
|
||||
#define NS_ICONTENTUTILS2_IID \
|
||||
{ 0xc7193287, 0x3e3d, 0x467f, \
|
||||
{ 0xb6, 0xda, 0x47, 0xb9, 0x14, 0xeb, 0x4c, 0x83 } }
|
||||
|
||||
class nsIContentUtils2 : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTUTILS2_IID)
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual nsIInterfaceRequestor* GetSameOriginChecker();
|
||||
// Returns NS_OK for same origin, error (NS_ERROR_DOM_BAD_URI) if not.
|
||||
virtual nsresult CheckSameOrigin(nsIChannel *aOldChannel, nsIChannel *aNewChannel);
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentUtils2, NS_ICONTENTUTILS2_IID)
|
||||
|
||||
#endif /* nsIContentUtils_h__ */
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include "Link.h"
|
||||
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIURL.h"
|
||||
|
||||
#include "nsContentUtils.h"
|
||||
|
|
|
@ -206,6 +206,7 @@ INCLUDES += \
|
|||
-I$(topsrcdir)/dom/ipc \
|
||||
-I$(topsrcdir)/js/src/xpconnect/src \
|
||||
-I$(topsrcdir)/caps/include \
|
||||
-I$(topsrcdir)/netwerk/base/src \
|
||||
$(NULL)
|
||||
|
||||
DEFINES += -D_IMPL_NS_LAYOUT
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentRange.h"
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "nsIDOMScriptObjectFactory.h"
|
||||
#include "nsDOMCID.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIContentUtils.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsIContent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
@ -169,7 +168,6 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
|
|||
#include "nsIChromeRegistry.h"
|
||||
#include "nsIMIMEHeaderParam.h"
|
||||
#include "nsIDOMXULCommandEvent.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsDOMDataTransfer.h"
|
||||
#include "nsHtml5Module.h"
|
||||
|
@ -5502,9 +5500,8 @@ nsContentUtils::DispatchXULCommand(nsIContent* aTarget,
|
|||
nsCOMPtr<nsIDOMXULCommandEvent> xulCommand = do_QueryInterface(event);
|
||||
nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(xulCommand);
|
||||
NS_ENSURE_STATE(pEvent);
|
||||
nsCOMPtr<nsIDOMAbstractView> view = do_QueryInterface(doc->GetWindow());
|
||||
nsresult rv = xulCommand->InitCommandEvent(NS_LITERAL_STRING("command"),
|
||||
PR_TRUE, PR_TRUE, view,
|
||||
PR_TRUE, PR_TRUE, doc->GetWindow(),
|
||||
0, aCtrl, aAlt, aShift, aMeta,
|
||||
aSourceEvent);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -6466,23 +6463,9 @@ nsContentUtils::AllowXULXBLForPrincipal(nsIPrincipal* aPrincipal)
|
|||
IsSitePermAllow(princURI, "allowXULXBL"));
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsIContentUtils, nsIContentUtils)
|
||||
|
||||
PRBool
|
||||
nsIContentUtils::IsSafeToRunScript()
|
||||
{
|
||||
return nsContentUtils::IsSafeToRunScript();
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsIContentUtils::ParseIntMarginValue(const nsAString& aString, nsIntMargin& result)
|
||||
{
|
||||
return nsContentUtils::ParseIntMarginValue(aString, result);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocumentLoaderFactory>
|
||||
nsIContentUtils::FindInternalContentViewer(const char* aType,
|
||||
ContentViewerType* aLoaderType)
|
||||
nsContentUtils::FindInternalContentViewer(const char* aType,
|
||||
ContentViewerType* aLoaderType)
|
||||
{
|
||||
if (aLoaderType) {
|
||||
*aLoaderType = TYPE_UNSUPPORTED;
|
||||
|
@ -6506,7 +6489,7 @@ nsIContentUtils::FindInternalContentViewer(const char* aType,
|
|||
*aLoaderType = TYPE_PLUGIN;
|
||||
else
|
||||
*aLoaderType = TYPE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
return docFactory.forget();
|
||||
}
|
||||
|
||||
|
@ -6544,17 +6527,3 @@ nsIContentUtils::FindInternalContentViewer(const char* aType,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsIContentUtils2, nsIContentUtils2)
|
||||
|
||||
nsIInterfaceRequestor*
|
||||
nsIContentUtils2::GetSameOriginChecker()
|
||||
{
|
||||
return nsContentUtils::GetSameOriginChecker();
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsIContentUtils2::CheckSameOrigin(nsIChannel *aOldChannel, nsIChannel *aNewChannel)
|
||||
{
|
||||
return nsContentUtils::CheckSameOrigin(aOldChannel, aNewChannel);
|
||||
}
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
#include "nsDocument.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsContentList.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
|
@ -76,8 +75,6 @@
|
|||
#include "nsDOMAttribute.h"
|
||||
#include "nsIDOMDOMStringList.h"
|
||||
#include "nsIDOMDOMImplementation.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
#include "mozilla/FunctionTimer.h"
|
||||
#include "nsGenericElement.h"
|
||||
|
@ -219,19 +216,14 @@ static PRLogModuleInfo* gCspPRLog;
|
|||
|
||||
nsIdentifierMapEntry::~nsIdentifierMapEntry()
|
||||
{
|
||||
if (mNameContentList && mNameContentList != NAME_NOT_VALID) {
|
||||
NS_RELEASE(mNameContentList);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsIdentifierMapEntry::Traverse(nsCycleCollectionTraversalCallback* aCallback)
|
||||
{
|
||||
if (mNameContentList != NAME_NOT_VALID) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(*aCallback,
|
||||
"mIdentifierMap mNameContentList");
|
||||
aCallback->NoteXPCOMChild(static_cast<nsIDOMNodeList*>(mNameContentList));
|
||||
}
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(*aCallback,
|
||||
"mIdentifierMap mNameContentList");
|
||||
aCallback->NoteXPCOMChild(static_cast<nsIDOMNodeList*>(mNameContentList));
|
||||
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(*aCallback, "mIdentifierMap mDocAllList");
|
||||
aCallback->NoteXPCOMChild(static_cast<nsIDOMNodeList*>(mDocAllList));
|
||||
|
@ -244,18 +236,6 @@ nsIdentifierMapEntry::Traverse(nsCycleCollectionTraversalCallback* aCallback)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsIdentifierMapEntry::SetInvalidName()
|
||||
{
|
||||
mNameContentList = NAME_NOT_VALID;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsIdentifierMapEntry::IsInvalidName()
|
||||
{
|
||||
return mNameContentList == NAME_NOT_VALID;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsIdentifierMapEntry::IsEmpty()
|
||||
{
|
||||
|
@ -263,15 +243,6 @@ nsIdentifierMapEntry::IsEmpty()
|
|||
!mChangeCallbacks && !mImageElement;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsIdentifierMapEntry::CreateNameContentList()
|
||||
{
|
||||
mNameContentList = new nsBaseContentList();
|
||||
NS_ENSURE_TRUE(mNameContentList, NS_ERROR_OUT_OF_MEMORY);
|
||||
NS_ADDREF(mNameContentList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Element*
|
||||
nsIdentifierMapEntry::GetIdElement()
|
||||
{
|
||||
|
@ -451,25 +422,20 @@ nsIdentifierMapEntry::SetImageElement(Element* aElement)
|
|||
void
|
||||
nsIdentifierMapEntry::AddNameElement(Element* aElement)
|
||||
{
|
||||
if (!mNameContentList || mNameContentList == NAME_NOT_VALID)
|
||||
return;
|
||||
|
||||
// NOTE: this indexof is absolutely needed, since we don't flush
|
||||
// content notifications when we do document.foo resolution. So
|
||||
// aContent may be in our list already and just now getting notified
|
||||
// for!
|
||||
// XXXbz with the HTML5 parser we can stop doing this!
|
||||
if (mNameContentList->IndexOf(aElement, PR_FALSE) < 0) {
|
||||
mNameContentList->AppendElement(aElement);
|
||||
if (!mNameContentList) {
|
||||
mNameContentList = new nsBaseContentList();
|
||||
}
|
||||
|
||||
mNameContentList->AppendElement(aElement);
|
||||
}
|
||||
|
||||
void
|
||||
nsIdentifierMapEntry::RemoveNameElement(Element* aElement)
|
||||
{
|
||||
if (mNameContentList && mNameContentList != NAME_NOT_VALID) {
|
||||
mNameContentList->RemoveElement(aElement);
|
||||
}
|
||||
NS_ASSERTION(mNameContentList &&
|
||||
mNameContentList->IndexOf(aElement, PR_FALSE) >= 0,
|
||||
"Attmpting to remove named element that doesn't exist");
|
||||
mNameContentList->RemoveElement(aElement);
|
||||
}
|
||||
|
||||
// Helper structs for the content->subdoc map
|
||||
|
@ -2584,14 +2550,10 @@ nsDocument::GetLastModified(nsAString& aLastModified)
|
|||
void
|
||||
nsDocument::AddToNameTable(Element *aElement, nsIAtom* aName)
|
||||
{
|
||||
if (!mIsRegularHTML)
|
||||
return;
|
||||
|
||||
nsIdentifierMapEntry *entry =
|
||||
mIdentifierMap.GetEntry(nsDependentAtomString(aName));
|
||||
|
||||
// entry is null if we're not tracking the elements with this name
|
||||
mIdentifierMap.PutEntry(nsDependentAtomString(aName));
|
||||
|
||||
// Null for out-of-memory
|
||||
if (entry) {
|
||||
entry->AddNameElement(aElement);
|
||||
}
|
||||
|
@ -2601,7 +2563,7 @@ void
|
|||
nsDocument::RemoveFromNameTable(Element *aElement, nsIAtom* aName)
|
||||
{
|
||||
// Speed up document teardown
|
||||
if (!mIsRegularHTML || mIdentifierMap.Count() == 0)
|
||||
if (mIdentifierMap.Count() == 0)
|
||||
return;
|
||||
|
||||
nsIdentifierMapEntry *entry =
|
||||
|
@ -5105,16 +5067,14 @@ nsDocument::CreateTreeWalker(nsIDOMNode *aRoot,
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetDefaultView(nsIDOMAbstractView** aDefaultView)
|
||||
nsDocument::GetDefaultView(nsIDOMWindow** aDefaultView)
|
||||
{
|
||||
nsPIDOMWindow* win = GetWindow();
|
||||
if (win) {
|
||||
return CallQueryInterface(win, aDefaultView);
|
||||
}
|
||||
|
||||
*aDefaultView = nsnull;
|
||||
|
||||
return NS_OK;
|
||||
nsPIDOMWindow* win = GetWindow();
|
||||
if (!win) {
|
||||
return NS_OK;
|
||||
}
|
||||
return CallQueryInterface(win, aDefaultView);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -5919,21 +5879,6 @@ nsDocument::SetXmlVersion(const nsAString& aXmlVersion)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetStrictErrorChecking(PRBool *aStrictErrorChecking)
|
||||
{
|
||||
// This attribute is true by default, and we don't really support it being false.
|
||||
*aStrictErrorChecking = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::SetStrictErrorChecking(PRBool aStrictErrorChecking)
|
||||
{
|
||||
// We don't really support non-strict error checking, so just no-op for now.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetDocumentURI(nsAString& aDocumentURI)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "nsTArray.h"
|
||||
#include "nsHashSets.h"
|
||||
#include "nsIDOMXMLDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMNSDocumentStyle.h"
|
||||
|
@ -168,14 +167,10 @@ public:
|
|||
PRBool IsInvalidName();
|
||||
void AddNameElement(Element* aElement);
|
||||
void RemoveNameElement(Element* aElement);
|
||||
PRBool HasNameContentList() {
|
||||
return mNameContentList != nsnull;
|
||||
}
|
||||
PRBool IsEmpty();
|
||||
nsBaseContentList* GetNameContentList() {
|
||||
return mNameContentList;
|
||||
}
|
||||
nsresult CreateNameContentList();
|
||||
|
||||
/**
|
||||
* Returns the element if we know the element associated with this
|
||||
|
@ -258,9 +253,7 @@ private:
|
|||
// empty if there are no elementswith this ID.
|
||||
// The elements are stored as weak pointers.
|
||||
nsSmallVoidArray mIdContentList;
|
||||
// NAME_NOT_VALID if this id cannot be used as a 'name'. Otherwise
|
||||
// stores Elements.
|
||||
nsBaseContentList *mNameContentList;
|
||||
nsRefPtr<nsBaseContentList> mNameContentList;
|
||||
nsRefPtr<nsContentList> mDocAllList;
|
||||
nsAutoPtr<nsTHashtable<ChangeCallbackEntry> > mChangeCallbacks;
|
||||
nsRefPtr<Element> mImageElement;
|
||||
|
@ -504,7 +497,6 @@ class nsDocument : public nsIDocument,
|
|||
public nsIDOMDocumentEvent,
|
||||
public nsIDOM3DocumentEvent,
|
||||
public nsIDOMNSDocumentStyle,
|
||||
public nsIDOMDocumentView,
|
||||
public nsIDOMDocumentRange,
|
||||
public nsIDOMDocumentTraversal,
|
||||
public nsIDOMDocumentXBL,
|
||||
|
@ -820,9 +812,6 @@ public:
|
|||
// nsIDOMNSDocumentStyle
|
||||
NS_DECL_NSIDOMNSDOCUMENTSTYLE
|
||||
|
||||
// nsIDOMDocumentView
|
||||
NS_DECL_NSIDOMDOCUMENTVIEW
|
||||
|
||||
// nsIDOMDocumentRange
|
||||
NS_DECL_NSIDOMDOCUMENTRANGE
|
||||
|
||||
|
@ -1269,7 +1258,6 @@ protected:
|
|||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocument, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNSDocument, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentEvent, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentView, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentTraversal, \
|
||||
nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument) \
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsFileDataProtocolHandler.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsSimpleURI.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsClassHashtable.h"
|
||||
|
@ -49,8 +49,6 @@
|
|||
#include "nsIObjectOutputStream.h"
|
||||
#include "nsIProgrammingLanguage.h"
|
||||
|
||||
static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID);
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Hash table
|
||||
struct FileDataInfo
|
||||
|
@ -132,47 +130,19 @@ GetFileDataInfo(const nsACString& aUri)
|
|||
|
||||
static NS_DEFINE_CID(kFILEDATAURICID, NS_FILEDATAURI_CID);
|
||||
|
||||
|
||||
// Use an extra base object to avoid having to manually retype all the
|
||||
// nsIURI methods. I wish we could just inherit from nsSimpleURI instead.
|
||||
class nsFileDataURI_base : public nsIURI,
|
||||
public nsIMutable
|
||||
class nsFileDataURI : public nsSimpleURI,
|
||||
public nsIURIWithPrincipal
|
||||
{
|
||||
public:
|
||||
nsFileDataURI_base(nsIURI* aSimpleURI) :
|
||||
mSimpleURI(aSimpleURI)
|
||||
{
|
||||
mMutable = do_QueryInterface(mSimpleURI);
|
||||
NS_ASSERTION(aSimpleURI && mMutable, "This isn't going to work out");
|
||||
}
|
||||
virtual ~nsFileDataURI_base() {}
|
||||
|
||||
// For use only from deserialization
|
||||
nsFileDataURI_base() {}
|
||||
|
||||
NS_FORWARD_NSIURI(mSimpleURI->)
|
||||
NS_FORWARD_NSIMUTABLE(mMutable->)
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIURI> mSimpleURI;
|
||||
nsCOMPtr<nsIMutable> mMutable;
|
||||
};
|
||||
|
||||
class nsFileDataURI : public nsFileDataURI_base,
|
||||
public nsIURIWithPrincipal,
|
||||
public nsISerializable,
|
||||
public nsIClassInfo
|
||||
{
|
||||
public:
|
||||
nsFileDataURI(nsIPrincipal* aPrincipal, nsIURI* aSimpleURI) :
|
||||
nsFileDataURI_base(aSimpleURI), mPrincipal(aPrincipal)
|
||||
nsFileDataURI(nsIPrincipal* aPrincipal) :
|
||||
nsSimpleURI(), mPrincipal(aPrincipal)
|
||||
{}
|
||||
virtual ~nsFileDataURI() {}
|
||||
|
||||
// For use only from deserialization
|
||||
nsFileDataURI() : nsFileDataURI_base() {}
|
||||
nsFileDataURI() : nsSimpleURI() {}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIURIWITHPRINCIPAL
|
||||
NS_DECL_NSISERIALIZABLE
|
||||
NS_DECL_NSICLASSINFO
|
||||
|
@ -181,22 +151,21 @@ public:
|
|||
NS_IMETHOD Clone(nsIURI** aClone);
|
||||
NS_IMETHOD Equals(nsIURI* aOther, PRBool *aResult);
|
||||
|
||||
// Override StartClone to hand back a nsFileDataURI
|
||||
virtual nsSimpleURI* StartClone()
|
||||
{ return new nsFileDataURI(); }
|
||||
|
||||
nsCOMPtr<nsIPrincipal> mPrincipal;
|
||||
};
|
||||
|
||||
NS_IMPL_ADDREF(nsFileDataURI)
|
||||
NS_IMPL_RELEASE(nsFileDataURI)
|
||||
NS_IMPL_ADDREF_INHERITED(nsFileDataURI, nsSimpleURI)
|
||||
NS_IMPL_RELEASE_INHERITED(nsFileDataURI, nsSimpleURI)
|
||||
NS_INTERFACE_MAP_BEGIN(nsFileDataURI)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIURI)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIURIWithPrincipal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISerializable)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIClassInfo)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIMutable)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIURI)
|
||||
if (aIID.Equals(kFILEDATAURICID))
|
||||
foundInterface = static_cast<nsIURI*>(this);
|
||||
else
|
||||
NS_INTERFACE_MAP_END
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsSimpleURI)
|
||||
|
||||
// nsIURIWithPrincipal methods:
|
||||
|
||||
|
@ -226,20 +195,16 @@ nsFileDataURI::GetPrincipalUri(nsIURI** aUri)
|
|||
NS_IMETHODIMP
|
||||
nsFileDataURI::Read(nsIObjectInputStream* aStream)
|
||||
{
|
||||
nsresult rv = aStream->ReadObject(PR_TRUE, getter_AddRefs(mSimpleURI));
|
||||
nsresult rv = nsSimpleURI::Read(aStream);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mMutable = do_QueryInterface(mSimpleURI);
|
||||
NS_ENSURE_TRUE(mMutable, NS_ERROR_UNEXPECTED);
|
||||
|
||||
return NS_ReadOptionalObject(aStream, PR_TRUE, getter_AddRefs(mPrincipal));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFileDataURI::Write(nsIObjectOutputStream* aStream)
|
||||
{
|
||||
nsresult rv = aStream->WriteCompoundObject(mSimpleURI, NS_GET_IID(nsIURI),
|
||||
PR_TRUE);
|
||||
nsresult rv = nsSimpleURI::Write(aStream);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_WriteOptionalCompoundObject(aStream, mPrincipal,
|
||||
|
@ -253,13 +218,21 @@ NS_IMETHODIMP
|
|||
nsFileDataURI::Clone(nsIURI** aClone)
|
||||
{
|
||||
nsCOMPtr<nsIURI> simpleClone;
|
||||
nsresult rv = mSimpleURI->Clone(getter_AddRefs(simpleClone));
|
||||
nsresult rv = nsSimpleURI::Clone(getter_AddRefs(simpleClone));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsIURI* newURI = new nsFileDataURI(mPrincipal, simpleClone);
|
||||
NS_ENSURE_TRUE(newURI, NS_ERROR_OUT_OF_MEMORY);
|
||||
#ifdef DEBUG
|
||||
nsRefPtr<nsFileDataURI> uriCheck;
|
||||
rv = simpleClone->QueryInterface(kFILEDATAURICID, getter_AddRefs(uriCheck));
|
||||
NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv) && uriCheck,
|
||||
"Unexpected!");
|
||||
#endif
|
||||
|
||||
NS_ADDREF(*aClone = newURI);
|
||||
nsFileDataURI* fileDataURI = static_cast<nsFileDataURI*>(simpleClone.get());
|
||||
|
||||
fileDataURI->mPrincipal = mPrincipal;
|
||||
|
||||
simpleClone.forget(aClone);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -285,7 +258,7 @@ nsFileDataURI::Equals(nsIURI* aOther, PRBool *aResult)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
return mSimpleURI->Equals(otherFileDataUri->mSimpleURI, aResult);
|
||||
return nsSimpleURI::Equals(otherFileDataUri, aResult);
|
||||
}
|
||||
|
||||
// nsIClassInfo methods:
|
||||
|
@ -391,17 +364,14 @@ nsFileDataProtocolHandler::NewURI(const nsACString& aSpec,
|
|||
FileDataInfo* info =
|
||||
GetFileDataInfo(aSpec);
|
||||
|
||||
nsCOMPtr<nsIURI> inner = do_CreateInstance(kSimpleURICID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = inner->SetSpec(aSpec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsRefPtr<nsFileDataURI> uri =
|
||||
new nsFileDataURI(info ? info->mPrincipal.get() : nsnull, inner);
|
||||
new nsFileDataURI(info ? info->mPrincipal.get() : nsnull);
|
||||
|
||||
rv = uri->SetSpec(aSpec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
NS_TryToSetImmutable(uri);
|
||||
*aResult = uri.forget().get();
|
||||
uri.forget(aResult);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include "nsXMLElement.h"
|
||||
#include "nsImageLoadingContent.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
|
||||
class nsGenConImageContent : public nsXMLElement,
|
||||
public nsImageLoadingContent
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsString.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsDOMCID.h"
|
||||
|
@ -92,7 +92,6 @@
|
|||
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsXBLBinding.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIXBLService.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIBoxObject.h"
|
||||
|
@ -110,7 +109,6 @@
|
|||
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
|
||||
|
@ -5379,10 +5377,8 @@ nsGenericElement::PostHandleEventForLinks(nsEventChainPostVisitor& aVisitor)
|
|||
nsIFocusManager::FLAG_NOSCROLL);
|
||||
}
|
||||
|
||||
nsIEventStateManager* esm =
|
||||
aVisitor.mPresContext->EventStateManager();
|
||||
nsEventStateManager::SetActiveManager(
|
||||
static_cast<nsEventStateManager*>(esm), this);
|
||||
aVisitor.mPresContext->EventStateManager(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5469,7 +5465,6 @@ ParseSelectorList(nsINode* aNode,
|
|||
NS_ENSURE_STATE(doc);
|
||||
|
||||
nsCSSParser parser(doc->CSSLoader());
|
||||
NS_ENSURE_TRUE(parser, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsCSSSelectorList* selectorList;
|
||||
nsresult rv = parser.ParseSelectorString(aSelectorString,
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
#include "nsPLDOMEvent.h"
|
||||
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsGUIEvent.h"
|
||||
|
||||
#include "nsIChannel.h"
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIExternalProtocolHandler.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIObjectFrame.h"
|
||||
#include "nsIPluginDocument.h"
|
||||
#include "nsIPluginHost.h"
|
||||
|
|
|
@ -332,18 +332,17 @@ nsStyledElementNotElementCSSInlineStyle::ParseStyleAttribute(const nsAString& aV
|
|||
if (isCSS) {
|
||||
css::Loader* cssLoader = doc->CSSLoader();
|
||||
nsCSSParser cssParser(cssLoader);
|
||||
if (cssParser) {
|
||||
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
|
||||
|
||||
nsRefPtr<css::StyleRule> rule;
|
||||
cssParser.ParseStyleAttribute(aValue, doc->GetDocumentURI(),
|
||||
baseURI,
|
||||
NodePrincipal(),
|
||||
getter_AddRefs(rule));
|
||||
if (rule) {
|
||||
aResult.SetTo(rule, &aValue);
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
|
||||
|
||||
nsRefPtr<css::StyleRule> rule;
|
||||
cssParser.ParseStyleAttribute(aValue, doc->GetDocumentURI(),
|
||||
baseURI,
|
||||
NodePrincipal(),
|
||||
getter_AddRefs(rule));
|
||||
if (rule) {
|
||||
aResult.SetTo(rule, &aValue);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#define nsTextFragment_h___
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
class nsString;
|
||||
class nsCString;
|
||||
|
|
|
@ -363,6 +363,7 @@ _TEST_FILES2 = \
|
|||
bug475156.sjs \
|
||||
test_bug544642.html \
|
||||
test_bug564863.xhtml \
|
||||
test_bug588990.html \
|
||||
test_copypaste.html \
|
||||
test_bug503481.html \
|
||||
file_bug503481.sjs \
|
||||
|
|
|
@ -0,0 +1,337 @@
|
|||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=588990
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 588990</title>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=588990">Mozilla Bug 588990</a>
|
||||
<!-- DOM to muck around with for tests -->
|
||||
<p id="root">
|
||||
<img name="n1">
|
||||
<img name="n2">
|
||||
<img name="n2">
|
||||
<img name="n3">
|
||||
<img name="n3">
|
||||
<img name="n3">
|
||||
</p>
|
||||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
root = $('root');
|
||||
i1_1 = root.children[0];
|
||||
i2_1 = root.children[1];
|
||||
i2_2 = root.children[2];
|
||||
i3_1 = root.children[3];
|
||||
i3_2 = root.children[4];
|
||||
i3_3 = root.children[5];
|
||||
|
||||
function checkHasName(test) {
|
||||
// Check name first to avoid flushes from hiding problems
|
||||
checkHasNameNoDocProp(test);
|
||||
|
||||
is(document.n1, i1_1, "i1_1 doc.name " + test);
|
||||
is(document.n2[0], i2_1, "i2_1 doc.name " + test);
|
||||
is(document.n2[1], i2_2, "i2_2 doc.name " + test);
|
||||
is(document.n2.length, 2, "doc.name.length " + test);
|
||||
is(document.n3[0], i3_1, "i3_1 doc.name " + test);
|
||||
is(document.n3[1], i3_2, "i3_2 doc.name " + test);
|
||||
is(document.n3[2], i3_3, "i3_3 doc.name " + test);
|
||||
is(document.n3.length, 3, "doc.name.length " + test);
|
||||
}
|
||||
|
||||
function checkHasNameNoDocProp(test) {
|
||||
is(i1_1.name, "n1", "i1_1 name " + test);
|
||||
is(i2_1.name, "n2", "i2_1 name " + test);
|
||||
is(i2_2.name, "n2", "i2_2 name " + test);
|
||||
is(i3_1.name, "n3", "i3_1 name " + test);
|
||||
is(i3_2.name, "n3", "i3_2 name " + test);
|
||||
is(i3_3.name, "n3", "i3_3 name " + test);
|
||||
}
|
||||
|
||||
function checkHasNoName(removed, test) {
|
||||
is(i1_1.name, "", "i1_1 name " + test);
|
||||
is(i2_1.name, "", "i2_1 name " + test);
|
||||
is(i2_2.name, "", "i2_2 name " + test);
|
||||
is(i3_1.name, "", "i3_1 name " + test);
|
||||
is(i3_2.name, "", "i3_2 name " + test);
|
||||
is(i3_3.name, "", "i3_3 name " + test);
|
||||
|
||||
var attrValue = removed ? null : "";
|
||||
is(i1_1.getAttribute("name"), attrValue, "i1_1 getAttribute " + test);
|
||||
is(i2_1.getAttribute("name"), attrValue, "i2_1 getAttribute " + test);
|
||||
is(i2_2.getAttribute("name"), attrValue, "i2_2 getAttribute " + test);
|
||||
is(i3_1.getAttribute("name"), attrValue, "i3_1 getAttribute " + test);
|
||||
is(i3_2.getAttribute("name"), attrValue, "i3_2 getAttribute " + test);
|
||||
is(i3_3.getAttribute("name"), attrValue, "i3_3 getAttribute " + test);
|
||||
|
||||
todo_is(document.n1, undefined, "doc.n1 " + test);
|
||||
todo_is(document.n2, undefined, "doc.n2 " + test);
|
||||
todo_is(document.n3, undefined, "doc.n3 " + test);
|
||||
}
|
||||
|
||||
// Check that dynamic modifications of attribute work
|
||||
|
||||
checkHasName("in markup");
|
||||
|
||||
i1_1.name = "";
|
||||
i2_1.name = "";
|
||||
i2_2.name = "";
|
||||
i3_1.name = "";
|
||||
i3_2.name = "";
|
||||
i3_3.name = "";
|
||||
|
||||
checkHasNoName(false, "set to empty");
|
||||
|
||||
i1_1.name = "n1";
|
||||
i2_1.name = "n2";
|
||||
i2_2.name = "n2";
|
||||
i3_1.name = "n3";
|
||||
i3_2.name = "n3";
|
||||
i3_3.name = "n3";
|
||||
|
||||
checkHasName("set using .name");
|
||||
|
||||
i1_1.setAttribute("name", "");
|
||||
i2_1.setAttribute("name", "");
|
||||
i2_2.setAttribute("name", "");
|
||||
i3_1.setAttribute("name", "");
|
||||
i3_2.setAttribute("name", "");
|
||||
i3_3.setAttribute("name", "");
|
||||
|
||||
checkHasNoName(false, "setAttribute to empty");
|
||||
|
||||
i1_1.name = "n1";
|
||||
i2_1.name = "n2";
|
||||
i2_2.name = "n2";
|
||||
i3_1.name = "n3";
|
||||
i3_2.name = "n3";
|
||||
i3_3.name = "n3";
|
||||
|
||||
checkHasName("set again using .name");
|
||||
|
||||
i1_1.removeAttribute("name");
|
||||
i2_1.removeAttribute("name");
|
||||
i2_2.removeAttribute("name");
|
||||
i3_1.removeAttribute("name");
|
||||
i3_2.removeAttribute("name");
|
||||
i3_3.removeAttribute("name");
|
||||
|
||||
checkHasNoName(true, "removed attribute");
|
||||
|
||||
i1_1.setAttribute("name", "n1");
|
||||
i2_1.setAttribute("name", "n2");
|
||||
i2_2.setAttribute("name", "n2");
|
||||
i3_1.setAttribute("name", "n3");
|
||||
i3_2.setAttribute("name", "n3");
|
||||
i3_3.setAttribute("name", "n3");
|
||||
|
||||
checkHasName("set using setAttribute");
|
||||
|
||||
t1 = document.createElement("img");
|
||||
t1.name = "n1";
|
||||
t2 = document.createElement("img");
|
||||
t2.name = "n2";
|
||||
t3 = document.createElement("img");
|
||||
t3.name = "n2";
|
||||
t4 = document.createElement("img");
|
||||
t4.name = "n3";
|
||||
t5 = document.createElement("img");
|
||||
t5.name = "n3";
|
||||
t6 = document.createElement("img");
|
||||
t6.name = "n3";
|
||||
|
||||
// Check that inserting elements before/after existing work
|
||||
|
||||
function insertAfter(newChild, existing) {
|
||||
existing.parentNode.insertBefore(newChild, existing.nextSibling);
|
||||
}
|
||||
function insertBefore(newChild, existing) {
|
||||
existing.parentNode.insertBefore(newChild, existing);
|
||||
}
|
||||
function removeNode(child) {
|
||||
child.parentNode.removeChild(child);
|
||||
}
|
||||
|
||||
insertAfter(t1, i1_1);
|
||||
insertAfter(t2, i2_1);
|
||||
insertAfter(t3, i2_2);
|
||||
insertAfter(t4, i3_1);
|
||||
insertAfter(t5, i3_2);
|
||||
insertAfter(t6, i3_3);
|
||||
|
||||
checkHasNameNoDocProp("inserted after");
|
||||
is(document.n1[0], i1_1, "i1_1 doc.name inserted after");
|
||||
is(document.n1[1], t1, "t1 doc.name inserted after");
|
||||
is(document.n1.length, 2, "doc.name1.length inserted after");
|
||||
is(document.n2[0], i2_1, "i2_1 doc.name inserted after");
|
||||
todo_is(document.n2[1], t2, "This is where t2 should show up. The elements in here should be in order-in-document rather than order-of-insertion");
|
||||
is(document.n2[1], i2_2, "i2_2 doc.name inserted after");
|
||||
is(document.n2[2], t2, "t2 doc.name inserted after");
|
||||
is(document.n2[3], t3, "t3 doc.name inserted after");
|
||||
is(document.n2.length, 4, "doc.name2.length inserted after");
|
||||
is(document.n3[0], i3_1, "i3_1 doc.name inserted after");
|
||||
is(document.n3[1], i3_2, "i3_3 doc.name inserted after");
|
||||
is(document.n3[2], i3_3, "i3_2 doc.name inserted after");
|
||||
is(document.n3[3], t4, "t4 doc.name inserted after");
|
||||
is(document.n3[4], t5, "t5 doc.name inserted after");
|
||||
is(document.n3[5], t6, "t6 doc.name inserted after");
|
||||
is(document.n3.length, 6, "doc.name3.length inserted after");
|
||||
|
||||
|
||||
insertBefore(t1, i1_1);
|
||||
insertBefore(t2, i2_1);
|
||||
insertBefore(t3, i2_2);
|
||||
insertBefore(t4, i3_1);
|
||||
insertBefore(t5, i3_2);
|
||||
insertBefore(t6, i3_3);
|
||||
|
||||
checkHasNameNoDocProp("inserted before");
|
||||
is(document.n1[0], i1_1, "i1_1 doc.name inserted before");
|
||||
is(document.n1[1], t1, "t1 doc.name inserted before");
|
||||
is(document.n1.length, 2, "doc.name1.length inserted before");
|
||||
is(document.n2[0], i2_1, "i2_1 doc.name inserted before");
|
||||
is(document.n2[1], i2_2, "i2_2 doc.name inserted before");
|
||||
is(document.n2[2], t2, "t2 doc.name inserted before");
|
||||
is(document.n2[3], t3, "t3 doc.name inserted before");
|
||||
is(document.n2.length, 4, "doc.name2.length inserted before");
|
||||
is(document.n3[0], i3_1, "i3_1 doc.name inserted before");
|
||||
is(document.n3[1], i3_2, "i3_3 doc.name inserted before");
|
||||
is(document.n3[2], i3_3, "i3_2 doc.name inserted before");
|
||||
is(document.n3[3], t4, "t4 doc.name inserted before");
|
||||
is(document.n3[4], t5, "t5 doc.name inserted before");
|
||||
is(document.n3[5], t6, "t6 doc.name inserted before");
|
||||
is(document.n3.length, 6, "doc.name3.length inserted before");
|
||||
|
||||
t1.removeAttribute("name");
|
||||
t2.removeAttribute("name");
|
||||
t3.removeAttribute("name");
|
||||
t4.removeAttribute("name");
|
||||
t5.removeAttribute("name");
|
||||
t6.removeAttribute("name");
|
||||
|
||||
checkHasName("removed tx attribute");
|
||||
|
||||
t1.setAttribute("name", "n1");
|
||||
t2.setAttribute("name", "n2");
|
||||
t3.setAttribute("name", "n2");
|
||||
t4.setAttribute("name", "n3");
|
||||
t5.setAttribute("name", "n3");
|
||||
t6.setAttribute("name", "n3");
|
||||
|
||||
checkHasNameNoDocProp("inserted before");
|
||||
is(document.n1[0], i1_1, "i1_1 doc.name inserted before");
|
||||
is(document.n1[1], t1, "t1 doc.name inserted before");
|
||||
is(document.n1.length, 2, "doc.name1.length inserted before");
|
||||
is(document.n2[0], i2_1, "i2_1 doc.name inserted before");
|
||||
is(document.n2[1], i2_2, "i2_2 doc.name inserted before");
|
||||
is(document.n2[2], t2, "t2 doc.name inserted before");
|
||||
is(document.n2[3], t3, "t3 doc.name inserted before");
|
||||
is(document.n2.length, 4, "doc.name2.length inserted before");
|
||||
is(document.n3[0], i3_1, "i3_1 doc.name inserted before");
|
||||
is(document.n3[1], i3_2, "i3_3 doc.name inserted before");
|
||||
is(document.n3[2], i3_3, "i3_2 doc.name inserted before");
|
||||
is(document.n3[3], t4, "t4 doc.name inserted before");
|
||||
is(document.n3[4], t5, "t5 doc.name inserted before");
|
||||
is(document.n3[5], t6, "t6 doc.name inserted before");
|
||||
is(document.n3.length, 6, "doc.name3.length inserted before");
|
||||
|
||||
removeNode(t1);
|
||||
removeNode(t2);
|
||||
removeNode(t3);
|
||||
removeNode(t4);
|
||||
removeNode(t5);
|
||||
removeNode(t6);
|
||||
|
||||
checkHasName("removed temporaries");
|
||||
|
||||
removeNode(i1_1);
|
||||
removeNode(i2_1);
|
||||
removeNode(i2_2);
|
||||
removeNode(i3_1);
|
||||
removeNode(i3_2);
|
||||
removeNode(i3_3);
|
||||
|
||||
checkHasNameNoDocProp("removed node");
|
||||
|
||||
// Check that removing an element during UnsetAttr works
|
||||
is(i1_1.name, "n1", "i1_1 has name set");
|
||||
var mutateFired = false;
|
||||
root.appendChild(i1_1);
|
||||
i1_1.addEventListener("DOMAttrModified", function(e) {
|
||||
i1_1.removeEventListener("DOMAttrModified", arguments.callee, false);
|
||||
is(e.target, i1_1, "target is i1_1");
|
||||
is(i1_1.name, "", "i1_1 no longer has name");
|
||||
is(i1_1.getAttribute("name"), null, "i1_1 no longer has name attr");
|
||||
removeNode(i1_1);
|
||||
is(i1_1.parentNode, null, "i1_1 was removed");
|
||||
mutateFired = true;
|
||||
}, false);
|
||||
i1_1.removeAttribute("name");
|
||||
ok(mutateFired, "mutation event fired");
|
||||
SpecialPowers.gc();
|
||||
|
||||
// Check that removing an element during SetAttr works
|
||||
i2_1.name = "";
|
||||
mutateFired = false;
|
||||
root.appendChild(i2_1);
|
||||
i2_1.addEventListener("DOMAttrModified", function(e) {
|
||||
i2_1.removeEventListener("DOMAttrModified", arguments.callee, false);
|
||||
is(e.target, i2_1, "target is i2_1");
|
||||
is(i2_1.name, "n2", "i2_1 no longer has name");
|
||||
is(i2_1.getAttribute("name"), "n2", "i2_1 no longer has name attr");
|
||||
removeNode(i2_1);
|
||||
is(i2_1.parentNode, null, "i2_1 was removed");
|
||||
mutateFired = true;
|
||||
}, false);
|
||||
i2_1.name = "n2";
|
||||
ok(mutateFired, "mutation event fired");
|
||||
SpecialPowers.gc();
|
||||
|
||||
// Re-add the name inside a mutation event on a HTML element
|
||||
is(i2_2.name, "n2", "i2_2 has name set");
|
||||
root.appendChild(i2_2);
|
||||
mutateFired = false;
|
||||
root.appendChild(i2_2);
|
||||
i2_2.addEventListener("DOMAttrModified", function(e) {
|
||||
i2_2.removeEventListener("DOMAttrModified", arguments.callee, false);
|
||||
is(e.target, i2_2, "target is i2_2");
|
||||
is(i2_2.name, "", "i2_2 no longer has name");
|
||||
is(i2_2.getAttribute("name"), "", "i2_2 has empty name attr");
|
||||
i2_2.name = "n2";
|
||||
mutateFired = true;
|
||||
}, false);
|
||||
i2_2.name = "";
|
||||
ok(mutateFired, "mutation event fired");
|
||||
is(document.n2, i2_2, "named was readded during mutation");
|
||||
removeNode(i2_2);
|
||||
SpecialPowers.gc();
|
||||
|
||||
// Re-remove the name inside a mutation event on a HTML element
|
||||
i3_1.name = "";
|
||||
root.appendChild(i3_1);
|
||||
mutateFired = false;
|
||||
root.appendChild(i3_1);
|
||||
i3_1.addEventListener("DOMAttrModified", function(e) {
|
||||
i3_1.removeEventListener("DOMAttrModified", arguments.callee, false);
|
||||
is(e.target, i3_1, "target is i3_1");
|
||||
is(i3_1.name, "n3", "i3_1 no longer has name");
|
||||
is(i3_1.getAttribute("name"), "n3", "i3_1 has empty name attr");
|
||||
i3_1.removeAttribute("name");
|
||||
mutateFired = true;
|
||||
}, false);
|
||||
i3_1.name = "n3";
|
||||
ok(mutateFired, "mutation event fired");
|
||||
todo_is(document.n3, undefined, "named was readded during mutation");
|
||||
removeNode(i3_1);
|
||||
SpecialPowers.gc();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -2210,7 +2210,6 @@ CreateFontStyleRule(const nsAString& aFont,
|
|||
// Pass the CSS Loader object to the parser, to allow parser error reports
|
||||
// to include the outer window ID.
|
||||
nsCSSParser parser(document->CSSLoader());
|
||||
NS_ENSURE_TRUE(parser, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsresult rv = parser.ParseStyleAttribute(EmptyString(), docURL, baseURL,
|
||||
principal, getter_AddRefs(rule));
|
||||
|
@ -3680,7 +3679,6 @@ nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, float aX, float aY
|
|||
// Pass the CSS Loader object to the parser, to allow parser error reports
|
||||
// to include the outer window ID.
|
||||
nsCSSParser parser(elementDoc ? elementDoc->CSSLoader() : nsnull);
|
||||
NS_ENSURE_TRUE(parser, NS_ERROR_OUT_OF_MEMORY);
|
||||
nsresult rv = parser.ParseColorString(PromiseFlatString(aBGColor),
|
||||
nsnull, 0, &bgColor);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -48,7 +48,6 @@ XPIDL_MODULE = content_events
|
|||
EXPORTS = \
|
||||
nsMutationEvent.h \
|
||||
nsIEventListenerManager.h \
|
||||
nsIEventStateManager.h \
|
||||
nsIPrivateDOMEvent.h \
|
||||
nsIPrivateTextEvent.h \
|
||||
nsIPrivateTextRange.h \
|
||||
|
|
|
@ -1,167 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsIEventStateManager_h__
|
||||
#define nsIEventStateManager_h__
|
||||
|
||||
#include "nsEvent.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsEventStates.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsIDocument;
|
||||
class nsPresContext;
|
||||
class nsIDOMEvent;
|
||||
class nsIFrame;
|
||||
class nsIView;
|
||||
class nsIWidget;
|
||||
class imgIContainer;
|
||||
|
||||
/*
|
||||
* Event state manager interface.
|
||||
*/
|
||||
#define NS_IEVENTSTATEMANAGER_IID \
|
||||
{0x69ab5b16, 0x6690, 0x42fc, \
|
||||
{ 0xa9, 0xe5, 0xa3, 0xb4, 0xf8, 0x0f, 0xcb, 0xa6 } }
|
||||
|
||||
#define NS_EVENT_NEEDS_FRAME(event) (!NS_IS_ACTIVATION_EVENT(event))
|
||||
|
||||
class nsIEventStateManager : public nsISupports {
|
||||
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEVENTSTATEMANAGER_IID)
|
||||
|
||||
NS_IMETHOD Init() = 0;
|
||||
|
||||
NS_IMETHOD PreHandleEvent(nsPresContext* aPresContext,
|
||||
nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
nsEventStatus* aStatus,
|
||||
nsIView* aView) = 0;
|
||||
|
||||
NS_IMETHOD PostHandleEvent(nsPresContext* aPresContext,
|
||||
nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
nsEventStatus* aStatus,
|
||||
nsIView* aView) = 0;
|
||||
|
||||
NS_IMETHOD SetPresContext(nsPresContext* aPresContext) = 0;
|
||||
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame) = 0;
|
||||
|
||||
NS_IMETHOD GetEventTarget(nsIFrame **aFrame) = 0;
|
||||
NS_IMETHOD GetEventTargetContent(nsEvent* aEvent, nsIContent** aContent) = 0;
|
||||
|
||||
/**
|
||||
* Returns the content state of aContent.
|
||||
* @param aContent The control whose state is requested.
|
||||
* @param aFollowLabels Whether to reflect a label's content state on its
|
||||
* associated control. If aFollowLabels is true and
|
||||
* aContent is a control which has a label that has the
|
||||
* hover or active content state set, GetContentState
|
||||
* will pretend that those states are also set on aContent.
|
||||
* @return The content state.
|
||||
*/
|
||||
virtual nsEventStates GetContentState(nsIContent *aContent,
|
||||
PRBool aFollowLabels = PR_FALSE) = 0;
|
||||
|
||||
/**
|
||||
* Notify that the given NS_EVENT_STATE_* bit has changed for this content.
|
||||
* @param aContent Content which has changed states. This may be null to
|
||||
* indicate that nothing is in this state anymore.
|
||||
* @param aState One of NS_EVENT_STATE_ACTIVE, NS_EVENT_STATE_HOVER,
|
||||
* NS_EVENT_STATE_DRAGOVER, NS_EVENT_STATE_URLTARGET. Don't
|
||||
* pass anything else! Passing in a state object that has
|
||||
* more than one of those states set is not supported.
|
||||
* @return Whether the content was able to change all states. Returns PR_FALSE
|
||||
* if a resulting DOM event causes the content node passed in
|
||||
* to not change states. Note, the frame for the content may
|
||||
* change as a result of the content state change, because of
|
||||
* frame reconstructions that may occur, but this does not
|
||||
* affect the return value.
|
||||
*/
|
||||
virtual PRBool SetContentState(nsIContent *aContent, nsEventStates aState) = 0;
|
||||
|
||||
NS_IMETHOD ContentRemoved(nsIDocument* aDocument, nsIContent* aContent) = 0;
|
||||
NS_IMETHOD EventStatusOK(nsGUIEvent* aEvent, PRBool *aOK) = 0;
|
||||
|
||||
// Access Key Registration
|
||||
|
||||
/**
|
||||
* Register accesskey on the given element. When accesskey is activated then
|
||||
* the element will be notified via nsIContent::PerformAccesskey() method.
|
||||
*
|
||||
* @param aContent the given element
|
||||
* @param aKey accesskey
|
||||
*/
|
||||
NS_IMETHOD RegisterAccessKey(nsIContent* aContent, PRUint32 aKey) = 0;
|
||||
|
||||
/**
|
||||
* Unregister accesskey for the given element.
|
||||
*
|
||||
* @param aContent the given element
|
||||
* @param aKey accesskey
|
||||
*/
|
||||
NS_IMETHOD UnregisterAccessKey(nsIContent* aContent, PRUint32 aKey) = 0;
|
||||
|
||||
/**
|
||||
* Get accesskey registered on the given element or 0 if there is none.
|
||||
*
|
||||
* @param aContent the given element
|
||||
* @param aKey registered accesskey
|
||||
* @return NS_OK
|
||||
*/
|
||||
NS_IMETHOD GetRegisteredAccessKey(nsIContent* aContent, PRUint32* aKey) = 0;
|
||||
|
||||
NS_IMETHOD SetCursor(PRInt32 aCursor, imgIContainer* aContainer,
|
||||
PRBool aHaveHotspot, float aHotspotX, float aHotspotY,
|
||||
nsIWidget* aWidget, PRBool aLockCursor) = 0;
|
||||
|
||||
NS_IMETHOD NotifyDestroyPresContext(nsPresContext* aPresContext) = 0;
|
||||
|
||||
/**
|
||||
* Returns true if the current code is being executed as a result of user input.
|
||||
* This includes timers or anything else that is initiated from user input.
|
||||
* However, mouse hover events are not counted as user input, nor are
|
||||
* page load events. If this method is called from asynchronously executed code,
|
||||
* such as during layout reflows, it will return false.
|
||||
*/
|
||||
NS_IMETHOD_(PRBool) IsHandlingUserInputExternal() = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIEventStateManager, NS_IEVENTSTATEMANAGER_IID)
|
||||
|
||||
#endif // nsIEventStateManager_h__
|
|
@ -46,6 +46,10 @@ MODULE = content
|
|||
LIBRARY_NAME = gkconevents_s
|
||||
LIBXUL_LIBRARY = 1
|
||||
|
||||
EXPORTS = \
|
||||
nsEventStateManager.h \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
nsEventListenerManager.cpp \
|
||||
nsEventStateManager.cpp \
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsDOMDataTransfer.h"
|
||||
#include "nsIDragService.h"
|
||||
|
||||
|
@ -81,7 +80,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
|
|||
NS_IMETHODIMP
|
||||
nsDOMDragEvent::InitDragEvent(const nsAString & aType,
|
||||
PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMAbstractView* aView, PRInt32 aDetail,
|
||||
nsIDOMWindow* aView, PRInt32 aDetail,
|
||||
PRInt32 aScreenX, PRInt32 aScreenY,
|
||||
PRInt32 aClientX, PRInt32 aClientY,
|
||||
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
|
||||
|
@ -133,7 +132,5 @@ nsresult NS_NewDOMDragEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsDragEvent *aEvent)
|
||||
{
|
||||
nsDOMDragEvent* event = new nsDOMDragEvent(aPresContext, aEvent);
|
||||
NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
return CallQueryInterface(event, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -316,8 +316,7 @@ nsDOMEvent::GetTargetFromFrame()
|
|||
if (!mPresContext) { return nsnull; }
|
||||
|
||||
// Get the target frame (have to get the ESM first)
|
||||
nsIFrame* targetFrame = nsnull;
|
||||
mPresContext->EventStateManager()->GetEventTarget(&targetFrame);
|
||||
nsIFrame* targetFrame = mPresContext->EventStateManager()->GetEventTarget();
|
||||
if (!targetFrame) { return nsnull; }
|
||||
|
||||
// get the real content
|
||||
|
|
|
@ -175,7 +175,7 @@ nsDOMKeyboardEvent::GetWhich(PRUint32* aWhich)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMKeyboardEvent::InitKeyEvent(const nsAString& aType, PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMAbstractView* aView, PRBool aCtrlKey, PRBool aAltKey,
|
||||
nsIDOMWindow* aView, PRBool aCtrlKey, PRBool aAltKey,
|
||||
PRBool aShiftKey, PRBool aMetaKey,
|
||||
PRUint32 aKeyCode, PRUint32 aCharCode)
|
||||
{
|
||||
|
@ -198,9 +198,5 @@ nsresult NS_NewDOMKeyboardEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsKeyEvent *aEvent)
|
||||
{
|
||||
nsDOMKeyboardEvent* it = new nsDOMKeyboardEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "nsDOMMouseEvent.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
nsDOMMouseEvent::nsDOMMouseEvent(nsPresContext* aPresContext,
|
||||
|
@ -105,7 +104,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
nsIDOMWindow* aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
|
||||
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
|
||||
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget)
|
||||
|
@ -148,7 +147,7 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBo
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMMouseEvent::InitNSMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
nsIDOMWindow *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
|
||||
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
|
||||
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget,
|
||||
|
@ -314,9 +313,5 @@ nsresult NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsInputEvent *aEvent)
|
||||
{
|
||||
nsDOMMouseEvent* it = new nsDOMMouseEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "nsDOMMouseScrollEvent.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(nsPresContext* aPresContext,
|
||||
|
@ -89,7 +88,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMMouseScrollEvent::InitMouseScrollEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
nsIDOMWindow *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
|
||||
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
|
||||
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget,
|
||||
|
@ -130,9 +129,5 @@ nsresult NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsInputEvent *aEvent)
|
||||
{
|
||||
nsDOMMouseScrollEvent* it = new nsDOMMouseScrollEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ NS_IMETHODIMP
|
|||
nsDOMMozTouchEvent::InitMozTouchEvent(const nsAString& aTypeArg,
|
||||
PRBool aCanBubbleArg,
|
||||
PRBool aCancelableArg,
|
||||
nsIDOMAbstractView* aViewArg,
|
||||
nsIDOMWindow* aViewArg,
|
||||
PRInt32 aDetailArg,
|
||||
PRInt32 aScreenX,
|
||||
PRInt32 aScreenY,
|
||||
|
@ -127,8 +127,5 @@ nsresult NS_NewDOMMozTouchEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsMozTouchEvent *aEvent)
|
||||
{
|
||||
nsDOMMozTouchEvent *it = new nsDOMMozTouchEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ NS_IMETHODIMP
|
|||
nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
|
||||
PRBool aCanBubble,
|
||||
PRBool aCancelable,
|
||||
nsIDOMAbstractView *aView,
|
||||
nsIDOMWindow *aView,
|
||||
PRInt32 aDetail,
|
||||
float aX, float aY,
|
||||
float aWidth, float aHeight)
|
||||
|
@ -155,11 +155,6 @@ NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,
|
|||
nsPresContext *aPresContext,
|
||||
nsScrollAreaEvent *aEvent)
|
||||
{
|
||||
nsDOMScrollAreaEvent *ev = new nsDOMScrollAreaEvent(aPresContext, aEvent);
|
||||
|
||||
if (!ev) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(ev, aInstancePtrResult);
|
||||
nsDOMScrollAreaEvent* it = new nsDOMScrollAreaEvent(aPresContext, aEvent);
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ NS_IMETHODIMP
|
|||
nsDOMSimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg,
|
||||
PRBool aCanBubbleArg,
|
||||
PRBool aCancelableArg,
|
||||
nsIDOMAbstractView* aViewArg,
|
||||
nsIDOMWindow* aViewArg,
|
||||
PRInt32 aDetailArg,
|
||||
PRInt32 aScreenX,
|
||||
PRInt32 aScreenY,
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "nsIDOMNode.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
|
@ -176,7 +176,7 @@ nsDOMUIEvent::GetClientPoint()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMUIEvent::GetView(nsIDOMAbstractView** aView)
|
||||
nsDOMUIEvent::GetView(nsIDOMWindow** aView)
|
||||
{
|
||||
*aView = mView;
|
||||
NS_IF_ADDREF(*aView);
|
||||
|
@ -191,7 +191,11 @@ nsDOMUIEvent::GetDetail(PRInt32* aDetail)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMUIEvent::InitUIEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg)
|
||||
nsDOMUIEvent::InitUIEvent(const nsAString& typeArg,
|
||||
PRBool canBubbleArg,
|
||||
PRBool cancelableArg,
|
||||
nsIDOMWindow* viewArg,
|
||||
PRInt32 detailArg)
|
||||
{
|
||||
nsresult rv = nsDOMEvent::InitEvent(typeArg, canBubbleArg, cancelableArg);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -258,7 +262,7 @@ nsDOMUIEvent::GetRangeParent(nsIDOMNode** aRangeParent)
|
|||
nsIFrame* targetFrame = nsnull;
|
||||
|
||||
if (mPresContext) {
|
||||
mPresContext->EventStateManager()->GetEventTarget(&targetFrame);
|
||||
targetFrame = mPresContext->EventStateManager()->GetEventTarget();
|
||||
}
|
||||
|
||||
*aRangeParent = nsnull;
|
||||
|
@ -286,7 +290,7 @@ nsDOMUIEvent::GetRangeOffset(PRInt32* aRangeOffset)
|
|||
nsIFrame* targetFrame = nsnull;
|
||||
|
||||
if (mPresContext) {
|
||||
mPresContext->EventStateManager()->GetEventTarget(&targetFrame);
|
||||
targetFrame = mPresContext->EventStateManager()->GetEventTarget();
|
||||
}
|
||||
|
||||
if (targetFrame) {
|
||||
|
@ -334,8 +338,7 @@ nsDOMUIEvent::GetLayerPoint()
|
|||
return mLayerPoint;
|
||||
}
|
||||
// XXX I'm not really sure this is correct; it's my best shot, though
|
||||
nsIFrame* targetFrame;
|
||||
mPresContext->EventStateManager()->GetEventTarget(&targetFrame);
|
||||
nsIFrame* targetFrame = mPresContext->EventStateManager()->GetEventTarget();
|
||||
if (!targetFrame)
|
||||
return mLayerPoint;
|
||||
nsIFrame* layer = nsLayoutUtils::GetClosestLayer(targetFrame);
|
||||
|
@ -419,9 +422,5 @@ nsresult NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsGUIEvent *aEvent)
|
||||
{
|
||||
nsDOMUIEvent* it = new nsDOMUIEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -36,12 +36,11 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsDOMUIEvent_h__
|
||||
#define nsDOMUIEvent_h__
|
||||
#ifndef nsDOMUIEvent_h
|
||||
#define nsDOMUIEvent_h
|
||||
|
||||
#include "nsIDOMUIEvent.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsDOMEvent.h"
|
||||
|
||||
class nsDOMUIEvent : public nsDOMEvent,
|
||||
|
@ -78,7 +77,7 @@ protected:
|
|||
nsIntPoint GetPagePoint();
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIDOMAbstractView> mView;
|
||||
nsCOMPtr<nsIDOMWindow> mView;
|
||||
PRInt32 mDetail;
|
||||
nsIntPoint mClientPoint;
|
||||
// Screenpoint is mEvent->refPoint.
|
||||
|
@ -90,4 +89,4 @@ protected:
|
|||
NS_FORWARD_NSIDOMUIEVENT(nsDOMUIEvent::) \
|
||||
NS_FORWARD_TO_NSDOMEVENT
|
||||
|
||||
#endif // nsDOMUIEvent_h__
|
||||
#endif // nsDOMUIEvent_h
|
||||
|
|
|
@ -118,7 +118,7 @@ nsDOMXULCommandEvent::GetSourceEvent(nsIDOMEvent** aSourceEvent)
|
|||
NS_IMETHODIMP
|
||||
nsDOMXULCommandEvent::InitCommandEvent(const nsAString& aType,
|
||||
PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMAbstractView *aView,
|
||||
nsIDOMWindow* aView,
|
||||
PRInt32 aDetail,
|
||||
PRBool aCtrlKey, PRBool aAltKey,
|
||||
PRBool aShiftKey, PRBool aMetaKey,
|
||||
|
@ -144,9 +144,5 @@ nsresult NS_NewDOMXULCommandEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsInputEvent *aEvent)
|
||||
{
|
||||
nsDOMXULCommandEvent* it = new nsDOMXULCommandEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
#ifdef MOZ_SVG
|
||||
#include "nsGkAtoms.h"
|
||||
#endif // MOZ_SVG
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIJSEventListener.h"
|
||||
|
|
|
@ -118,7 +118,6 @@
|
|||
#include "nsIDOMMouseScrollEvent.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
#include "nsDOMDragEvent.h"
|
||||
#include "nsIDOMNSEditableElement.h"
|
||||
|
@ -811,7 +810,7 @@ nsEventStateManager::UpdateUserActivityTimer(void)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsresult
|
||||
nsEventStateManager::Init()
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
|
@ -996,8 +995,7 @@ nsEventStateManager::Observe(nsISupports *aSubject,
|
|||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsEventStateManager)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsEventStateManager)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIEventStateManager)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIEventStateManager)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
@ -1047,8 +1045,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsEventStateManager)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mAccessKeys);
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsresult
|
||||
nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||
nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
|
@ -2818,7 +2815,7 @@ NodeAllowsClickThrough(nsINode* aNode)
|
|||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsresult
|
||||
nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||
nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
|
@ -2993,8 +2990,7 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
|||
ClearGlobalActiveContent(this);
|
||||
if (IsMouseEventReal(aEvent)) {
|
||||
if (!mCurrentTarget) {
|
||||
nsIFrame* targ;
|
||||
GetEventTarget(&targ);
|
||||
GetEventTarget();
|
||||
}
|
||||
if (mCurrentTarget) {
|
||||
ret = CheckForAndDispatchClick(presContext, (nsMouseEvent*)aEvent,
|
||||
|
@ -3356,28 +3352,24 @@ nsEventStateManager::IsTargetCrossProcess(nsGUIEvent *aEvent)
|
|||
return TabParent::GetIMETabParent() != nsnull;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsEventStateManager::NotifyDestroyPresContext(nsPresContext* aPresContext)
|
||||
{
|
||||
nsIMEStateManager::OnDestroyPresContext(aPresContext);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsEventStateManager::SetPresContext(nsPresContext* aPresContext)
|
||||
{
|
||||
mPresContext = aPresContext;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsEventStateManager::ClearFrameRefs(nsIFrame* aFrame)
|
||||
{
|
||||
if (aFrame && aFrame == mCurrentTarget) {
|
||||
mCurrentTargetContent = aFrame->GetContent();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3436,7 +3428,7 @@ nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsresult
|
||||
nsEventStateManager::SetCursor(PRInt32 aCursor, imgIContainer* aContainer,
|
||||
PRBool aHaveHotspot,
|
||||
float aHotspotX, float aHotspotY,
|
||||
|
@ -3698,8 +3690,7 @@ nsEventStateManager::NotifyMouseOut(nsGUIEvent* aEvent, nsIContent* aMovingInto)
|
|||
docshell->GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
if (presContext) {
|
||||
nsEventStateManager* kidESM =
|
||||
static_cast<nsEventStateManager*>(presContext->EventStateManager());
|
||||
nsEventStateManager* kidESM = presContext->EventStateManager();
|
||||
// Not moving into any element in this subdocument
|
||||
kidESM->NotifyMouseOut(aEvent, nsnull);
|
||||
}
|
||||
|
@ -3757,9 +3748,7 @@ nsEventStateManager::NotifyMouseOver(nsGUIEvent* aEvent, nsIContent* aContent)
|
|||
if (docContent) {
|
||||
nsIPresShell *parentShell = parentDoc->GetShell();
|
||||
if (parentShell) {
|
||||
nsEventStateManager* parentESM =
|
||||
static_cast<nsEventStateManager*>
|
||||
(parentShell->GetPresContext()->EventStateManager());
|
||||
nsEventStateManager* parentESM = parentShell->GetPresContext()->EventStateManager();
|
||||
parentESM->NotifyMouseOver(aEvent, docContent);
|
||||
}
|
||||
}
|
||||
|
@ -3804,8 +3793,7 @@ nsEventStateManager::GenerateMouseEnterExit(nsGUIEvent* aEvent)
|
|||
case NS_MOUSE_MOVE:
|
||||
{
|
||||
// Get the target content target (mousemove target == mouseover target)
|
||||
nsCOMPtr<nsIContent> targetElement;
|
||||
GetEventTargetContent(aEvent, getter_AddRefs(targetElement));
|
||||
nsCOMPtr<nsIContent> targetElement = GetEventTargetContent(aEvent);
|
||||
if (!targetElement) {
|
||||
// We're always over the document root, even if we're only
|
||||
// over dead space in a page (whose frame is not associated with
|
||||
|
@ -4093,8 +4081,7 @@ nsEventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext,
|
|||
|
||||
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||
if (presShell) {
|
||||
nsCOMPtr<nsIContent> mouseContent;
|
||||
GetEventTargetContent(aEvent, getter_AddRefs(mouseContent));
|
||||
nsCOMPtr<nsIContent> mouseContent = GetEventTargetContent(aEvent);
|
||||
|
||||
ret = presShell->HandleEventWithTarget(&event, mCurrentTarget,
|
||||
mouseContent, aStatus);
|
||||
|
@ -4120,61 +4107,56 @@ nsEventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext,
|
|||
return ret;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEventStateManager::GetEventTarget(nsIFrame **aFrame)
|
||||
nsIFrame*
|
||||
nsEventStateManager::GetEventTarget()
|
||||
{
|
||||
nsIPresShell *shell;
|
||||
if (mCurrentTarget ||
|
||||
!mPresContext ||
|
||||
!(shell = mPresContext->GetPresShell())) {
|
||||
*aFrame = mCurrentTarget;
|
||||
return NS_OK;
|
||||
return mCurrentTarget;
|
||||
}
|
||||
|
||||
if (mCurrentTargetContent) {
|
||||
mCurrentTarget = mPresContext->GetPrimaryFrameFor(mCurrentTargetContent);
|
||||
if (mCurrentTarget) {
|
||||
*aFrame = mCurrentTarget;
|
||||
return NS_OK;
|
||||
return mCurrentTarget;
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame* frame = shell->GetEventTargetFrame();
|
||||
*aFrame = mCurrentTarget = frame;
|
||||
return NS_OK;
|
||||
return (mCurrentTarget = frame);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEventStateManager::GetEventTargetContent(nsEvent* aEvent,
|
||||
nsIContent** aContent)
|
||||
already_AddRefed<nsIContent>
|
||||
nsEventStateManager::GetEventTargetContent(nsEvent* aEvent)
|
||||
{
|
||||
if (aEvent &&
|
||||
(aEvent->message == NS_FOCUS_CONTENT ||
|
||||
aEvent->message == NS_BLUR_CONTENT)) {
|
||||
NS_IF_ADDREF(*aContent = GetFocusedContent());
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsIContent> content = GetFocusedContent();
|
||||
return content.forget();
|
||||
}
|
||||
|
||||
if (mCurrentTargetContent) {
|
||||
*aContent = mCurrentTargetContent;
|
||||
NS_IF_ADDREF(*aContent);
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsIContent> content = mCurrentTargetContent;
|
||||
return content.forget();
|
||||
}
|
||||
|
||||
*aContent = nsnull;
|
||||
nsIContent *content = nsnull;
|
||||
|
||||
nsIPresShell *presShell = mPresContext->GetPresShell();
|
||||
if (presShell) {
|
||||
*aContent = presShell->GetEventTargetContent(aEvent).get();
|
||||
content = presShell->GetEventTargetContent(aEvent).get();
|
||||
}
|
||||
|
||||
// Some events here may set mCurrentTarget but not set the corresponding
|
||||
// event target in the PresShell.
|
||||
if (!*aContent && mCurrentTarget) {
|
||||
mCurrentTarget->GetContentForEvent(mPresContext, aEvent, aContent);
|
||||
if (!content && mCurrentTarget) {
|
||||
mCurrentTarget->GetContentForEvent(mPresContext, aEvent, &content);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return content;
|
||||
}
|
||||
|
||||
static already_AddRefed<nsIContent>
|
||||
|
@ -4419,7 +4401,7 @@ nsEventStateManager::SetContentState(nsIContent *aContent, nsEventStates aState)
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsEventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
|
||||
{
|
||||
// inform the focus manager that the content is being removed. If this
|
||||
|
@ -4452,59 +4434,44 @@ nsEventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent
|
|||
// See bug 292146 for why we want to null this out
|
||||
mLastMouseOverElement = nsnull;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEventStateManager::EventStatusOK(nsGUIEvent* aEvent, PRBool *aOK)
|
||||
PRBool
|
||||
nsEventStateManager::EventStatusOK(nsGUIEvent* aEvent)
|
||||
{
|
||||
*aOK = PR_TRUE;
|
||||
if (aEvent->message == NS_MOUSE_BUTTON_DOWN &&
|
||||
static_cast<nsMouseEvent*>(aEvent)->button == nsMouseEvent::eLeftButton) {
|
||||
if (!sNormalLMouseEventInProcess) {
|
||||
*aOK = PR_FALSE;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
return !(aEvent->message == NS_MOUSE_BUTTON_DOWN &&
|
||||
static_cast<nsMouseEvent*>(aEvent)->button == nsMouseEvent::eLeftButton &&
|
||||
!sNormalLMouseEventInProcess);
|
||||
}
|
||||
|
||||
//-------------------------------------------
|
||||
// Access Key Registration
|
||||
//-------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsEventStateManager::RegisterAccessKey(nsIContent* aContent, PRUint32 aKey)
|
||||
{
|
||||
if (aContent && mAccessKeys.IndexOf(aContent) == -1)
|
||||
mAccessKeys.AppendObject(aContent);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsEventStateManager::UnregisterAccessKey(nsIContent* aContent, PRUint32 aKey)
|
||||
{
|
||||
if (aContent)
|
||||
mAccessKeys.RemoveObject(aContent);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEventStateManager::GetRegisteredAccessKey(nsIContent* aContent,
|
||||
PRUint32* aKey)
|
||||
PRUint32
|
||||
nsEventStateManager::GetRegisteredAccessKey(nsIContent* aContent)
|
||||
{
|
||||
NS_ENSURE_ARG(aContent);
|
||||
NS_ENSURE_ARG_POINTER(aKey);
|
||||
*aKey = 0;
|
||||
|
||||
if (mAccessKeys.IndexOf(aContent) == -1)
|
||||
return NS_OK;
|
||||
return 0;
|
||||
|
||||
nsAutoString accessKey;
|
||||
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accessKey);
|
||||
*aKey = accessKey.First();
|
||||
return NS_OK;
|
||||
return accessKey.First();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#ifndef nsEventStateManager_h__
|
||||
#define nsEventStateManager_h__
|
||||
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEvent.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIContent.h"
|
||||
|
@ -56,6 +55,7 @@
|
|||
#include "nsIScrollableFrame.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsEventStates.h"
|
||||
|
||||
class nsIPresShell;
|
||||
class nsIDocShell;
|
||||
|
@ -75,7 +75,6 @@ class TabParent;
|
|||
*/
|
||||
|
||||
class nsEventStateManager : public nsSupportsWeakReference,
|
||||
public nsIEventStateManager,
|
||||
public nsIObserver
|
||||
{
|
||||
friend class nsMouseWheelTransaction;
|
||||
|
@ -86,7 +85,7 @@ public:
|
|||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
NS_IMETHOD Init();
|
||||
nsresult Init();
|
||||
nsresult Shutdown();
|
||||
|
||||
/* The PreHandleEvent method is called before event dispatch to either
|
||||
|
@ -96,44 +95,86 @@ public:
|
|||
* PostHandleEvent. Any centralized event processing which must occur before
|
||||
* DOM or frame event handling should occur here as well.
|
||||
*/
|
||||
NS_IMETHOD PreHandleEvent(nsPresContext* aPresContext,
|
||||
nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
nsEventStatus* aStatus,
|
||||
nsIView* aView);
|
||||
nsresult PreHandleEvent(nsPresContext* aPresContext,
|
||||
nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
nsEventStatus* aStatus,
|
||||
nsIView* aView);
|
||||
|
||||
/* The PostHandleEvent method should contain all system processing which
|
||||
* should occur conditionally based on DOM or frame processing. It should
|
||||
* also contain any centralized event processing which must occur after
|
||||
* DOM and frame processing.
|
||||
*/
|
||||
NS_IMETHOD PostHandleEvent(nsPresContext* aPresContext,
|
||||
nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
nsEventStatus* aStatus,
|
||||
nsIView* aView);
|
||||
nsresult PostHandleEvent(nsPresContext* aPresContext,
|
||||
nsEvent *aEvent,
|
||||
nsIFrame* aTargetFrame,
|
||||
nsEventStatus* aStatus,
|
||||
nsIView* aView);
|
||||
|
||||
NS_IMETHOD NotifyDestroyPresContext(nsPresContext* aPresContext);
|
||||
NS_IMETHOD SetPresContext(nsPresContext* aPresContext);
|
||||
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame);
|
||||
void NotifyDestroyPresContext(nsPresContext* aPresContext);
|
||||
void SetPresContext(nsPresContext* aPresContext);
|
||||
void ClearFrameRefs(nsIFrame* aFrame);
|
||||
|
||||
NS_IMETHOD GetEventTarget(nsIFrame **aFrame);
|
||||
NS_IMETHOD GetEventTargetContent(nsEvent* aEvent, nsIContent** aContent);
|
||||
nsIFrame* GetEventTarget();
|
||||
already_AddRefed<nsIContent> GetEventTargetContent(nsEvent* aEvent);
|
||||
|
||||
/**
|
||||
* Returns the content state of aContent.
|
||||
* @param aContent The control whose state is requested.
|
||||
* @param aFollowLabels Whether to reflect a label's content state on its
|
||||
* associated control. If aFollowLabels is true and
|
||||
* aContent is a control which has a label that has the
|
||||
* hover or active content state set, GetContentState
|
||||
* will pretend that those states are also set on aContent.
|
||||
* @return The content state.
|
||||
*/
|
||||
virtual nsEventStates GetContentState(nsIContent *aContent,
|
||||
PRBool aFollowLabels = PR_FALSE);
|
||||
virtual PRBool SetContentState(nsIContent *aContent, nsEventStates aState);
|
||||
NS_IMETHOD ContentRemoved(nsIDocument* aDocument, nsIContent* aContent);
|
||||
NS_IMETHOD EventStatusOK(nsGUIEvent* aEvent, PRBool *aOK);
|
||||
|
||||
// Access Key Registration
|
||||
NS_IMETHOD RegisterAccessKey(nsIContent* aContent, PRUint32 aKey);
|
||||
NS_IMETHOD UnregisterAccessKey(nsIContent* aContent, PRUint32 aKey);
|
||||
NS_IMETHOD GetRegisteredAccessKey(nsIContent* aContent, PRUint32* aKey);
|
||||
/**
|
||||
* Notify that the given NS_EVENT_STATE_* bit has changed for this content.
|
||||
* @param aContent Content which has changed states
|
||||
* @param aState Corresponding state flags such as NS_EVENT_STATE_FOCUS
|
||||
* @return Whether the content was able to change all states. Returns PR_FALSE
|
||||
* if a resulting DOM event causes the content node passed in
|
||||
* to not change states. Note, the frame for the content may
|
||||
* change as a result of the content state change, because of
|
||||
* frame reconstructions that may occur, but this does not
|
||||
* affect the return value.
|
||||
*/
|
||||
PRBool SetContentState(nsIContent *aContent, nsEventStates aState);
|
||||
void ContentRemoved(nsIDocument* aDocument, nsIContent* aContent);
|
||||
PRBool EventStatusOK(nsGUIEvent* aEvent);
|
||||
|
||||
NS_IMETHOD SetCursor(PRInt32 aCursor, imgIContainer* aContainer,
|
||||
PRBool aHaveHotspot, float aHotspotX, float aHotspotY,
|
||||
nsIWidget* aWidget, PRBool aLockCursor);
|
||||
/**
|
||||
* Register accesskey on the given element. When accesskey is activated then
|
||||
* the element will be notified via nsIContent::PerformAccesskey() method.
|
||||
*
|
||||
* @param aContent the given element
|
||||
* @param aKey accesskey
|
||||
*/
|
||||
void RegisterAccessKey(nsIContent* aContent, PRUint32 aKey);
|
||||
|
||||
/**
|
||||
* Unregister accesskey for the given element.
|
||||
*
|
||||
* @param aContent the given element
|
||||
* @param aKey accesskey
|
||||
*/
|
||||
void UnregisterAccessKey(nsIContent* aContent, PRUint32 aKey);
|
||||
|
||||
/**
|
||||
* Get accesskey registered on the given element or 0 if there is none.
|
||||
*
|
||||
* @param aContent the given element
|
||||
* @return registered accesskey
|
||||
*/
|
||||
PRUint32 GetRegisteredAccessKey(nsIContent* aContent);
|
||||
|
||||
nsresult SetCursor(PRInt32 aCursor, imgIContainer* aContainer,
|
||||
PRBool aHaveHotspot, float aHotspotX, float aHotspotY,
|
||||
nsIWidget* aWidget, PRBool aLockCursor);
|
||||
|
||||
static void StartHandlingUserInput()
|
||||
{
|
||||
|
@ -150,16 +191,23 @@ public:
|
|||
return sUserInputEventDepth > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current code is being executed as a result of user input.
|
||||
* This includes timers or anything else that is initiated from user input.
|
||||
* However, mouse hover events are not counted as user input, nor are
|
||||
* page load events. If this method is called from asynchronously executed code,
|
||||
* such as during layout reflows, it will return false.
|
||||
*/
|
||||
NS_IMETHOD_(PRBool) IsHandlingUserInputExternal() { return IsHandlingUserInput(); }
|
||||
|
||||
nsPresContext* GetPresContext() { return mPresContext; }
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsEventStateManager,
|
||||
nsIEventStateManager)
|
||||
nsIObserver)
|
||||
|
||||
static nsIDocument* sMouseOverDocument;
|
||||
|
||||
static nsIEventStateManager* GetActiveEventStateManager() { return sActiveESM; }
|
||||
static nsEventStateManager* GetActiveEventStateManager() { return sActiveESM; }
|
||||
|
||||
// Sets aNewESM to be the active event state manager, and
|
||||
// if aContent is non-null, marks the object as active.
|
||||
|
@ -489,4 +537,6 @@ private:
|
|||
static void operator delete(void* /*memory*/) {}
|
||||
};
|
||||
|
||||
#define NS_EVENT_NEEDS_FRAME(event) (!NS_IS_ACTIVATION_EVENT(event))
|
||||
|
||||
#endif // nsEventStateManager_h__
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
#include "nsString.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsDOMCSSDeclaration.h"
|
||||
|
@ -1056,9 +1056,8 @@ nsGenericHTMLElement::CheckHandleEventForAnchorsPreconditions(nsEventChainVisito
|
|||
//Need to check if we hit an imagemap area and if so see if we're handling
|
||||
//the event on that map or on a link farther up the tree. If we're on a
|
||||
//link farther up, do nothing.
|
||||
nsCOMPtr<nsIContent> target;
|
||||
aVisitor.mPresContext->EventStateManager()->
|
||||
GetEventTargetContent(aVisitor.mEvent, getter_AddRefs(target));
|
||||
nsCOMPtr<nsIContent> target = aVisitor.mPresContext->EventStateManager()->
|
||||
GetEventTargetContent(aVisitor.mEvent);
|
||||
|
||||
return !target || !IsArea(target) || IsArea(this);
|
||||
}
|
||||
|
@ -3353,7 +3352,7 @@ nsGenericHTMLElement::RegUnRegAccessKey(PRBool aDoReg)
|
|||
nsPresContext *presContext = GetPresContext();
|
||||
|
||||
if (presContext) {
|
||||
nsIEventStateManager *esm = presContext->EventStateManager();
|
||||
nsEventStateManager *esm = presContext->EventStateManager();
|
||||
|
||||
// Register or unregister as appropriate.
|
||||
if (aDoReg) {
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
|
||||
#include "nsHTMLDNSPrefetch.h"
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsILink.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "nsEventStateManager.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDocument.h"
|
||||
|
@ -377,7 +376,7 @@ nsHTMLButtonElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
|
|||
if (static_cast<nsMouseEvent*>(aVisitor.mEvent)->button ==
|
||||
nsMouseEvent::eLeftButton) {
|
||||
if (NS_IS_TRUSTED_EVENT(aVisitor.mEvent)) {
|
||||
nsIEventStateManager* esm =
|
||||
nsEventStateManager* esm =
|
||||
aVisitor.mPresContext->EventStateManager();
|
||||
nsEventStateManager::SetActiveManager(
|
||||
static_cast<nsEventStateManager*>(esm), this);
|
||||
|
|
|
@ -241,13 +241,13 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
|||
}
|
||||
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TextReset)) {
|
||||
// Make <a><font color="red">text</font></a> give the text a red underline
|
||||
// in quirks mode. The NS_STYLE_TEXT_DECORATION_OVERRIDE_ALL flag only
|
||||
// in quirks mode. The NS_STYLE_TEXT_DECORATION_LINE_OVERRIDE_ALL flag only
|
||||
// affects quirks mode rendering.
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::color);
|
||||
nscolor color;
|
||||
if (value && value->GetColorValue(color)) {
|
||||
nsCSSValue* decoration = aData->ValueForTextDecoration();
|
||||
PRInt32 newValue = NS_STYLE_TEXT_DECORATION_OVERRIDE_ALL;
|
||||
nsCSSValue* decoration = aData->ValueForTextDecorationLine();
|
||||
PRInt32 newValue = NS_STYLE_TEXT_DECORATION_LINE_OVERRIDE_ALL;
|
||||
if (decoration->GetUnit() == eCSSUnit_Enumerated) {
|
||||
newValue |= decoration->GetIntValue();
|
||||
}
|
||||
|
|
|
@ -81,7 +81,6 @@
|
|||
#include "nsIHTMLCollection.h"
|
||||
|
||||
#include "nsIConstraintValidation.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
|
||||
#include "nsIDOMHTMLButtonElement.h"
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
#include "nsIFormControlFrame.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsDOMError.h"
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsIFormControl.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
#include "nsEventDispatcher.h"
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
#include "nsIDOMHTMLSelectElement.h"
|
||||
#include "nsNodeInfoManager.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "nsDOMSettableTokenList.h"
|
||||
#include "nsStubMutationObserver.h"
|
||||
#include "nsIConstraintValidation.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "nsHTMLFormElement.h"
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
#include "nsIDOMHTMLOptGroupElement.h"
|
||||
#include "nsHTMLOptionElement.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIBoxObject.h"
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#include "nsMappedAttributes.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsLinebreakConverter.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIFrame.h"
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "nsRadioVisitor.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsHTMLInputElement.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIConstraintValidation.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=287465
|
|||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=287465">Mozilla Bug 287465</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display:none">
|
||||
|
@ -24,6 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=287465
|
|||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(doTest);
|
||||
|
||||
function doTest() {
|
||||
function checkSVGDocument(id) {
|
||||
|
|
|
@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=300691
|
|||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body onload="done();">
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=300691">Mozilla Bug 300691</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
@ -17,7 +17,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=300691
|
|||
</div>
|
||||
<pre id="test">
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
// First, setup. We'll be toggling these variables as we go.
|
||||
var test1Ran = false;
|
||||
var test2Ran = false;
|
||||
|
@ -134,6 +133,9 @@ function done() {
|
|||
"src attribute still got executed, so this shouldn't have been");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(done);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче