Merge Places to mozilla-central

This commit is contained in:
Marco Bonardo 2011-04-23 12:51:58 +02:00
commit 0e997b154f
287 changed files with 3220 additions and 2746 deletions

View File

@ -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;

View File

@ -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"

View File

@ -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"

View File

@ -60,7 +60,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 +206,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 +222,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 *

View File

@ -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.
*/

View File

@ -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"

View File

@ -42,7 +42,7 @@
#include "States.h"
#include "nsCoreUtils.h"
#include "nsIEventStateManager.h"
#include "nsEventStates.h"
////////////////////////////////////////////////////////////////////////////////
// nsHTMLLinkAccessible

View File

@ -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);

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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;"

View File

@ -188,7 +188,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) {
@ -204,7 +203,6 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
}
};
}
#endif
#endif
return null;
});

View File

@ -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"

View File

@ -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

View File

@ -131,6 +131,7 @@ _BROWSER_FILES = \
browser_tabview_bug644097.js \
browser_tabview_bug645653.js \
browser_tabview_bug649006.js \
browser_tabview_bug649307.js \
browser_tabview_dragdrop.js \
browser_tabview_exit_button.js \
browser_tabview_expander.js \

View File

@ -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);
});
}

View File

@ -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"/>

View File

@ -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

View File

@ -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.

View File

@ -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 }
};

View File

@ -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();
},

View File

@ -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.

View File

@ -77,9 +77,7 @@
<menupopup>
<menuitem label="&center.label;" value="CENTER"/>
<menuitem label="&tile.label;" value="TILE"/>
#ifndef WINCE
<menuitem label="&stretch.label;" value="STRETCH"/>
#endif
</menupopup>
</menulist>
<spacer flex="1"/>

View File

@ -47,7 +47,7 @@ XPIDL_MODULE = shellservice
XPIDLSRCS = nsIShellService.idl
ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
ifeq ($(OS_ARCH),WINNT)
XPIDLSRCS += nsIWindowsShellService.idl
endif

View File

@ -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))

View File

@ -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,

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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
;;

View File

@ -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>

View File

@ -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

View File

@ -53,7 +53,6 @@ nsIContentIterator.h \
nsContentErrors.h \
nsContentPolicyUtils.h \
nsContentUtils.h \
nsIContentUtils.h \
nsIDocument.h \
nsIDocumentObserver.h \
nsIMutationObserver.h \

View File

@ -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();

View File

@ -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;

View File

@ -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__ */

View File

@ -39,7 +39,7 @@
#include "Link.h"
#include "nsIEventStateManager.h"
#include "nsEventStates.h"
#include "nsIURL.h"
#include "nsContentUtils.h"

View File

@ -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

View File

@ -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"
@ -6466,23 +6465,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 +6491,7 @@ nsIContentUtils::FindInternalContentViewer(const char* aType,
*aLoaderType = TYPE_PLUGIN;
else
*aLoaderType = TYPE_UNKNOWN;
}
}
return docFactory.forget();
}
@ -6544,17 +6529,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);
}

View File

@ -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"
@ -219,19 +218,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 +238,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 +245,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 +424,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 +2552,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 +2565,7 @@ void
nsDocument::RemoveFromNameTable(Element *aElement, nsIAtom* aName)
{
// Speed up document teardown
if (!mIsRegularHTML || mIdentifierMap.Count() == 0)
if (mIdentifierMap.Count() == 0)
return;
nsIdentifierMapEntry *entry =
@ -5919,21 +5883,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)
{

View File

@ -168,14 +168,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 +254,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;

View File

@ -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;
}

View File

@ -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

View File

@ -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"
@ -110,7 +110,6 @@
#include "nsIServiceManager.h"
#include "nsIDOMEventListener.h"
#include "nsEventStateManager.h"
#include "nsIWebNavigation.h"
#include "nsIBaseWindow.h"
@ -5379,10 +5378,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 +5466,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,

View File

@ -62,7 +62,7 @@
#include "nsPLDOMEvent.h"
#include "nsIPresShell.h"
#include "nsIEventStateManager.h"
#include "nsEventStates.h"
#include "nsGUIEvent.h"
#include "nsIChannel.h"

View File

@ -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"

View File

@ -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;
}
}
}

View File

@ -45,6 +45,7 @@
#define nsTextFragment_h___
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsTraceRefcnt.h"
class nsString;
class nsCString;

View File

@ -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 \

View File

@ -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>

View File

@ -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);

View File

@ -48,7 +48,6 @@ XPIDL_MODULE = content_events
EXPORTS = \
nsMutationEvent.h \
nsIEventListenerManager.h \
nsIEventStateManager.h \
nsIPrivateDOMEvent.h \
nsIPrivateTextEvent.h \
nsIPrivateTextRange.h \

View File

@ -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__

View File

@ -46,6 +46,10 @@ MODULE = content
LIBRARY_NAME = gkconevents_s
LIBXUL_LIBRARY = 1
EXPORTS = \
nsEventStateManager.h \
$(NULL)
CPPSRCS = \
nsEventListenerManager.cpp \
nsEventStateManager.cpp \

View File

@ -39,7 +39,6 @@
#include "nsIServiceManager.h"
#include "nsGUIEvent.h"
#include "nsContentUtils.h"
#include "nsIEventStateManager.h"
#include "nsDOMDataTransfer.h"
#include "nsIDragService.h"

View File

@ -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

View File

@ -40,7 +40,6 @@
#include "nsDOMMouseEvent.h"
#include "nsGUIEvent.h"
#include "nsIContent.h"
#include "nsIEventStateManager.h"
#include "nsContentUtils.h"
nsDOMMouseEvent::nsDOMMouseEvent(nsPresContext* aPresContext,

View File

@ -38,7 +38,6 @@
#include "nsDOMMouseScrollEvent.h"
#include "nsGUIEvent.h"
#include "nsIContent.h"
#include "nsIEventStateManager.h"
#include "nsContentUtils.h"
nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(nsPresContext* aPresContext,

View File

@ -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"
@ -258,7 +258,7 @@ nsDOMUIEvent::GetRangeParent(nsIDOMNode** aRangeParent)
nsIFrame* targetFrame = nsnull;
if (mPresContext) {
mPresContext->EventStateManager()->GetEventTarget(&targetFrame);
targetFrame = mPresContext->EventStateManager()->GetEventTarget();
}
*aRangeParent = nsnull;
@ -286,7 +286,7 @@ nsDOMUIEvent::GetRangeOffset(PRInt32* aRangeOffset)
nsIFrame* targetFrame = nsnull;
if (mPresContext) {
mPresContext->EventStateManager()->GetEventTarget(&targetFrame);
targetFrame = mPresContext->EventStateManager()->GetEventTarget();
}
if (targetFrame) {
@ -334,8 +334,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);

View File

@ -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"

View File

@ -811,7 +811,7 @@ nsEventStateManager::UpdateUserActivityTimer(void)
return NS_OK;
}
NS_IMETHODIMP
nsresult
nsEventStateManager::Init()
{
nsCOMPtr<nsIObserverService> observerService =
@ -996,8 +996,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 +1046,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 +2816,7 @@ NodeAllowsClickThrough(nsINode* aNode)
}
#endif
NS_IMETHODIMP
nsresult
nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
nsEvent *aEvent,
nsIFrame* aTargetFrame,
@ -2993,8 +2991,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 +3353,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 +3429,7 @@ nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
}
}
NS_IMETHODIMP
nsresult
nsEventStateManager::SetCursor(PRInt32 aCursor, imgIContainer* aContainer,
PRBool aHaveHotspot,
float aHotspotX, float aHotspotY,
@ -3698,8 +3691,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 +3749,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 +3794,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 +4082,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 +4108,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 +4402,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 +4435,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

View File

@ -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__

View File

@ -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) {

View File

@ -47,7 +47,6 @@
#include "nsIPresShell.h"
#include "nsIDocument.h"
#include "nsPresContext.h"
#include "nsIEventStateManager.h"
#include "nsHTMLDNSPrefetch.h"

View File

@ -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"

View File

@ -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);

View File

@ -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();
}

View File

@ -81,7 +81,6 @@
#include "nsIHTMLCollection.h"
#include "nsIConstraintValidation.h"
#include "nsIEventStateManager.h"
#include "nsIDOMHTMLButtonElement.h"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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) {

View File

@ -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>

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=372098
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<base target="bug372098"></base>
</head>
<body onload="handle_load();">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=372098">Mozilla Bug 372098</a>
<p id="display"></p>
<div id="content" style="display:none;">
@ -30,9 +30,11 @@ var area_passed = false;
/* Start the test */
SimpleTest.waitForExplicitFinish();
addLoadEvent(handle_load);
function handle_load()
{
SimpleTest.waitForExplicitFinish();
sendMouseEvent({type:'click'}, 'a');
}

View File

@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=518122
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTests()">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=518122">Mozilla Bug 518122</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -21,6 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=518122
/** Test for Bug 518122 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTests);
var simple_tests = [ ["foo", "foo"],
["", ""],

View File

@ -6,9 +6,10 @@
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTest()">
<body>
<script>
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTest);
function runTest()
{

View File

@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=557087
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTest();">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=557087">Mozilla Bug 557087</a>
<p id="display"></p>
<div id="content">
@ -30,6 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=557087
/** Test for Bug 557087 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTest);
var testResults = [
"data:text/html,?",

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=561636
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTest();">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=561636">Mozilla Bug 561636</a>
<p id="display"></p>
<iframe style='width:50px; height: 50px;' name='t'></iframe>
@ -41,6 +41,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=561636
/** Test for Bug 561636 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTest);
function runTest()
{

View File

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=566046
<base target='frame2'>
<base target=''>
</head>
<body onload="setTimeout(runTests);">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=566046">Mozilla Bug 566046</a>
<p id="display"></p>
<style>
@ -82,6 +82,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=566046
/** Test for Bug 566046 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
setTimeout(runTests, 0);
});
var gTestResults = {
frame1: "data:text/html,?foo=foo",

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=566160
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="setTimeout(runTests);">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=566160">Mozilla Bug 566160</a>
<p id="display"></p>
<style>
@ -69,6 +69,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=566160
/** Test for Bug 566160 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
setTimeout(runTests, 0);
});
var gTestResults = {
frame1: "data:text/html,?foo=foo",

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=567938
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTests();">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=567938">Mozilla Bug 567938</a>
<p id="display"></p>
<iframe id='iframe' name="submit_frame" style="visibility: hidden;"></iframe>
@ -24,6 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=567938
/** Test for Bug 567938 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTests);
var gTestData = ["submit", "image"];
var gCurrentTest = 0;

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=567938
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTests();">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=567938">Mozilla Bug 567938</a>
<p id="display"></p>
<iframe id='iframe' name="submit_frame" style="visibility: hidden;"></iframe>
@ -24,6 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=567938
/** Test for Bug 567938 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTests);
var gTestData = ["submit", "image"];
var gCurrentTest = 0;

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=567938
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTests();">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=567938">Mozilla Bug 567938</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -22,6 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=567938
/** Test for Bug 567938 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTests);
function runTests()
{

View File

@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=569955
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="SimpleTest.executeSoon(runTests);">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=569955">Mozilla Bug 569955</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -20,8 +20,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=569955
/** Test for Bug 569955 **/
SimpleTest.waitForExplicitFinish();
function runTests()
{
isnot(document.activeElement, document.getElementById('i'),
@ -29,6 +27,11 @@ function runTests()
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
setTimeout(runTests, 0);
});
</script>
</pre>
</body>

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=566160
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="setTimeout(runTests);">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=566160">Mozilla Bug 566160</a>
<p id="display"></p>
<style>
@ -84,6 +84,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=566160
/** Test for Bug 566160 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
setTimeout(runTests, 0);
});
var gTestResults = {
frame1: "data:text/html,?foo=foo",

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=566160
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="setTimeout(runTests);">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=566160">Mozilla Bug 566160</a>
<p id="display"></p>
<style>
@ -84,6 +84,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=566160
/** Test for Bug 566160 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
setTimeout(runTests, 0);
});
var gTestResults = {
frame1: '[{\"headers\":{\"Content-Disposition\":\"form-data; name=\\\"foo\\\"\"},\"body\":\"foo\"}]',
frame2: '[{\"headers\":{\"Content-Disposition\":\"form-data; name=\\\"bar\\\"\"},\"body\":\"bar\"},{\"headers\":{\"Content-Disposition\":\"form-data; name=\\\"x\\\"\"},\"body\":\"0\"},{\"headers\":{\"Content-Disposition\":\"form-data; name=\\\"y\\\"\"},\"body\":\"0\"}]',

View File

@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=596350
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTests();">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=596350">Mozilla Bug 596350</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -23,6 +23,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=596350
/** Test for Bug 596350 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTests);
var testData = [
// Object 0

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=523771
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="gen.next();">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=523771">Mozilla Bug 523771</a>
<p id="display"></p>
<iframe name="target_iframe" id="target_iframe"></iframe>
@ -67,10 +67,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=523771
<pre id="test">
<script class="testbody" type="text/javascript;version=1.8">
SimpleTest.waitForExplicitFinish();
var gen = runTest();
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
gen.next();
});
var expectedSub = [
// Submit input
[{ name: "n1_1", value: "v1_1" }],

View File

@ -124,7 +124,6 @@
#include "nsIMutableArray.h"
#include "nsArrayUtils.h"
#include "nsIEffectiveTLDService.h"
#include "nsIEventStateManager.h"
#include "nsIPrompt.h"
//AHMED 12-2
@ -333,7 +332,6 @@ nsHTMLDocument::Init()
// to match our compat mode.
CSSLoader()->SetCompatibilityMode(mCompatMode);
PrePopulateIdentifierMap();
return NS_OK;
}
@ -356,8 +354,6 @@ nsHTMLDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
nsDocument::ResetToURI(aURI, aLoadGroup, aPrincipal);
PrePopulateIdentifierMap();
mImages = nsnull;
mApplets = nsnull;
mEmbeds = nsnull;
@ -1368,18 +1364,6 @@ nsHTMLDocument::SetXmlVersion(const nsAString& aXmlVersion)
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
NS_IMETHODIMP
nsHTMLDocument::GetStrictErrorChecking(PRBool* aStrictErrorChecking)
{
return nsDocument::GetStrictErrorChecking(aStrictErrorChecking);
}
NS_IMETHODIMP
nsHTMLDocument::SetStrictErrorChecking(PRBool aStrictErrorChecking)
{
return nsDocument::SetStrictErrorChecking(aStrictErrorChecking);
}
NS_IMETHODIMP
nsHTMLDocument::GetDocumentURI(nsAString& aDocumentURI)
{
@ -2536,30 +2520,6 @@ nsHTMLDocument::GetPlugins(nsIDOMHTMLCollection** aPlugins)
return GetEmbeds(aPlugins);
}
static void
FindNamedItems(nsIAtom* aName, nsIContent *aContent,
nsIdentifierMapEntry* aEntry)
{
NS_ASSERTION(aEntry->HasNameContentList(),
"Entry w/o content list passed to FindNamedItems()!");
NS_ASSERTION(!aEntry->IsInvalidName(),
"Entry that should never have a list passed to FindNamedItems()!");
if (aContent->HasName()) {
NS_ASSERTION(nsGenericHTMLElement::FromContent(aContent),
"Only HTML Elements should have a name");
nsGenericHTMLElement* elm = static_cast<nsGenericHTMLElement*>(aContent);
if (elm->GetParsedAttr(nsGkAtoms::name)->GetAtomValue() == aName) {
aEntry->AddNameElement(elm);
}
}
for (nsINode::ChildIterator iter(aContent); !iter.IsDone(); iter.Next()) {
FindNamedItems(aName, iter, aEntry);
}
}
nsresult
nsHTMLDocument::ResolveName(const nsAString& aName,
nsIDOMHTMLFormElement *aForm,
@ -2569,47 +2529,16 @@ nsHTMLDocument::ResolveName(const nsAString& aName,
*aResult = nsnull;
*aCache = nsnull;
// We have built a table and cache the named items. The table will
// be updated as content is added and removed.
nsIdentifierMapEntry *entry = mIdentifierMap.PutEntry(aName);
NS_ENSURE_TRUE(entry, NS_ERROR_OUT_OF_MEMORY);
if (entry->IsInvalidName()) {
// There won't be any named items by this name -- it's reserved
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(aName);
if (!entry) {
return NS_OK;
}
// Now we know we _might_ have items.
if (!entry->HasNameContentList()) {
#ifdef DEBUG_jst
{
printf ("nsHTMLDocument name cache miss for name '%s'\n",
NS_ConvertUTF16toUTF8(aName).get());
}
#endif
nsresult rv = entry->CreateNameContentList();
if (NS_FAILED(rv))
return rv;
Element* root = GetRootElement();
if (root && !aName.IsEmpty()) {
// do_GetAtom() can fail on OOM, but it'll only do that if the
// atom doesn't already exist, which means the named item
// doesn't exist either.
nsCOMPtr<nsIAtom> name(do_GetAtom(aName));
if (name) {
FindNamedItems(name, root, entry);
}
}
}
PRUint32 length = 0;
nsBaseContentList *list = entry->GetNameContentList();
PRUint32 length;
list->GetLength(&length);
if (list) {
list->GetLength(&length);
}
if (length > 0) {
if (length == 1) {
@ -2683,32 +2612,6 @@ nsHTMLDocument::ResolveName(const nsAString& aName,
return NS_OK;
}
// Pre-fill the name hash with names that are likely to be resolved in
// this document to avoid walking the tree looking for elements with
// these names.
nsresult
nsHTMLDocument::PrePopulateIdentifierMap()
{
static const char names[][13] = {
"write", "writeln", "open", "close", "forms", "elements",
"characterSet", "nodeType", "parentNode", "cookie"
};
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(names); ++i) {
nsCOMPtr<nsIAtom> atom(do_GetAtom(names[i]));
NS_ENSURE_TRUE(atom, NS_ERROR_OUT_OF_MEMORY);
nsIdentifierMapEntry* entry =
mIdentifierMap.PutEntry(nsDependentAtomString(atom));
NS_ENSURE_TRUE(entry, NS_ERROR_OUT_OF_MEMORY);
entry->SetInvalidName();
}
return NS_OK;
}
//----------------------------
/* virtual */ nsIContent*

View File

@ -243,8 +243,6 @@ protected:
nsresult GetBodySize(PRInt32* aWidth,
PRInt32* aHeight);
nsresult PrePopulateIdentifierMap();
nsIContent *MatchId(nsIContent *aContent, const nsAString& aId);
static PRBool MatchLinks(nsIContent *aContent, PRInt32 aNamespaceID,

View File

@ -47,7 +47,7 @@
#include "nsMappedAttributes.h"
#include "nsStyleConsts.h"
#include "nsIDocument.h"
#include "nsIEventStateManager.h"
#include "nsEventStates.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsDOMClassInfoID.h"

View File

@ -566,7 +566,7 @@ PRInt64 nsAudioStreamLocal::GetSampleOffset()
#if defined(XP_WIN)
positionType = SA_POSITION_WRITE_HARDWARE;
#endif
PRInt64 position = 0;
int64_t position = 0;
if (sa_stream_get_position(static_cast<sa_stream_t*>(mAudioHandle),
positionType, &position) == SA_SUCCESS) {
return position / sizeof(short);

View File

@ -273,7 +273,9 @@ nsSMILCSSProperty::IsPropertyAnimatable(nsCSSProperty aPropID)
case eCSSProperty_stroke_opacity:
case eCSSProperty_stroke_width:
case eCSSProperty_text_anchor:
case eCSSProperty_text_blink:
case eCSSProperty_text_decoration:
case eCSSProperty_text_decoration_line:
case eCSSProperty_text_rendering:
case eCSSProperty_visibility:
case eCSSProperty_word_spacing:

Some files were not shown because too many files have changed in this diff Show More