зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central into electrolysis.
This commit is contained in:
Коммит
8015642d58
|
@ -333,13 +333,13 @@ var FullZoom = {
|
|||
* one.
|
||||
**/
|
||||
_applyPrefToSetting: function FullZoom__applyPrefToSetting(aValue, aBrowser) {
|
||||
if (!this.siteSpecific && !this._inPrivateBrowsing)
|
||||
if ((!this.siteSpecific && !this._inPrivateBrowsing) ||
|
||||
gInPrintPreviewMode)
|
||||
return;
|
||||
|
||||
var browser = aBrowser || gBrowser.selectedBrowser;
|
||||
try {
|
||||
if (gInPrintPreviewMode ||
|
||||
browser.contentDocument instanceof Ci.nsIImageDocument ||
|
||||
if (browser.contentDocument instanceof Ci.nsIImageDocument ||
|
||||
this._inPrivateBrowsing)
|
||||
ZoomManager.setZoomForBrowser(browser, 1);
|
||||
else if (typeof aValue != "undefined")
|
||||
|
|
|
@ -1101,14 +1101,18 @@ function HandleAppCommandEvent(evt) {
|
|||
}
|
||||
|
||||
function prepareForStartup() {
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
|
||||
gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false);
|
||||
// Note: we need to listen to untrusted events, because the pluginfinder XBL
|
||||
// binding can't fire trusted ones (runs with page privileges).
|
||||
gBrowser.addEventListener("PluginNotFound", gMissingPluginInstaller.newMissingPlugin, true, true);
|
||||
gBrowser.addEventListener("PluginCrashed", gMissingPluginInstaller.pluginInstanceCrashed, true, true);
|
||||
gBrowser.addEventListener("PluginBlocklisted", gMissingPluginInstaller.newMissingPlugin, true, true);
|
||||
gBrowser.addEventListener("PluginOutdated", gMissingPluginInstaller.newMissingPlugin, true, true);
|
||||
gBrowser.addEventListener("PluginDisabled", gMissingPluginInstaller.newDisabledPlugin, true, true);
|
||||
gBrowser.addEventListener("NewPluginInstalled", gMissingPluginInstaller.refreshBrowser, false);
|
||||
os.addObserver(gMissingPluginInstaller.pluginCrashed, "plugin-crashed", false);
|
||||
window.addEventListener("AppCommand", HandleAppCommandEvent, true);
|
||||
|
||||
var webNavigation;
|
||||
|
@ -1152,7 +1156,6 @@ function prepareForStartup() {
|
|||
// progress notifications for back/forward button updating
|
||||
webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"]
|
||||
.createInstance(Components.interfaces.nsISHistory);
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
||||
os.addObserver(gBrowser.browsers[0], "browser:purge-session-history", false);
|
||||
|
||||
// remove the disablehistory attribute so the browser cleans up, as
|
||||
|
@ -2536,11 +2539,34 @@ function BrowserReloadWithFlags(reloadFlags) {
|
|||
}
|
||||
|
||||
var PrintPreviewListener = {
|
||||
_printPreviewTab: null,
|
||||
_tabBeforePrintPreview: null,
|
||||
|
||||
getPrintPreviewBrowser: function () {
|
||||
if (!this._printPreviewTab) {
|
||||
this._tabBeforePrintPreview = gBrowser.selectedTab;
|
||||
this._printPreviewTab = gBrowser.loadOneTab("about:blank",
|
||||
{ inBackground: false });
|
||||
gBrowser.selectedTab = this._printPreviewTab;
|
||||
}
|
||||
return gBrowser.getBrowserForTab(this._printPreviewTab);
|
||||
},
|
||||
getSourceBrowser: function () {
|
||||
return this._tabBeforePrintPreview ?
|
||||
this._tabBeforePrintPreview.linkedBrowser : gBrowser.selectedBrowser;
|
||||
},
|
||||
getNavToolbox: function () {
|
||||
return gNavToolbox;
|
||||
},
|
||||
onEnter: function () {
|
||||
gInPrintPreviewMode = true;
|
||||
this._toggleAffectedChrome();
|
||||
},
|
||||
onExit: function () {
|
||||
gBrowser.selectedTab = this._tabBeforePrintPreview;
|
||||
this._tabBeforePrintPreview = null;
|
||||
gBrowser.removeTab(this._printPreviewTab);
|
||||
this._printPreviewTab = null;
|
||||
gInPrintPreviewMode = false;
|
||||
this._toggleAffectedChrome();
|
||||
},
|
||||
|
@ -2572,8 +2598,7 @@ var PrintPreviewListener = {
|
|||
this._chromeState.sidebarOpen = !sidebar.hidden;
|
||||
this._sidebarCommand = sidebar.getAttribute("sidebarcommand");
|
||||
|
||||
this._chromeState.hadTabStrip = gBrowser.getStripVisibility();
|
||||
gBrowser.setStripVisibilityTo(false);
|
||||
gBrowser.mStrip.setAttribute("moz-collapsed", "true");
|
||||
|
||||
var notificationBox = gBrowser.getNotificationBox();
|
||||
this._chromeState.notificationsOpen = !notificationBox.notificationsHidden;
|
||||
|
@ -2588,8 +2613,7 @@ var PrintPreviewListener = {
|
|||
gFindBar.close();
|
||||
},
|
||||
_showChrome: function () {
|
||||
if (this._chromeState.hadTabStrip)
|
||||
gBrowser.setStripVisibilityTo(true);
|
||||
gBrowser.mStrip.removeAttribute("moz-collapsed");
|
||||
|
||||
if (this._chromeState.notificationsOpen)
|
||||
gBrowser.getNotificationBox().notificationsHidden = false;
|
||||
|
@ -2602,11 +2626,6 @@ var PrintPreviewListener = {
|
|||
}
|
||||
}
|
||||
|
||||
function getPPBrowser()
|
||||
{
|
||||
return gBrowser;
|
||||
}
|
||||
|
||||
function getMarkupDocumentViewer()
|
||||
{
|
||||
return gBrowser.markupDocumentViewer;
|
||||
|
@ -5977,7 +5996,23 @@ function getPluginInfo(pluginElement)
|
|||
|
||||
var gMissingPluginInstaller = {
|
||||
|
||||
get CrashSubmit() {
|
||||
delete this.CrashSubmit;
|
||||
Cu.import("resource://gre/modules/CrashSubmit.jsm", this);
|
||||
return this.CrashSubmit;
|
||||
},
|
||||
|
||||
get crashReportHelpURL() {
|
||||
delete this.crashReportHelpURL;
|
||||
let url = formatURL("app.support.baseURL", true);
|
||||
url += "plugin-crashed";
|
||||
this.crashReportHelpURL = url;
|
||||
return this.crashReportHelpURL;
|
||||
},
|
||||
|
||||
installSinglePlugin: function (aEvent) {
|
||||
if (!aEvent.isTrusted)
|
||||
return;
|
||||
var missingPluginsArray = {};
|
||||
|
||||
var pluginInfo = getPluginInfo(aEvent.target);
|
||||
|
@ -5993,6 +6028,8 @@ var gMissingPluginInstaller = {
|
|||
},
|
||||
|
||||
managePlugins: function (aEvent) {
|
||||
if (!aEvent.isTrusted)
|
||||
return;
|
||||
BrowserOpenAddonsMgr("plugins");
|
||||
aEvent.stopPropagation();
|
||||
},
|
||||
|
@ -6014,6 +6051,11 @@ var gMissingPluginInstaller = {
|
|||
aEvent.target.addEventListener("click",
|
||||
gMissingPluginInstaller.installSinglePlugin,
|
||||
true);
|
||||
aEvent.target.addEventListener("keydown",
|
||||
function(evt) { if (evt.keyCode == evt.DOM_VK_RETURN)
|
||||
gMissingPluginInstaller.installSinglePlugin(evt) },
|
||||
true);
|
||||
|
||||
}
|
||||
|
||||
let hideBarPrefName = aEvent.type == "PluginOutdated" ?
|
||||
|
@ -6137,6 +6179,133 @@ var gMissingPluginInstaller = {
|
|||
aEvent.target.addEventListener("click",
|
||||
gMissingPluginInstaller.managePlugins,
|
||||
true);
|
||||
aEvent.target.addEventListener("keydown",
|
||||
function(evt) { if (evt.keyCode == evt.DOM_VK_RETURN)
|
||||
gMissingPluginInstaller.managePlugins(evt) },
|
||||
true);
|
||||
},
|
||||
|
||||
// Crashed-plugin observer. Notified once per plugin crash, before events
|
||||
// are dispatched to individual plugin instances.
|
||||
pluginCrashed : function(subject, topic, data) {
|
||||
let propertyBag = subject;
|
||||
if (!(propertyBag instanceof Ci.nsIPropertyBag2) ||
|
||||
!(propertyBag instanceof Ci.nsIWritablePropertyBag2))
|
||||
return;
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
let minidumpID = subject.getPropertyAsAString("minidumpID");
|
||||
let submitReports = gCrashReporter.submitReports;
|
||||
// The crash reporter wants a DOM element it can append an IFRAME to,
|
||||
// which it uses to submit a form. Let's just give it gBrowser.
|
||||
if (submitReports)
|
||||
gMissingPluginInstaller.CrashSubmit.submit(minidumpID, gBrowser, null, null);
|
||||
propertyBag.setPropertyAsBool("submittedCrashReport", submitReports);
|
||||
#endif
|
||||
},
|
||||
|
||||
pluginInstanceCrashed: function (aEvent) {
|
||||
// Evil content could fire a fake event at us, ignore them.
|
||||
if (!aEvent.isTrusted)
|
||||
return;
|
||||
|
||||
if (!(aEvent instanceof Ci.nsIDOMDataContainerEvent))
|
||||
return;
|
||||
|
||||
let submittedReport = aEvent.getData("submittedCrashReport");
|
||||
let pluginName = aEvent.getData("pluginName");
|
||||
|
||||
// We're expecting this to be a plugin.
|
||||
let plugin = aEvent.target;
|
||||
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
|
||||
return;
|
||||
|
||||
// Force a style flush, so that we ensure our binding is attached.
|
||||
plugin.clientTop;
|
||||
|
||||
let messageString = gNavigatorBundle.getFormattedString("crashedpluginsMessage.title", [pluginName]);
|
||||
|
||||
//
|
||||
// Configure the crashed-plugin placeholder.
|
||||
//
|
||||
let doc = plugin.ownerDocument;
|
||||
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
|
||||
|
||||
// The binding has role="link" here, since missing/disabled/blocked
|
||||
// plugin UI has a onclick handler on the whole thing. This isn't needed
|
||||
// for the plugin-crashed UI, because we use actual HTML links in the text.
|
||||
overlay.removeAttribute("role");
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
let helpClass = submittedReport ? "submitLink" : "notSubmitLink";
|
||||
let helpLink = doc.getAnonymousElementByAttribute(plugin, "class", helpClass);
|
||||
helpLink.href = gMissingPluginInstaller.crashReportHelpURL;
|
||||
let showClass = submittedReport ? "msg msgSubmitted" : "msg msgNotSubmitted";
|
||||
let textToShow = doc.getAnonymousElementByAttribute(plugin, "class", showClass);
|
||||
textToShow.style.display = "block";
|
||||
#endif
|
||||
|
||||
let crashText = doc.getAnonymousElementByAttribute(plugin, "class", "msg msgCrashed");
|
||||
crashText.textContent = messageString;
|
||||
|
||||
let link = doc.getAnonymousElementByAttribute(plugin, "class", "reloadLink");
|
||||
link.addEventListener("click", function(e) { if (e.isTrusted) browser.reload(); }, true);
|
||||
|
||||
let browser = gBrowser.getBrowserForDocument(plugin.ownerDocument
|
||||
.defaultView.top.document);
|
||||
let notificationBox = gBrowser.getNotificationBox(browser);
|
||||
|
||||
// Is the <object>'s size too small to hold what we want to show?
|
||||
let pluginRect = plugin.getBoundingClientRect();
|
||||
// XXX bug 446693. The text-shadow on the submitted-report text at
|
||||
// the bottom causes scrollHeight to be larger than it should be.
|
||||
let isObjectTooSmall = (overlay.scrollWidth > pluginRect.width) ||
|
||||
(overlay.scrollHeight - 5 > pluginRect.height);
|
||||
if (isObjectTooSmall) {
|
||||
// Hide the overlay's contents. Use visibility style, so that it
|
||||
// doesn't collapse down to 0x0.
|
||||
overlay.style.visibility = "hidden";
|
||||
// If another plugin on the page was large enough to show our UI, we
|
||||
// don't want to show a notification bar.
|
||||
if (!doc.mozNoPluginCrashedNotification)
|
||||
showNotificationBar();
|
||||
} else {
|
||||
// If a previous plugin on the page was too small and resulted in
|
||||
// adding a notification bar, then remove it because this plugin
|
||||
// instance it big enough to serve as in-content notification.
|
||||
hideNotificationBar();
|
||||
doc.mozNoPluginCrashedNotification = true;
|
||||
}
|
||||
|
||||
function hideNotificationBar() {
|
||||
let notification = notificationBox.getNotificationWithValue("plugin-crashed");
|
||||
if (notification)
|
||||
notificationBox.removeNotification(notification, true);
|
||||
}
|
||||
|
||||
function showNotificationBar() {
|
||||
// If there's already an existing notification bar, don't do anything.
|
||||
let notification = notificationBox.getNotificationWithValue("plugin-crashed");
|
||||
if (notification)
|
||||
return;
|
||||
|
||||
// Configure the notification bar
|
||||
let priority = notificationBox.PRIORITY_WARNING_MEDIUM;
|
||||
let iconURL = "chrome://mozapps/skin/plugins/pluginGeneric-16.png";
|
||||
let label = gNavigatorBundle.getString("crashedpluginsMessage.reloadButton.label");
|
||||
let accessKey = gNavigatorBundle.getString("crashedpluginsMessage.reloadButton.accesskey");
|
||||
|
||||
let buttons = [{
|
||||
label: label,
|
||||
accessKey: accessKey,
|
||||
popup: null,
|
||||
callback: function() { browser.reload(); },
|
||||
}];
|
||||
|
||||
let notification = notificationBox.appendNotification(messageString, "plugin-crashed",
|
||||
iconURL, priority, buttons);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
refreshBrowser: function (aEvent) {
|
||||
|
|
|
@ -66,6 +66,9 @@ var gAdvancedPane = {
|
|||
this.updateModeItems();
|
||||
#endif
|
||||
this.updateOfflineApps();
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
this.initSubmitCrashes();
|
||||
#endif
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -139,6 +142,35 @@ var gAdvancedPane = {
|
|||
return checkbox.checked ? (this._storedSpellCheck == 2 ? 2 : 1) : 0;
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
initSubmitCrashes: function ()
|
||||
{
|
||||
var checkbox = document.getElementById("submitCrashesBox");
|
||||
try {
|
||||
var cr = Components.classes["@mozilla.org/toolkit/crash-reporter;1"].
|
||||
getService(Components.interfaces.nsICrashReporter);
|
||||
checkbox.checked = cr.submitReports;
|
||||
} catch (e) {
|
||||
checkbox.style.display = "none";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
updateSubmitCrashes: function ()
|
||||
{
|
||||
var checkbox = document.getElementById("submitCrashesBox");
|
||||
try {
|
||||
var cr = Components.classes["@mozilla.org/toolkit/crash-reporter;1"].
|
||||
getService(Components.interfaces.nsICrashReporter);
|
||||
cr.submitReports = checkbox.checked;
|
||||
} catch (e) { }
|
||||
},
|
||||
|
||||
|
||||
// NETWORK TAB
|
||||
|
||||
/*
|
||||
|
|
|
@ -184,7 +184,7 @@
|
|||
|
||||
#ifdef HAVE_SHELL_SERVICE
|
||||
<!-- System Defaults -->
|
||||
<groupbox id="systemDefaultsGroup" orient="horizontal">
|
||||
<groupbox id="systemDefaultsGroup" orient="vertical">
|
||||
<caption label="&systemDefaults.label;"/>
|
||||
|
||||
<hbox id="checkDefaultBox" align="center" flex="1">
|
||||
|
@ -196,6 +196,11 @@
|
|||
oncommand="gAdvancedPane.checkNow()"
|
||||
preference="pref.general.disable_button.default_browser"/>
|
||||
</hbox>
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
<checkbox id="submitCrashesBox" flex="1"
|
||||
oncommand="gAdvancedPane.updateSubmitCrashes();"
|
||||
label="&submitCrashes.label;" accesskey="&submitCrashes.accesskey;"/>
|
||||
#endif
|
||||
</groupbox>
|
||||
#endif
|
||||
</tabpanel>
|
||||
|
|
|
@ -74,6 +74,9 @@ blockedpluginsMessage.infoButton.label=Details…
|
|||
blockedpluginsMessage.infoButton.accesskey=D
|
||||
blockedpluginsMessage.searchButton.label=Update Plugins…
|
||||
blockedpluginsMessage.searchButton.accesskey=U
|
||||
crashedpluginsMessage.title=The %S plugin has crashed.
|
||||
crashedpluginsMessage.reloadButton.label=Reload page
|
||||
crashedpluginsMessage.reloadButton.accesskey=R
|
||||
|
||||
# Sanitize
|
||||
# LOCALIZATION NOTE (sanitizeDialog2.everything.title): When "Time range to
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
<!ENTITY alwaysCheckDefault.accesskey "w">
|
||||
<!ENTITY checkNow.label "Check Now">
|
||||
<!ENTITY checkNow.accesskey "N">
|
||||
<!ENTITY submitCrashes.label "Submit crash reports">
|
||||
<!ENTITY submitCrashes.accesskey "S">
|
||||
|
||||
<!ENTITY networkTab.label "Network">
|
||||
|
||||
|
|
|
@ -623,15 +623,9 @@ HAS_OGLES = @HAS_OGLES@
|
|||
|
||||
MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
|
||||
|
||||
NS_OSSO = @NS_OSSO@
|
||||
MOZ_PLATFORM_HILDON = @MOZ_PLATFORM_HILDON@
|
||||
|
||||
LIBHILDONMIME_CFLAGS = @LIBHILDONMIME_CFLAGS@
|
||||
LIBHILDONMIME_LIBS = @LIBHILDONMIME_LIBS@
|
||||
LIBOSSO_CFLAGS = @LIBOSSO_CFLAGS@
|
||||
LIBOSSO_LIBS = @LIBOSSO_LIBS@
|
||||
LIBHILDONFM_CFLAGS = @LIBHILDONFM_CFLAGS@
|
||||
LIBHILDONFM_LIBS = @LIBHILDONFM_LIBS@
|
||||
MOZ_PLATFORM_MAEMO = @MOZ_PLATFORM_MAEMO@
|
||||
MOZ_PLATFORM_MAEMO_CFLAGS = @MOZ_PLATFORM_MAEMO_CFLAGS@
|
||||
MOZ_PLATFORM_MAEMO_LIBS = @MOZ_PLATFORM_MAEMO_LIBS@
|
||||
|
||||
MOZ_ENABLE_LIBCONIC = @MOZ_ENABLE_LIBCONIC@
|
||||
LIBCONIC_CFLAGS = @LIBCONIC_CFLAGS@
|
||||
|
|
|
@ -380,6 +380,7 @@ _OBJS = \
|
|||
$(JRI_STUB_CFILES) \
|
||||
$(addsuffix .$(OBJ_SUFFIX), $(JMC_GEN)) \
|
||||
$(CSRCS:.c=.$(OBJ_SUFFIX)) \
|
||||
$(SSRCS:.S=.$(OBJ_SUFFIX)) \
|
||||
$(patsubst %.cc,%.$(OBJ_SUFFIX),$(CPPSRCS:.cpp=.$(OBJ_SUFFIX))) \
|
||||
$(CMSRCS:.m=.$(OBJ_SUFFIX)) \
|
||||
$(CMMSRCS:.mm=.$(OBJ_SUFFIX)) \
|
||||
|
|
|
@ -1009,12 +1009,10 @@ hunspell.hxx
|
|||
#if MOZ_NATIVE_BZ2==1
|
||||
bzlib.h
|
||||
#endif
|
||||
#ifdef MOZ_PLATFORM_HILDON
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
hildon-uri.h
|
||||
hildon-mime.h
|
||||
hildon-file-chooser-dialog.h
|
||||
#endif
|
||||
#ifdef NS_OSSO
|
||||
libosso.h
|
||||
osso-mem.h
|
||||
#endif
|
||||
|
|
135
configure.in
135
configure.in
|
@ -403,28 +403,28 @@ else
|
|||
AC_CHECK_PROGS(STRIP, strip, :)
|
||||
AC_CHECK_PROGS(WINDRES, windres, :)
|
||||
if test -z "$HOST_CC"; then
|
||||
HOST_CC="$CC"
|
||||
HOST_CC='$(CC)'
|
||||
fi
|
||||
if test -z "$HOST_CFLAGS"; then
|
||||
HOST_CFLAGS="$CFLAGS"
|
||||
HOST_CFLAGS='$(CFLAGS)'
|
||||
fi
|
||||
if test -z "$HOST_CXX"; then
|
||||
HOST_CXX="$CXX"
|
||||
HOST_CXX='$(CXX)'
|
||||
fi
|
||||
if test -z "$HOST_CXXFLAGS"; then
|
||||
HOST_CXXFLAGS="$CXXFLAGS"
|
||||
HOST_CXXFLAGS='$(CXXFLAGS)'
|
||||
fi
|
||||
if test -z "$HOST_LDFLAGS"; then
|
||||
HOST_LDFLAGS="$LDFLAGS"
|
||||
HOST_LDFLAGS='$(LDFLAGS)'
|
||||
fi
|
||||
if test -z "$HOST_RANLIB"; then
|
||||
HOST_RANLIB="$RANLIB"
|
||||
HOST_RANLIB='$(RANLIB)'
|
||||
fi
|
||||
if test -z "$HOST_AR"; then
|
||||
HOST_AR="$AR"
|
||||
HOST_AR='$(AR)'
|
||||
fi
|
||||
if test -z "$HOST_AR_FLAGS"; then
|
||||
HOST_AR_FLAGS="$AR_FLAGS"
|
||||
HOST_AR_FLAGS='$(AR_FLAGS)'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1730,7 +1730,6 @@ case "$host" in
|
|||
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
|
||||
HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
|
||||
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
|
||||
MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
|
||||
;;
|
||||
|
||||
*-linux*|*-kfreebsd*-gnu)
|
||||
|
@ -1916,6 +1915,7 @@ case "$target" in
|
|||
|
||||
LDFLAGS=$_SAVE_LDFLAGS
|
||||
fi
|
||||
MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
|
||||
;;
|
||||
|
||||
*-freebsd*)
|
||||
|
@ -4901,10 +4901,10 @@ cairo-cocoa)
|
|||
AC_DEFINE(XP_MACOSX)
|
||||
TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
|
||||
TK_CFLAGS="-DNO_X11"
|
||||
LDFLAGS="$LDFLAGS -framework Cocoa"
|
||||
LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
|
||||
CFLAGS="$CFLAGS $TK_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
|
||||
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
|
||||
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
|
||||
MOZ_FS_LAYOUT=bundle
|
||||
MOZ_WEBGL=1
|
||||
;;
|
||||
|
@ -6408,47 +6408,78 @@ AC_SUBST(LIBCONIC_CFLAGS)
|
|||
AC_SUBST(LIBCONIC_LIBS)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Hildon and OSSO checks
|
||||
dnl = Maemo checks
|
||||
dnl ========================================================
|
||||
PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime,
|
||||
MOZ_PLATFORM_HILDON=1,
|
||||
MOZ_PLATFORM_HILDON=)
|
||||
if test $MOZ_PLATFORM_HILDON; then
|
||||
AC_DEFINE(MOZ_PLATFORM_HILDON)
|
||||
X11_COMPOSITED_PLUGINS="yes"
|
||||
|
||||
MAEMO_SDK_TARGET_VER=-1
|
||||
|
||||
MOZ_ARG_WITH_STRING(maemo-version,
|
||||
[ --with-maemo-version=MAEMO_SDK_TARGET_VER
|
||||
Maemo SDK Version],
|
||||
MAEMO_SDK_TARGET_VER=$withval)
|
||||
|
||||
case "$MAEMO_SDK_TARGET_VER" in
|
||||
5)
|
||||
MOZ_PLATFORM_MAEMO=5
|
||||
;;
|
||||
|
||||
6)
|
||||
MOZ_PLATFORM_MAEMO=6
|
||||
;;
|
||||
|
||||
-1)
|
||||
dnl We aren't compiling for Maemo, move on.
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unknown Maemo Version. Try setting --with-maemo-version to 5 or 6.])
|
||||
;;
|
||||
esac
|
||||
|
||||
if test $MOZ_PLATFORM_MAEMO; then
|
||||
AC_DEFINE_UNQUOTED([MOZ_PLATFORM_MAEMO], $MOZ_PLATFORM_MAEMO)
|
||||
|
||||
if test -z "$MOZ_ENABLE_DBUS"; then
|
||||
AC_MSG_ERROR([DBus is required when building for Maemo])
|
||||
fi
|
||||
|
||||
MOZ_GFX_OPTIMIZE_MOBILE=1
|
||||
MOZ_WEBGL_GLX=
|
||||
|
||||
if test $MOZ_PLATFORM_MAEMO = 5; then
|
||||
dnl if we have Xcomposite we should also have Xdamage and Xfixes
|
||||
AC_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
|
||||
[AC_MSG_ERROR([Couldn't find X11/extensions/Xdamage.h which is required for composited plugins.])])
|
||||
AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
|
||||
[MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
|
||||
|
||||
AC_SUBST(XCOMPOSITE_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime, _LIB_FOUND=1, _LIB_FOUND=)
|
||||
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
|
||||
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
|
||||
if test -z "$_LIB_FOUND"; then
|
||||
AC_MSG_ERROR([Hildon Mime is required when building for Maemo])
|
||||
fi
|
||||
|
||||
|
||||
PKG_CHECK_MODULES(LIBOSSO,libosso, _LIB_FOUND=1, _LIB_FOUND=)
|
||||
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
|
||||
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
|
||||
if test -z "$_LIB_FOUND"; then
|
||||
AC_MSG_ERROR([LibOSSO is required when building for Maemo])
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2, _LIB_FOUND=1, _LIB_FOUND=)
|
||||
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
|
||||
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
|
||||
if test -z "$_LIB_FOUND"; then
|
||||
AC_MSG_ERROR([Hildon FM-2 is required when building for Maemo])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(MOZ_PLATFORM_MAEMO_LIBS)
|
||||
AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
|
||||
fi
|
||||
AC_SUBST(LIBHILDONMIME_CFLAGS)
|
||||
AC_SUBST(LIBHILDONMIME_LIBS)
|
||||
|
||||
if test "$X11_COMPOSITED_PLUGINS" = "yes"; then
|
||||
dnl if we have Xcomposite we should also have Xdamage and Xfixes
|
||||
AC_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
|
||||
[AC_MSG_ERROR([Couldn't find X11/extentsions/Xdamage.h which is required for composited plugins.])])
|
||||
AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
|
||||
[MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
|
||||
fi
|
||||
AC_SUBST(XCOMPOSITE_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(LIBOSSO,libosso,
|
||||
NS_OSSO=1,
|
||||
NS_OSSO=)
|
||||
|
||||
if test $NS_OSSO; then
|
||||
if test -z "$MOZ_ENABLE_DBUS"; then
|
||||
AC_MSG_ERROR([DBus is required when building for OSSO])
|
||||
fi
|
||||
AC_DEFINE(NS_OSSO)
|
||||
MOZ_GFX_OPTIMIZE_MOBILE=1
|
||||
MOZ_WEBGL_GLX=
|
||||
fi
|
||||
AC_SUBST(LIBOSSO_CFLAGS)
|
||||
AC_SUBST(LIBOSSO_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2,
|
||||
NS_HILDONFM=1,
|
||||
NS_HILDONFM=)
|
||||
AC_SUBST(LIBHILDONFM_CFLAGS)
|
||||
AC_SUBST(LIBHILDONFM_LIBS)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = faststripe theme
|
||||
|
@ -8018,9 +8049,7 @@ AC_SUBST(NS_USE_NATIVE)
|
|||
AC_SUBST(MOZ_WIDGET_TOOLKIT)
|
||||
AC_SUBST(MOZ_UPDATE_XTERM)
|
||||
AC_SUBST(MINIMO)
|
||||
AC_SUBST(MOZ_PLATFORM_HILDON)
|
||||
AC_SUBST(NS_OSSO)
|
||||
AC_SUBST(NS_MAEMO_LOCATION)
|
||||
AC_SUBST(MOZ_PLATFORM_MAEMO)
|
||||
AC_SUBST(MOZ_AUTH_EXTENSION)
|
||||
AC_SUBST(MOZ_MATHML)
|
||||
AC_SUBST(MOZ_PERMISSIONS)
|
||||
|
|
|
@ -124,5 +124,6 @@ interface nsIObjectLoadingContent : nsISupports
|
|||
*/
|
||||
[noscript] nsIFrame getPrintFrame();
|
||||
|
||||
[noscript] void pluginCrashed();
|
||||
[noscript] void pluginCrashed(in AString pluginName,
|
||||
in boolean submittedCrashReport);
|
||||
};
|
||||
|
|
|
@ -296,6 +296,109 @@ NS_GetContentList(nsINode* aRootNode, nsIAtom* aMatchAtom,
|
|||
return list;
|
||||
}
|
||||
|
||||
// Hashtable for storing nsCacheableFuncStringContentList
|
||||
static PLDHashTable gFuncStringContentListHashTable;
|
||||
|
||||
struct FuncStringContentListHashEntry : public PLDHashEntryHdr
|
||||
{
|
||||
nsCacheableFuncStringContentList* mContentList;
|
||||
};
|
||||
|
||||
static PLDHashNumber
|
||||
FuncStringContentListHashtableHashKey(PLDHashTable *table, const void *key)
|
||||
{
|
||||
const nsFuncStringCacheKey* funcStringKey =
|
||||
static_cast<const nsFuncStringCacheKey *>(key);
|
||||
return funcStringKey->GetHash();
|
||||
}
|
||||
|
||||
static PRBool
|
||||
FuncStringContentListHashtableMatchEntry(PLDHashTable *table,
|
||||
const PLDHashEntryHdr *entry,
|
||||
const void *key)
|
||||
{
|
||||
const FuncStringContentListHashEntry *e =
|
||||
static_cast<const FuncStringContentListHashEntry *>(entry);
|
||||
const nsFuncStringCacheKey* ourKey =
|
||||
static_cast<const nsFuncStringCacheKey *>(key);
|
||||
|
||||
return e->mContentList->Equals(ourKey);
|
||||
}
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
NS_GetFuncStringContentList(nsINode* aRootNode,
|
||||
nsContentListMatchFunc aFunc,
|
||||
nsContentListDestroyFunc aDestroyFunc,
|
||||
void* aData,
|
||||
const nsAString& aString)
|
||||
{
|
||||
NS_ASSERTION(aRootNode, "content list has to have a root");
|
||||
|
||||
nsCacheableFuncStringContentList* list = nsnull;
|
||||
|
||||
static PLDHashTableOps hash_table_ops =
|
||||
{
|
||||
PL_DHashAllocTable,
|
||||
PL_DHashFreeTable,
|
||||
FuncStringContentListHashtableHashKey,
|
||||
FuncStringContentListHashtableMatchEntry,
|
||||
PL_DHashMoveEntryStub,
|
||||
PL_DHashClearEntryStub,
|
||||
PL_DHashFinalizeStub
|
||||
};
|
||||
|
||||
// Initialize the hashtable if needed.
|
||||
if (!gFuncStringContentListHashTable.ops) {
|
||||
PRBool success = PL_DHashTableInit(&gFuncStringContentListHashTable,
|
||||
&hash_table_ops, nsnull,
|
||||
sizeof(FuncStringContentListHashEntry),
|
||||
16);
|
||||
|
||||
if (!success) {
|
||||
gFuncStringContentListHashTable.ops = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
FuncStringContentListHashEntry *entry = nsnull;
|
||||
// First we look in our hashtable. Then we create a content list if needed
|
||||
if (gFuncStringContentListHashTable.ops) {
|
||||
nsFuncStringCacheKey hashKey(aRootNode, aFunc, aString);
|
||||
|
||||
// A PL_DHASH_ADD is equivalent to a PL_DHASH_LOOKUP for cases
|
||||
// when the entry is already in the hashtable.
|
||||
entry = static_cast<FuncStringContentListHashEntry *>
|
||||
(PL_DHashTableOperate(&gFuncStringContentListHashTable,
|
||||
&hashKey,
|
||||
PL_DHASH_ADD));
|
||||
if (entry)
|
||||
list = entry->mContentList;
|
||||
}
|
||||
|
||||
if (!list) {
|
||||
// We need to create a ContentList and add it to our new entry, if
|
||||
// we have an entry
|
||||
list = new nsCacheableFuncStringContentList(aRootNode, aFunc, aDestroyFunc, aData, aString);
|
||||
if (entry) {
|
||||
if (list)
|
||||
entry->mContentList = list;
|
||||
else
|
||||
PL_DHashTableRawRemove(&gContentListHashTable, entry);
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE(list, nsnull);
|
||||
} else {
|
||||
// List was already in the hashtable; clean up our new aData
|
||||
if (aDestroyFunc) {
|
||||
(*aDestroyFunc)(aData);
|
||||
}
|
||||
}
|
||||
|
||||
NS_ADDREF(list);
|
||||
|
||||
// Don't cache these lists globally
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
// nsContentList implementation
|
||||
|
||||
|
@ -450,7 +553,7 @@ nsContentList::NodeWillBeDestroyed(const nsINode* aNode)
|
|||
{
|
||||
// We shouldn't do anything useful from now on
|
||||
|
||||
RemoveFromHashtable();
|
||||
RemoveFromCaches();
|
||||
mRootNode = nsnull;
|
||||
|
||||
// We will get no more updates, so we can never know we're up to
|
||||
|
@ -913,6 +1016,29 @@ nsContentList::BringSelfUpToDate(PRBool aDoFlush)
|
|||
"PopulateSelf dod not bring content list up to date!");
|
||||
}
|
||||
|
||||
nsCacheableFuncStringContentList::~nsCacheableFuncStringContentList()
|
||||
{
|
||||
RemoveFromFuncStringHashtable();
|
||||
}
|
||||
|
||||
void
|
||||
nsCacheableFuncStringContentList::RemoveFromFuncStringHashtable()
|
||||
{
|
||||
if (!gFuncStringContentListHashTable.ops) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsFuncStringCacheKey key(mRootNode, mFunc, mString);
|
||||
PL_DHashTableOperate(&gFuncStringContentListHashTable,
|
||||
&key,
|
||||
PL_DHASH_REMOVE);
|
||||
|
||||
if (gFuncStringContentListHashTable.entryCount == 0) {
|
||||
PL_DHashTableFinish(&gFuncStringContentListHashTable);
|
||||
gFuncStringContentListHashTable.ops = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CONTENT_LIST
|
||||
void
|
||||
nsContentList::AssertInSync()
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "nsINameSpaceManager.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
// Magic namespace id that means "match all namespaces". This is
|
||||
// negative so it won't collide with actual namespace constants.
|
||||
|
@ -396,6 +397,15 @@ protected:
|
|||
Reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* To be called from non-destructor locations that want to remove from caches.
|
||||
* Needed because if subclasses want to have cache behavior they can't just
|
||||
* override RemoveFromHashtable(), since we call that in our destructor.
|
||||
*/
|
||||
virtual void RemoveFromCaches() {
|
||||
RemoveFromHashtable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to use to determine whether a piece of content matches
|
||||
* our criterion
|
||||
|
@ -434,8 +444,69 @@ protected:
|
|||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* A class of cacheable content list; cached on the combination of aRootNode + aFunc + aDataString
|
||||
*/
|
||||
class nsCacheableFuncStringContentList;
|
||||
|
||||
class NS_STACK_CLASS nsFuncStringCacheKey {
|
||||
public:
|
||||
nsFuncStringCacheKey(nsINode* aRootNode,
|
||||
nsContentListMatchFunc aFunc,
|
||||
const nsAString& aString) :
|
||||
mRootNode(aRootNode),
|
||||
mFunc(aFunc),
|
||||
mString(aString)
|
||||
{}
|
||||
|
||||
PRUint32 GetHash(void) const
|
||||
{
|
||||
return NS_PTR_TO_INT32(mRootNode) ^ (NS_PTR_TO_INT32(mFunc) << 12) ^
|
||||
nsCRT::HashCode(PromiseFlatString(mString).get());
|
||||
}
|
||||
|
||||
private:
|
||||
friend class nsCacheableFuncStringContentList;
|
||||
|
||||
nsINode* const mRootNode;
|
||||
const nsContentListMatchFunc mFunc;
|
||||
const nsAString& mString;
|
||||
};
|
||||
|
||||
class nsCacheableFuncStringContentList : public nsContentList {
|
||||
public:
|
||||
nsCacheableFuncStringContentList(nsINode* aRootNode,
|
||||
nsContentListMatchFunc aFunc,
|
||||
nsContentListDestroyFunc aDestroyFunc,
|
||||
void* aData,
|
||||
const nsAString& aString) :
|
||||
nsContentList(aRootNode, aFunc, aDestroyFunc, aData),
|
||||
mString(aString)
|
||||
{}
|
||||
|
||||
virtual ~nsCacheableFuncStringContentList();
|
||||
|
||||
PRBool Equals(const nsFuncStringCacheKey* aKey) {
|
||||
return mRootNode == aKey->mRootNode && mFunc == aKey->mFunc &&
|
||||
mString == aKey->mString;
|
||||
}
|
||||
protected:
|
||||
virtual void RemoveFromCaches() {
|
||||
RemoveFromFuncStringHashtable();
|
||||
}
|
||||
void RemoveFromFuncStringHashtable();
|
||||
|
||||
nsString mString;
|
||||
};
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
NS_GetContentList(nsINode* aRootNode, nsIAtom* aMatchAtom,
|
||||
PRInt32 aMatchNameSpaceId);
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
NS_GetFuncStringContentList(nsINode* aRootNode,
|
||||
nsContentListMatchFunc aFunc,
|
||||
nsContentListDestroyFunc aDestroyFunc,
|
||||
void* aData,
|
||||
const nsAString& aString);
|
||||
#endif // nsContentList_h___
|
||||
|
|
|
@ -1798,6 +1798,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDocument)
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnloadBlocker)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mFirstBaseNodeWithHref)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDOMImplementation)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOriginalDocument)
|
||||
|
||||
// An element will only be in the linkmap as long as it's in the
|
||||
// document, so we'll traverse the table here instead of from the element.
|
||||
|
@ -1851,6 +1852,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
|
|||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDisplayDocument)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mFirstBaseNodeWithHref)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDOMImplementation)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOriginalDocument)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA
|
||||
|
||||
|
@ -2859,21 +2861,24 @@ nsDocument::GetElementsByClassNameHelper(nsINode* aRootNode,
|
|||
aRootNode->GetOwnerDoc()->GetCompatibilityMode() ==
|
||||
eCompatibility_NavQuirks ?
|
||||
eIgnoreCase : eCaseMatters;
|
||||
|
||||
elements = new nsContentList(aRootNode, MatchClassNames,
|
||||
DestroyClassNameArray, info);
|
||||
|
||||
elements =
|
||||
NS_GetFuncStringContentList(aRootNode, MatchClassNames,
|
||||
DestroyClassNameArray, info,
|
||||
aClasses).get();
|
||||
} else {
|
||||
delete info;
|
||||
info = nsnull;
|
||||
elements = new nsBaseContentList();
|
||||
NS_IF_ADDREF(elements);
|
||||
}
|
||||
if (!elements) {
|
||||
delete info;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Transfer ownership
|
||||
*aReturn = elements;
|
||||
NS_ADDREF(*aReturn);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -44,9 +44,13 @@
|
|||
|
||||
// Interface headers
|
||||
#include "imgILoader.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDataContainerEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIExternalProtocolHandler.h"
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsIObjectFrame.h"
|
||||
|
@ -54,6 +58,7 @@
|
|||
#include "nsIPluginHost.h"
|
||||
#include "nsIPluginInstance.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIStreamConverterService.h"
|
||||
|
@ -79,6 +84,7 @@
|
|||
#include "nsNetUtil.h"
|
||||
#include "nsMimeTypes.h"
|
||||
#include "nsStyleUtil.h"
|
||||
#include "nsGUIEvent.h"
|
||||
|
||||
// Concrete classes
|
||||
#include "nsFrameLoader.h"
|
||||
|
@ -200,9 +206,6 @@ nsPluginErrorEvent::Run()
|
|||
case ePluginOutdated:
|
||||
type = NS_LITERAL_STRING("PluginOutdated");
|
||||
break;
|
||||
case ePluginCrashed:
|
||||
type = NS_LITERAL_STRING("PluginCrashed");
|
||||
break;
|
||||
default:
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -212,6 +215,79 @@ nsPluginErrorEvent::Run()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* A task for firing PluginCrashed DOM Events.
|
||||
*/
|
||||
class nsPluginCrashedEvent : public nsRunnable {
|
||||
public:
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsString mPluginName;
|
||||
PRBool mSubmittedCrashReport;
|
||||
|
||||
nsPluginCrashedEvent(nsIContent* aContent,
|
||||
const nsAString& aPluginName,
|
||||
PRBool submittedCrashReport)
|
||||
: mContent(aContent),
|
||||
mPluginName(aPluginName),
|
||||
mSubmittedCrashReport(submittedCrashReport)
|
||||
{}
|
||||
|
||||
~nsPluginCrashedEvent() {}
|
||||
|
||||
NS_IMETHOD Run();
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPluginCrashedEvent::Run()
|
||||
{
|
||||
LOG(("OBJLC []: Firing plugin crashed event for content %p\n",
|
||||
mContent.get()));
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> domEventDoc =
|
||||
do_QueryInterface(mContent->GetDocument());
|
||||
if (!domEventDoc) {
|
||||
NS_WARNING("Couldn't get document for PluginCrashed event!");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
domEventDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
nsCOMPtr<nsIDOMDataContainerEvent> containerEvent(do_QueryInterface(event));
|
||||
if (!privateEvent || !containerEvent) {
|
||||
NS_WARNING("Couldn't QI event for PluginCrashed event!");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
event->InitEvent(NS_LITERAL_STRING("PluginCrashed"), PR_TRUE, PR_TRUE);
|
||||
privateEvent->SetTrusted(PR_TRUE);
|
||||
privateEvent->GetInternalNSEvent()->flags |= NS_EVENT_FLAG_ONLY_CHROME_DISPATCH;
|
||||
|
||||
nsCOMPtr<nsIWritableVariant> variant;
|
||||
|
||||
// add a "pluginName" property to this event
|
||||
variant = do_CreateInstance("@mozilla.org/variant;1");
|
||||
if (!variant) {
|
||||
NS_WARNING("Couldn't create pluginName variant for PluginCrashed event!");
|
||||
return NS_OK;
|
||||
}
|
||||
variant->SetAsAString(mPluginName);
|
||||
containerEvent->SetData(NS_LITERAL_STRING("pluginName"), variant);
|
||||
|
||||
// add a "submittedCrashReport" property to this event
|
||||
variant = do_CreateInstance("@mozilla.org/variant;1");
|
||||
if (!variant) {
|
||||
NS_WARNING("Couldn't create crashSubmit variant for PluginCrashed event!");
|
||||
return NS_OK;
|
||||
}
|
||||
variant->SetAsBool(mSubmittedCrashReport);
|
||||
containerEvent->SetData(NS_LITERAL_STRING("submittedCrashReport"), variant);
|
||||
|
||||
nsEventDispatcher::DispatchDOMEvent(mContent, nsnull, event, nsnull, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class AutoNotifier {
|
||||
public:
|
||||
AutoNotifier(nsObjectLoadingContent* aContent, PRBool aNotify) :
|
||||
|
@ -955,6 +1031,9 @@ nsObjectLoadingContent::ObjectState() const
|
|||
case ePluginBlocklisted:
|
||||
state |= NS_EVENT_STATE_HANDLER_BLOCKED;
|
||||
break;
|
||||
case ePluginCrashed:
|
||||
state |= NS_EVENT_STATE_HANDLER_CRASHED;
|
||||
break;
|
||||
case ePluginUnsupported:
|
||||
state |= NS_EVENT_STATE_TYPE_UNSUPPORTED;
|
||||
break;
|
||||
|
@ -1929,11 +2008,19 @@ nsObjectLoadingContent::SetAbsoluteScreenPosition(nsIDOMElement* element,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsObjectLoadingContent::PluginCrashed()
|
||||
nsObjectLoadingContent::PluginCrashed(const nsAString& pluginName,
|
||||
PRBool submittedCrashReport)
|
||||
{
|
||||
AutoNotifier notifier(this, PR_TRUE);
|
||||
UnloadContent();
|
||||
mFallbackReason = ePluginCrashed;
|
||||
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
FirePluginError(thisContent, mFallbackReason);
|
||||
nsCOMPtr<nsIRunnable> ev = new nsPluginCrashedEvent(thisContent,
|
||||
pluginName,
|
||||
submittedCrashReport);
|
||||
nsresult rv = NS_DispatchToCurrentThread(ev);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("failed to dispatch nsPluginCrashedEvent");
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -66,16 +66,15 @@ endif
|
|||
|
||||
ifdef MOZ_WEBGL
|
||||
|
||||
ifeq (1_1,$(MOZ_X11)_$(NS_OSSO))
|
||||
ifdef MOZ_X11
|
||||
ifdef MOZ_PLATFORM_MAEMO
|
||||
WEBGL_PLATFORM = EGL
|
||||
DEFINES += -DUSE_GLES2
|
||||
endif
|
||||
|
||||
ifeq (1_,$(MOZ_X11)_$(NS_OSSO))
|
||||
else
|
||||
WEBGL_PLATFORM = GLX
|
||||
EXTRA_DSO_LIBS += X11
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
|
||||
ifdef WINCE
|
||||
|
|
|
@ -163,7 +163,7 @@ nsGLPbufferEGL::Init(mozilla::WebGLContext *priv)
|
|||
{
|
||||
mPriv = priv;
|
||||
|
||||
#ifdef NS_OSSO
|
||||
#ifdef MOZ_PLATFORM_MAEMO
|
||||
// Maemo has missing DSO dependencies on their OpenGL libraries;
|
||||
// so ensure that the prerequisite libs are loaded in the process
|
||||
// before loading GL. An alternate approach is to use LD_PRELOAD.
|
||||
|
@ -199,7 +199,7 @@ nsGLPbufferEGL::Init(mozilla::WebGLContext *priv)
|
|||
|
||||
gEGLWrap.fBindAPI (EGL_OPENGL_ES_API);
|
||||
|
||||
#if defined(MOZ_X11) && defined(NS_OSSO)
|
||||
#if defined(MOZ_X11) && defined(MOZ_PLATFORM_MAEMO)
|
||||
EGLint attribs[] = {
|
||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||
EGL_SURFACE_TYPE, EGL_PIXMAP_BIT,
|
||||
|
@ -477,7 +477,7 @@ nsGLPbufferEGL::SwapBuffers()
|
|||
gfxASurface*
|
||||
nsGLPbufferEGL::ThebesSurface()
|
||||
{
|
||||
#if defined(MOZ_X11) && defined(NS_OSSO)
|
||||
#if defined(MOZ_X11) && defined(MOZ_PLATFORM_MAEMO)
|
||||
if (getenv("IMAGE"))
|
||||
return mThebesSurface;
|
||||
return mXlibSurface;
|
||||
|
|
|
@ -197,4 +197,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIEventStateManager, NS_IEVENTSTATEMANAGER_IID)
|
|||
|
||||
#define NS_EVENT_STATE_INDETERMINATE 0x04000000 // CSS3-Selectors
|
||||
|
||||
// Handler for the content has crashed
|
||||
#define NS_EVENT_STATE_HANDLER_CRASHED \
|
||||
0x08000000
|
||||
|
||||
#endif // nsIEventStateManager_h__
|
||||
|
|
|
@ -63,9 +63,9 @@ class imgIContainer;
|
|||
class nsDOMDataTransfer;
|
||||
|
||||
// mac uses click-hold context menus, a holdover from 4.x
|
||||
// touch screens (like hildon) could use this also,
|
||||
// touch screens (like maemo) could use this also,
|
||||
// perhaps we should move to NS_TOUCHSCREEN
|
||||
#if defined(XP_MACOSX) || defined(MOZ_PLATFORM_HILDON)
|
||||
#if defined(XP_MACOSX) || defined(MOZ_PLATFORM_MAEMO)
|
||||
#define CLICK_HOLD_CONTEXT_MENUS 1
|
||||
#endif
|
||||
|
||||
|
|
|
@ -60,8 +60,6 @@
|
|||
#include "nsIFormControl.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsIFormSubmission.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsIRadioControlFrame.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
|
@ -81,7 +79,6 @@
|
|||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
#include "nsICheckboxControlFrame.h"
|
||||
#include "nsLinebreakConverter.h" //to strip out carriage returns
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
|
@ -98,7 +95,6 @@
|
|||
#include "nsRuleData.h"
|
||||
|
||||
// input type=radio
|
||||
#include "nsIRadioControlFrame.h"
|
||||
#include "nsIRadioGroupContainer.h"
|
||||
|
||||
// input type=file
|
||||
|
@ -1368,20 +1364,10 @@ nsHTMLInputElement::SetCheckedInternal(PRBool aChecked, PRBool aNotify)
|
|||
//
|
||||
// Notify the frame
|
||||
//
|
||||
nsIFrame* frame = GetPrimaryFrame();
|
||||
if (frame) {
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
|
||||
if (mType == NS_FORM_INPUT_CHECKBOX) {
|
||||
nsICheckboxControlFrame* checkboxFrame = do_QueryFrame(frame);
|
||||
if (checkboxFrame) {
|
||||
checkboxFrame->OnChecked(presContext, aChecked);
|
||||
}
|
||||
} else if (mType == NS_FORM_INPUT_RADIO) {
|
||||
nsIRadioControlFrame* radioFrame = do_QueryFrame(frame);
|
||||
if (radioFrame) {
|
||||
radioFrame->OnChecked(presContext, aChecked);
|
||||
}
|
||||
if (mType == NS_FORM_INPUT_CHECKBOX || mType == NS_FORM_INPUT_RADIO) {
|
||||
nsIFrame* frame = GetPrimaryFrame();
|
||||
if (frame) {
|
||||
frame->InvalidateOverflowRect();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2280,17 +2280,18 @@ NS_IMETHODIMP
|
|||
nsHTMLDocument::GetElementsByName(const nsAString& aElementName,
|
||||
nsIDOMNodeList** aReturn)
|
||||
{
|
||||
void* elementNameData = new nsString(aElementName);
|
||||
nsString* elementNameData = new nsString(aElementName);
|
||||
NS_ENSURE_TRUE(elementNameData, NS_ERROR_OUT_OF_MEMORY);
|
||||
nsContentList* elements =
|
||||
new nsContentList(this,
|
||||
MatchNameAttribute,
|
||||
nsContentUtils::DestroyMatchString,
|
||||
elementNameData);
|
||||
NS_GetFuncStringContentList(this,
|
||||
MatchNameAttribute,
|
||||
nsContentUtils::DestroyMatchString,
|
||||
elementNameData,
|
||||
*elementNameData).get();
|
||||
NS_ENSURE_TRUE(elements, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
// Transfer ownership
|
||||
*aReturn = elements;
|
||||
NS_ADDREF(*aReturn);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -2112,8 +2112,8 @@ nsDocShell::HistoryPurged(PRInt32 aNumEntries)
|
|||
// eviction. We need to adjust by the number of entries that we
|
||||
// just purged from history, so that we look at the right session history
|
||||
// entries during eviction.
|
||||
mPreviousTransIndex = PR_MAX(-1, mPreviousTransIndex - aNumEntries);
|
||||
mLoadedTransIndex = PR_MAX(0, mLoadedTransIndex - aNumEntries);
|
||||
mPreviousTransIndex = NS_MAX(-1, mPreviousTransIndex - aNumEntries);
|
||||
mLoadedTransIndex = NS_MAX(0, mLoadedTransIndex - aNumEntries);
|
||||
|
||||
PRInt32 count = mChildList.Count();
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
|
|
|
@ -115,6 +115,6 @@ ifdef MOZ_ENABLE_DBUS
|
|||
EXTRA_DSO_LDOPTS += $(MOZ_DBUS_GLIB_LIBS)
|
||||
endif
|
||||
|
||||
ifdef MOZ_PLATFORM_HILDON
|
||||
EXTRA_DSO_LDOPTS += $(LIBHILDONMIME_LIBS)
|
||||
ifdef MOZ_PLATFORM_MAEMO
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_PLATFORM_MAEMO_LIBS)
|
||||
endif
|
||||
|
|
|
@ -551,7 +551,7 @@ nsSHistory::PurgeHistory(PRInt32 aEntries)
|
|||
if (mLength <= 0 || aEntries <= 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
aEntries = PR_MIN(aEntries, mLength);
|
||||
aEntries = NS_MIN(aEntries, mLength);
|
||||
|
||||
PRBool purgeHistory = PR_TRUE;
|
||||
// Notify the listener about the history purge
|
||||
|
@ -813,13 +813,13 @@ nsSHistory::EvictWindowContentViewers(PRInt32 aFromIndex, PRInt32 aToIndex)
|
|||
if (endIndex <= 0) {
|
||||
return;
|
||||
}
|
||||
startIndex = PR_MAX(0, aFromIndex - gHistoryMaxViewers);
|
||||
startIndex = NS_MAX(0, aFromIndex - gHistoryMaxViewers);
|
||||
} else { // going backward
|
||||
startIndex = aToIndex + gHistoryMaxViewers + 1;
|
||||
if (startIndex >= mLength) {
|
||||
return;
|
||||
}
|
||||
endIndex = PR_MIN(mLength, aFromIndex + gHistoryMaxViewers + 1);
|
||||
endIndex = NS_MIN(mLength, aFromIndex + gHistoryMaxViewers + 1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -913,8 +913,8 @@ nsSHistory::EvictGlobalContentViewer()
|
|||
// viewer. There could be up to gHistoryMaxViewers content viewers,
|
||||
// but we don't know whether they are before or after the mIndex position
|
||||
// in the SHEntry list. Just check both sides, to be safe.
|
||||
PRInt32 startIndex = PR_MAX(0, shist->mIndex - gHistoryMaxViewers);
|
||||
PRInt32 endIndex = PR_MIN(shist->mLength - 1,
|
||||
PRInt32 startIndex = NS_MAX(0, shist->mIndex - gHistoryMaxViewers);
|
||||
PRInt32 endIndex = NS_MIN(shist->mLength - 1,
|
||||
shist->mIndex + gHistoryMaxViewers);
|
||||
nsCOMPtr<nsISHTransaction> trans;
|
||||
shist->GetTransactionAtIndex(startIndex, getter_AddRefs(trans));
|
||||
|
@ -1006,8 +1006,8 @@ nsSHistory::EvictGlobalContentViewer()
|
|||
NS_IMETHODIMP
|
||||
nsSHistory::EvictExpiredContentViewerForEntry(nsISHEntry *aEntry)
|
||||
{
|
||||
PRInt32 startIndex = PR_MAX(0, mIndex - gHistoryMaxViewers);
|
||||
PRInt32 endIndex = PR_MIN(mLength - 1,
|
||||
PRInt32 startIndex = NS_MAX(0, mIndex - gHistoryMaxViewers);
|
||||
PRInt32 endIndex = NS_MIN(mLength - 1,
|
||||
mIndex + gHistoryMaxViewers);
|
||||
nsCOMPtr<nsISHTransaction> trans;
|
||||
GetTransactionAtIndex(startIndex, getter_AddRefs(trans));
|
||||
|
|
|
@ -50,6 +50,24 @@ using namespace mozilla::plugins;
|
|||
|
||||
PR_STATIC_ASSERT(sizeof(NPIdentifier) == sizeof(void*));
|
||||
|
||||
class PluginCrashed : public nsRunnable
|
||||
{
|
||||
public:
|
||||
PluginCrashed(nsNPAPIPlugin* plugin,
|
||||
const nsString& dumpID)
|
||||
: mDumpID(dumpID),
|
||||
mPlugin(plugin) { }
|
||||
|
||||
NS_IMETHOD Run() {
|
||||
mPlugin->PluginCrashed(mDumpID);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
nsNPAPIPlugin* mPlugin;
|
||||
nsString mDumpID;
|
||||
};
|
||||
|
||||
// static
|
||||
PluginLibrary*
|
||||
PluginModuleParent::LoadModule(const char* aFilePath)
|
||||
|
@ -160,8 +178,13 @@ PluginModuleParent::ActorDestroy(ActorDestroyReason why)
|
|||
switch (why) {
|
||||
case AbnormalShutdown: {
|
||||
nsCOMPtr<nsIFile> dump;
|
||||
nsAutoString dumpID;
|
||||
if (GetMinidump(getter_AddRefs(dump))) {
|
||||
WriteExtraDataForMinidump(dump);
|
||||
if (NS_SUCCEEDED(dump->GetLeafName(dumpID))) {
|
||||
dumpID.Replace(dumpID.Length() - 4, 4,
|
||||
NS_LITERAL_STRING(""));
|
||||
}
|
||||
}
|
||||
else {
|
||||
NS_WARNING("[PluginModuleParent::ActorDestroy] abnormal shutdown without minidump!");
|
||||
|
@ -172,8 +195,7 @@ PluginModuleParent::ActorDestroy(ActorDestroyReason why)
|
|||
// and potentially modify the actor child list while enumerating it.
|
||||
if (mPlugin) {
|
||||
nsCOMPtr<nsIRunnable> r =
|
||||
new nsRunnableMethod<nsNPAPIPlugin>(
|
||||
mPlugin, &nsNPAPIPlugin::PluginCrashed);
|
||||
new PluginCrashed(mPlugin, dumpID);
|
||||
NS_DispatchToMainThread(r);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -92,8 +92,7 @@ ifdef HAVE_ARM_SIMD
|
|||
USE_ARM_SIMD_GCC=1
|
||||
endif
|
||||
ifdef HAVE_ARM_NEON
|
||||
# temporarily disabled to see if it fixes odd mobile build breakage
|
||||
#USE_ARM_NEON_GCC=1
|
||||
USE_ARM_NEON_GCC=1
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -148,6 +147,7 @@ endif
|
|||
|
||||
ifdef USE_ARM_NEON_GCC
|
||||
CSRCS += pixman-arm-neon.c
|
||||
SSRCS += pixman-arm-neon-asm.S
|
||||
DEFINES += -DUSE_ARM_NEON
|
||||
ARM_NEON_CFLAGS = -mfloat-abi=softfp -mfpu=neon
|
||||
endif
|
||||
|
|
|
@ -817,8 +817,8 @@ generate_composite_function \
|
|||
vsli.u64 d0, d0, #8
|
||||
vsli.u64 d0, d0, #16
|
||||
vsli.u64 d0, d0, #32
|
||||
vmov d1, d0
|
||||
vmov q1, q0
|
||||
vorr d1, d0, d0
|
||||
vorr q1, q0, q0
|
||||
.endm
|
||||
|
||||
.macro pixman_composite_src_n_8_cleanup
|
||||
|
@ -856,8 +856,8 @@ generate_composite_function \
|
|||
vld1.32 {d0[0]}, [DUMMY]
|
||||
vsli.u64 d0, d0, #16
|
||||
vsli.u64 d0, d0, #32
|
||||
vmov d1, d0
|
||||
vmov q1, q0
|
||||
vorr d1, d0, d0
|
||||
vorr q1, q0, q0
|
||||
.endm
|
||||
|
||||
.macro pixman_composite_src_n_0565_cleanup
|
||||
|
@ -894,8 +894,8 @@ generate_composite_function \
|
|||
add DUMMY, sp, #ARGS_STACK_OFFSET
|
||||
vld1.32 {d0[0]}, [DUMMY]
|
||||
vsli.u64 d0, d0, #32
|
||||
vmov d1, d0
|
||||
vmov q1, q0
|
||||
vorr d1, d0, d0
|
||||
vorr q1, q0, q0
|
||||
.endm
|
||||
|
||||
.macro pixman_composite_src_n_8888_cleanup
|
||||
|
|
|
@ -380,6 +380,7 @@ _OBJS = \
|
|||
$(JRI_STUB_CFILES) \
|
||||
$(addsuffix .$(OBJ_SUFFIX), $(JMC_GEN)) \
|
||||
$(CSRCS:.c=.$(OBJ_SUFFIX)) \
|
||||
$(SSRCS:.S=.$(OBJ_SUFFIX)) \
|
||||
$(patsubst %.cc,%.$(OBJ_SUFFIX),$(CPPSRCS:.cpp=.$(OBJ_SUFFIX))) \
|
||||
$(CMSRCS:.m=.$(OBJ_SUFFIX)) \
|
||||
$(CMMSRCS:.mm=.$(OBJ_SUFFIX)) \
|
||||
|
|
|
@ -1009,12 +1009,10 @@ hunspell.hxx
|
|||
#if MOZ_NATIVE_BZ2==1
|
||||
bzlib.h
|
||||
#endif
|
||||
#ifdef MOZ_PLATFORM_HILDON
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
hildon-uri.h
|
||||
hildon-mime.h
|
||||
hildon-file-chooser-dialog.h
|
||||
#endif
|
||||
#ifdef NS_OSSO
|
||||
libosso.h
|
||||
osso-mem.h
|
||||
#endif
|
||||
|
|
|
@ -358,28 +358,28 @@ else
|
|||
AC_CHECK_PROGS(STRIP, strip, :)
|
||||
AC_CHECK_PROGS(WINDRES, windres, :)
|
||||
if test -z "$HOST_CC"; then
|
||||
HOST_CC="$CC"
|
||||
HOST_CC='$(CC)'
|
||||
fi
|
||||
if test -z "$HOST_CFLAGS"; then
|
||||
HOST_CFLAGS="$CFLAGS"
|
||||
HOST_CFLAGS='$(CFLAGS)'
|
||||
fi
|
||||
if test -z "$HOST_CXX"; then
|
||||
HOST_CXX="$CXX"
|
||||
HOST_CXX='$(CXX)'
|
||||
fi
|
||||
if test -z "$HOST_CXXFLAGS"; then
|
||||
HOST_CXXFLAGS="$CXXFLAGS"
|
||||
HOST_CXXFLAGS='$(CXXFLAGS)'
|
||||
fi
|
||||
if test -z "$HOST_LDFLAGS"; then
|
||||
HOST_LDFLAGS="$LDFLAGS"
|
||||
HOST_LDFLAGS='$(LDFLAGS)'
|
||||
fi
|
||||
if test -z "$HOST_RANLIB"; then
|
||||
HOST_RANLIB="$RANLIB"
|
||||
HOST_RANLIB='$(RANLIB)'
|
||||
fi
|
||||
if test -z "$HOST_AR"; then
|
||||
HOST_AR="$AR"
|
||||
HOST_AR='$(AR)'
|
||||
fi
|
||||
if test -z "$HOST_AR_FLAGS"; then
|
||||
HOST_AR_FLAGS="$AR_FLAGS"
|
||||
HOST_AR_FLAGS='$(AR_FLAGS)'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1508,8 +1508,8 @@ case "$host" in
|
|||
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
|
||||
HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
|
||||
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
|
||||
MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
|
||||
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
|
||||
LDFLAGS="$LDFLAGS -lobjc"
|
||||
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
|
||||
;;
|
||||
|
||||
*-linux*|*-kfreebsd*-gnu)
|
||||
|
@ -1677,6 +1677,7 @@ case "$target" in
|
|||
|
||||
LDFLAGS=$_SAVE_LDFLAGS
|
||||
fi
|
||||
MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
|
||||
;;
|
||||
|
||||
*-freebsd*)
|
||||
|
|
|
@ -281,6 +281,28 @@ var XPCOMUtils = {
|
|||
.getService(Ci.nsICategoryManager);
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper which iterates over a nsISimpleEnumerator.
|
||||
* @param e The nsISimpleEnumerator to iterate over.
|
||||
* @param i The expected interface for each element.
|
||||
*/
|
||||
IterSimpleEnumerator: function XPCU_IterSimpleEnumerator(e, i)
|
||||
{
|
||||
while (e.hasMoreElements())
|
||||
yield e.getNext().QueryInterface(i);
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper which iterates over a string enumerator.
|
||||
* @param e The string enumerator (nsIUTF8StringEnumerator or
|
||||
* nsIStringEnumerator) over which to iterate.
|
||||
*/
|
||||
IterStringEnumerator: function XPCU_IterStringEnumerator(e)
|
||||
{
|
||||
while (e.hasMore())
|
||||
yield e.getNext();
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns an nsIFactory for |component|.
|
||||
*/
|
||||
|
@ -314,3 +336,4 @@ function makeQI(interfaceNames) {
|
|||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -780,11 +780,7 @@ void DEBUG_CheckForComponentsInScope(JSContext* cx, JSObject* obj,
|
|||
// global properties of that document's window are *gone*. Generally this
|
||||
// indicates a problem that should be addressed in the design and use of the
|
||||
// callback code.
|
||||
#ifdef I_FOOLISHLY_WANT_TO_IGNORE_THIS_LIKE_THE_OTHER_CRAP_WE_PRINTF
|
||||
NS_WARNING("XPConnect is being called on a scope without a 'Components' property!");
|
||||
#else
|
||||
NS_ERROR("XPConnect is being called on a scope without a 'Components' property!");
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
#define DEBUG_CheckForComponentsInScope(ccx, obj, OKIfNotInitialized, runtime) \
|
||||
|
|
|
@ -77,8 +77,6 @@
|
|||
#include "nsIComboboxControlFrame.h"
|
||||
#include "nsIListControlFrame.h"
|
||||
#include "nsISelectControlFrame.h"
|
||||
#include "nsIRadioControlFrame.h"
|
||||
#include "nsICheckboxControlFrame.h"
|
||||
#include "nsIDOMCharacterData.h"
|
||||
#include "nsIDOMHTMLImageElement.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
|
|
|
@ -58,8 +58,6 @@ EXPORTS = \
|
|||
nsIListControlFrame.h \
|
||||
nsIComboboxControlFrame.h \
|
||||
nsIFormControlFrame.h \
|
||||
nsIRadioControlFrame.h \
|
||||
nsICheckboxControlFrame.h \
|
||||
nsISelectControlFrame.h \
|
||||
nsITextControlFrame.h \
|
||||
$(NULL)
|
||||
|
|
|
@ -119,11 +119,6 @@ nsGfxCheckboxControlFrame::~nsGfxCheckboxControlFrame()
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
NS_QUERYFRAME_HEAD(nsGfxCheckboxControlFrame)
|
||||
NS_QUERYFRAME_ENTRY(nsICheckboxControlFrame)
|
||||
NS_QUERYFRAME_TAIL_INHERITING(nsFormControlFrame)
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
NS_IMETHODIMP
|
||||
nsGfxCheckboxControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
||||
|
@ -140,15 +135,6 @@ nsGfxCheckboxControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsGfxCheckboxControlFrame::OnChecked(nsPresContext* aPresContext,
|
||||
PRBool aChecked)
|
||||
{
|
||||
InvalidateOverflowRect();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
nsGfxCheckboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
|
|
@ -38,14 +38,12 @@
|
|||
#define nsGfxCheckboxControlFrame_h___
|
||||
|
||||
#include "nsFormControlFrame.h"
|
||||
#include "nsICheckboxControlFrame.h"
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
class nsIAccessible;
|
||||
#endif
|
||||
|
||||
class nsGfxCheckboxControlFrame : public nsFormControlFrame,
|
||||
public nsICheckboxControlFrame
|
||||
class nsGfxCheckboxControlFrame : public nsFormControlFrame
|
||||
{
|
||||
public:
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
@ -67,11 +65,6 @@ public:
|
|||
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
|
||||
#endif
|
||||
|
||||
//nsICheckboxControlFrame methods
|
||||
NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked);
|
||||
|
||||
NS_DECL_QUERYFRAME
|
||||
|
||||
protected:
|
||||
|
||||
PRBool IsChecked();
|
||||
|
|
|
@ -64,10 +64,6 @@ nsGfxRadioControlFrame::~nsGfxRadioControlFrame()
|
|||
{
|
||||
}
|
||||
|
||||
NS_QUERYFRAME_HEAD(nsGfxRadioControlFrame)
|
||||
NS_QUERYFRAME_ENTRY(nsIRadioControlFrame)
|
||||
NS_QUERYFRAME_TAIL_INHERITING(nsFormControlFrame)
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
NS_IMETHODIMP
|
||||
nsGfxRadioControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
||||
|
@ -126,11 +122,3 @@ nsGfxRadioControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
return aLists.Content()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayGeneric(this, PaintCheckedRadioButton, "CheckedRadioButton"));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxRadioControlFrame::OnChecked(nsPresContext* aPresContext,
|
||||
PRBool aChecked)
|
||||
{
|
||||
InvalidateOverflowRect();
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#define nsGfxRadioControlFrame_h___
|
||||
|
||||
#include "nsFormControlFrame.h"
|
||||
#include "nsIRadioControlFrame.h"
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
class nsIAccessible;
|
||||
|
@ -47,21 +46,17 @@ class nsIAccessible;
|
|||
|
||||
// nsGfxRadioControlFrame
|
||||
|
||||
class nsGfxRadioControlFrame : public nsFormControlFrame,
|
||||
public nsIRadioControlFrame
|
||||
|
||||
class nsGfxRadioControlFrame : public nsFormControlFrame
|
||||
{
|
||||
public:
|
||||
nsGfxRadioControlFrame(nsStyleContext* aContext);
|
||||
~nsGfxRadioControlFrame();
|
||||
|
||||
NS_DECL_QUERYFRAME
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
|
||||
#endif
|
||||
NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked);
|
||||
|
||||
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
|
|
|
@ -1,61 +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 nsICheckControlFrame_h___
|
||||
#define nsICheckControlFrame_h___
|
||||
|
||||
#include "nsQueryFrame.h"
|
||||
class nsStyleContext;
|
||||
class nsPresContext;
|
||||
|
||||
/**
|
||||
* nsICheckControlFrame is the common interface radio buttons.
|
||||
* @see nsFromControlFrame and its base classes for more info
|
||||
*/
|
||||
class nsICheckboxControlFrame
|
||||
{
|
||||
public:
|
||||
NS_DECL_QUERYFRAME_TARGET(nsICheckboxControlFrame)
|
||||
|
||||
/**
|
||||
* Called by content when checkbox "checked" changes
|
||||
*/
|
||||
NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,60 +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 nsIRadioControlFrame_h___
|
||||
#define nsIRadioControlFrame_h___
|
||||
|
||||
#include "nsQueryFrame.h"
|
||||
class nsStyleContext;
|
||||
|
||||
/**
|
||||
* nsIRadioControlFrame is the common interface radio buttons.
|
||||
* @see nsFormControlFrame and its base classes for more info
|
||||
*/
|
||||
class nsIRadioControlFrame
|
||||
{
|
||||
public:
|
||||
NS_DECL_QUERYFRAME_TARGET(nsIRadioControlFrame)
|
||||
|
||||
/**
|
||||
* Called by content when the radio button's state changes
|
||||
*/
|
||||
NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -173,7 +173,7 @@ enum { XKeyPress = KeyPress };
|
|||
#undef KeyPress
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
#define MOZ_COMPOSITED_PLUGINS 1
|
||||
|
||||
#include "gfxXlibSurface.h"
|
||||
|
@ -416,7 +416,7 @@ public:
|
|||
return strncmp(GetPluginName(), aPluginName, strlen(aPluginName)) == 0;
|
||||
}
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
nsresult SetAbsoluteScreenPosition(nsIDOMElement* element,
|
||||
nsIDOMClientRect* position,
|
||||
nsIDOMClientRect* clip);
|
||||
|
@ -511,7 +511,7 @@ private:
|
|||
};
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
|
||||
// On hildon, we attempt to use NPImageExpose which allows us faster
|
||||
// painting.
|
||||
|
@ -1225,7 +1225,7 @@ nsObjectFrame::SetAbsoluteScreenPosition(nsIDOMElement* element,
|
|||
nsIDOMClientRect* position,
|
||||
nsIDOMClientRect* clip)
|
||||
{
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
if (!mInstanceOwner)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
return mInstanceOwner->SetAbsoluteScreenPosition(element, position, clip);
|
||||
|
@ -2137,7 +2137,7 @@ GetMIMEType(nsIPluginInstance *aPluginInstance)
|
|||
static PRBool
|
||||
DoDelayedStop(nsPluginInstanceOwner *aInstanceOwner, PRBool aDelayedStop)
|
||||
{
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO==5)
|
||||
// Don't delay stop on Maemo/Hildon (bug 530739).
|
||||
if (aDelayedStop && aInstanceOwner->MatchPluginName("Shockwave Flash"))
|
||||
return PR_FALSE;
|
||||
|
@ -2455,7 +2455,7 @@ nsPluginInstanceOwner::nsPluginInstanceOwner()
|
|||
mLastPoint = nsIntPoint(0,0);
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
mPluginSize = nsIntSize(0,0);
|
||||
mXlibSurfGC = None;
|
||||
mBlitWindow = nsnull;
|
||||
|
@ -2525,7 +2525,7 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner()
|
|||
mInstance->InvalidateOwner();
|
||||
}
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
ReleaseXShm();
|
||||
#endif
|
||||
}
|
||||
|
@ -2737,7 +2737,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect)
|
|||
if (!mObjectFrame || !invalidRect || !mWidgetVisible)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
PRBool simpleImageRender = PR_FALSE;
|
||||
mInstance->GetValueFromPlugin(NPPVpluginWindowlessLocalBool,
|
||||
&simpleImageRender);
|
||||
|
@ -4871,7 +4871,7 @@ void nsPluginInstanceOwner::Paint(gfxContext* aContext,
|
|||
if (!mInstance || !mObjectFrame)
|
||||
return;
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
// through to be able to paint the context passed in. This allows
|
||||
// us to handle plugins that do not self invalidate (slowly, but
|
||||
// accurately), and it allows us to reduce flicker.
|
||||
|
@ -4960,7 +4960,7 @@ DepthOfVisual(const Screen* screen, const Visual* visual)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
|
||||
static GdkWindow* GetClosestWindow(nsIDOMElement *element)
|
||||
{
|
||||
|
@ -5651,7 +5651,7 @@ void nsPluginInstanceOwner::SetPluginHost(nsIPluginHost* aHost)
|
|||
mPluginHost = aHost;
|
||||
}
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
PRBool nsPluginInstanceOwner::UpdateVisibility(PRBool aVisible)
|
||||
{
|
||||
// NOTE: Death grip must be held by caller.
|
||||
|
@ -5815,7 +5815,7 @@ void nsPluginInstanceOwner::FixUpURLS(const nsString &name, nsAString &value)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
nsresult
|
||||
nsPluginInstanceOwner::SetAbsoluteScreenPosition(nsIDOMElement* element,
|
||||
nsIDOMClientRect* position,
|
||||
|
|
|
@ -111,7 +111,6 @@ public:
|
|||
nsHTMLScrollFrame_id,
|
||||
nsIAnonymousContentCreator_id,
|
||||
nsICSSPseudoComparator_id,
|
||||
nsICheckboxControlFrame_id,
|
||||
nsIComboboxControlFrame_id,
|
||||
nsIFormControlFrame_id,
|
||||
nsIFrame_id,
|
||||
|
@ -123,7 +122,6 @@ public:
|
|||
nsIObjectFrame_id,
|
||||
nsIPageSequenceFrame_id,
|
||||
nsIPercentHeightObserver_id,
|
||||
nsIRadioControlFrame_id,
|
||||
nsIRootBox_id,
|
||||
nsISVGChildFrame_id,
|
||||
nsISVGGlyphFragmentLeaf_id,
|
||||
|
|
|
@ -114,6 +114,8 @@ CSS_STATE_PSEUDO_CLASS(mozHandlerDisabled, ":-moz-handler-disabled",
|
|||
NS_EVENT_STATE_HANDLER_DISABLED)
|
||||
CSS_STATE_PSEUDO_CLASS(mozHandlerBlocked, ":-moz-handler-blocked",
|
||||
NS_EVENT_STATE_HANDLER_BLOCKED)
|
||||
CSS_STATE_PSEUDO_CLASS(mozHandlerCrashed, ":-moz-handler-crashed",
|
||||
NS_EVENT_STATE_HANDLER_CRASHED)
|
||||
|
||||
CSS_PSEUDO_CLASS(mozHasHandlerRef, ":-moz-has-handlerref")
|
||||
|
||||
|
|
|
@ -704,6 +704,13 @@ function run() {
|
|||
test_balanced_unparseable(":-moz-tree-twisty(open())");
|
||||
test_balanced_unparseable("::-moz-tree-twisty(hover ())");
|
||||
|
||||
// Plugin pseudoclasses
|
||||
test_parseable(":-moz-type-unsupported");
|
||||
test_parseable(":-moz-handler-disabled");
|
||||
test_parseable(":-moz-handler-blocked");
|
||||
test_parseable(":-moz-handler-crashed");
|
||||
test_parseable(":-moz-has-handlerref");
|
||||
|
||||
// Case sensitivity of tag selectors
|
||||
function setup_cased_spans(body) {
|
||||
var data = [
|
||||
|
|
|
@ -68,9 +68,11 @@ ifeq ($(OS_ARCH),OS2)
|
|||
TOOL_DIRS += default/os2
|
||||
endif
|
||||
|
||||
ifdef PBBUILD
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
||||
TOOL_DIRS += default/mac
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
ifneq (,$(filter WINNT Darwin Linux OS2 SunOS,$(OS_ARCH)))
|
||||
|
|
|
@ -338,7 +338,7 @@ typedef enum {
|
|||
, NPPVpluginEventModel = 1001
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_PLATFORM_HILDON
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
, NPPVpluginWindowlessLocalBool = 2002
|
||||
#endif
|
||||
} NPPVariable;
|
||||
|
@ -383,7 +383,7 @@ typedef enum {
|
|||
#endif
|
||||
, NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
|
||||
#endif
|
||||
#ifdef MOZ_PLATFORM_HILDON
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
, NPNVSupportsWindowlessLocal = 2002
|
||||
#endif
|
||||
} NPNVariable;
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
SetPluginInstance(aPluginInstance);
|
||||
return NS_OK;
|
||||
}
|
||||
#if defined(MOZ_PLATFORM_HILDON) && defined(MOZ_WIDGET_GTK2)
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
#define MOZ_COMPOSITED_PLUGINS
|
||||
#endif
|
||||
#ifdef MOZ_COMPOSITED_PLUGINS
|
||||
|
|
|
@ -300,10 +300,10 @@ nsNPAPIPlugin::SetPluginRefNum(short aRefNum)
|
|||
|
||||
#ifdef MOZ_IPC
|
||||
void
|
||||
nsNPAPIPlugin::PluginCrashed()
|
||||
nsNPAPIPlugin::PluginCrashed(const nsAString& dumpID)
|
||||
{
|
||||
nsRefPtr<nsPluginHost> host = dont_AddRef(nsPluginHost::GetInst());
|
||||
host->PluginCrashed(this);
|
||||
host->PluginCrashed(this, dumpID);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2139,7 +2139,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
|||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
#ifdef MOZ_PLATFORM_HILDON
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
case NPNVSupportsWindowlessLocal: {
|
||||
*(NPBool*)result = PR_TRUE;
|
||||
return NPERR_NO_ERROR;
|
||||
|
@ -2277,7 +2277,7 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
|
|||
return inst->SetWindowless(bWindowless);
|
||||
#endif
|
||||
}
|
||||
#ifdef MOZ_PLATFORM_HILDON
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
case NPPVpluginWindowlessLocalBool: {
|
||||
NPBool bWindowlessLocal = (result != nsnull);
|
||||
return inst->SetWindowlessLocal(bWindowlessLocal);
|
||||
|
|
|
@ -93,8 +93,9 @@ public:
|
|||
|
||||
#ifdef MOZ_IPC
|
||||
// The IPC mechanism notifies the nsNPAPIPlugin if the plugin crashes and is
|
||||
// no longer usable.
|
||||
void PluginCrashed();
|
||||
// no longer usable. dumpID is the ID of a minidump that was written,
|
||||
// or empty if no minidump was written.
|
||||
void PluginCrashed(const nsAString& dumpID);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
|
|
@ -1392,7 +1392,7 @@ NS_IMETHODIMP nsNPAPIPluginInstance::HandleEvent(void* event, PRBool* handled)
|
|||
|
||||
NS_IMETHODIMP nsNPAPIPluginInstance::GetValueFromPlugin(NPPVariable variable, void* value)
|
||||
{
|
||||
#ifdef MOZ_PLATFORM_HILDON
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
// The maemo flash plugin does not remember this. It sets the
|
||||
// value, but doesn't support the get value.
|
||||
if (variable == NPPVpluginWindowlessLocalBool) {
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
#include "nsVersionComparator.h"
|
||||
#include "nsIPrivateBrowsingService.h"
|
||||
#include "nsIObjectLoadingContent.h"
|
||||
#include "nsIWritablePropertyBag2.h"
|
||||
|
||||
#include "nsEnumeratorUtils.h"
|
||||
#include "nsXPCOM.h"
|
||||
|
@ -5207,7 +5208,7 @@ NS_IMETHODIMP nsPluginHost::Notify(nsITimer* timer)
|
|||
|
||||
#ifdef MOZ_IPC
|
||||
void
|
||||
nsPluginHost::PluginCrashed(nsNPAPIPlugin* aPlugin)
|
||||
nsPluginHost::PluginCrashed(nsNPAPIPlugin* aPlugin, const nsAString& dumpID)
|
||||
{
|
||||
nsPluginTag* pluginTag = FindTagForPlugin(aPlugin);
|
||||
if (!pluginTag) {
|
||||
|
@ -5215,6 +5216,17 @@ nsPluginHost::PluginCrashed(nsNPAPIPlugin* aPlugin)
|
|||
return;
|
||||
}
|
||||
|
||||
// Notify the app's observer that a plugin crashed so it can submit a crashreport.
|
||||
PRBool submittedCrashReport = PR_FALSE;
|
||||
nsCOMPtr<nsIObserverService> obsService = do_GetService("@mozilla.org/observer-service;1");
|
||||
nsCOMPtr<nsIWritablePropertyBag2> propbag = do_CreateInstance("@mozilla.org/hash-property-bag;1");
|
||||
if (obsService && propbag) {
|
||||
propbag->SetPropertyAsAString(NS_LITERAL_STRING("minidumpID"), dumpID);
|
||||
obsService->NotifyObservers(propbag, "plugin-crashed", nsnull);
|
||||
// see if an observer submitted a crash report.
|
||||
propbag->GetPropertyAsBool(NS_LITERAL_STRING("submittedCrashReport"), &submittedCrashReport);
|
||||
}
|
||||
|
||||
// Invalidate each nsPluginInstanceTag for the crashed plugin
|
||||
|
||||
for (PRUint32 i = mInstanceTags.Length(); i > 0; i--) {
|
||||
|
@ -5225,7 +5237,8 @@ nsPluginHost::PluginCrashed(nsNPAPIPlugin* aPlugin)
|
|||
instanceTag->mInstance->GetDOMElement(getter_AddRefs(domElement));
|
||||
nsCOMPtr<nsIObjectLoadingContent> objectContent(do_QueryInterface(domElement));
|
||||
if (objectContent) {
|
||||
objectContent->PluginCrashed();
|
||||
objectContent->PluginCrashed(NS_ConvertUTF8toUTF16(pluginTag->mName),
|
||||
submittedCrashReport);
|
||||
}
|
||||
|
||||
instanceTag->mInstance->Stop();
|
||||
|
|
|
@ -160,7 +160,7 @@ public:
|
|||
void RemoveIdleTimeTarget(nsIPluginInstanceOwner* objectFrame);
|
||||
|
||||
#ifdef MOZ_IPC
|
||||
void PluginCrashed(nsNPAPIPlugin* plugin);
|
||||
void PluginCrashed(nsNPAPIPlugin* plugin, const nsAString& dumpID);
|
||||
#endif
|
||||
|
||||
nsPluginInstanceTag *FindInstanceTag(nsIPluginInstance *instance);
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include <gdk/gdkx.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#ifdef MOZ_PLATFORM_HILDON
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
#define MOZ_COMPOSITED_PLUGINS
|
||||
#endif
|
||||
|
||||
|
|
|
@ -45,68 +45,69 @@ include $(DEPTH)/config/autoconf.mk
|
|||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_MOCHITEST_FILES = \
|
||||
test_getauthenticationinfo.html \
|
||||
test_npobject_getters.html \
|
||||
test_npruntime_npnevaluate.html \
|
||||
test_npruntime_npninvoke.html \
|
||||
test_npruntime_npninvokedefault.html \
|
||||
loremipsum.txt \
|
||||
loremipsum_file.txt \
|
||||
post.sjs \
|
||||
pluginstream.js \
|
||||
plugin_window.html \
|
||||
test_painting.html \
|
||||
test_pluginstream_err.html \
|
||||
test_pluginstream_src.html \
|
||||
test_pluginstream_geturl.html \
|
||||
test_pluginstream_geturlnotify.html \
|
||||
test_pluginstream_asfile.html \
|
||||
test_pluginstream_asfileonly.html \
|
||||
test_pluginstream_post.html \
|
||||
test_pluginstream_poststream.html \
|
||||
test_pluginstream_seek.html \
|
||||
test_pluginstream_newstream.html \
|
||||
test_multipleinstanceobjects.html \
|
||||
test_streamNotify.html \
|
||||
test_instantiation.html \
|
||||
test_cookies.html \
|
||||
test_npn_timers.html \
|
||||
test_npn_asynccall.html \
|
||||
$(NULL)
|
||||
test_getauthenticationinfo.html \
|
||||
test_npobject_getters.html \
|
||||
test_npruntime_npnevaluate.html \
|
||||
test_npruntime_npninvoke.html \
|
||||
test_npruntime_npninvokedefault.html \
|
||||
loremipsum.txt \
|
||||
loremipsum_file.txt \
|
||||
post.sjs \
|
||||
pluginstream.js \
|
||||
plugin_window.html \
|
||||
test_painting.html \
|
||||
test_pluginstream_err.html \
|
||||
test_pluginstream_src.html \
|
||||
test_pluginstream_geturl.html \
|
||||
test_pluginstream_geturlnotify.html \
|
||||
test_pluginstream_asfile.html \
|
||||
test_pluginstream_asfileonly.html \
|
||||
test_pluginstream_post.html \
|
||||
test_pluginstream_poststream.html \
|
||||
test_pluginstream_seek.html \
|
||||
test_pluginstream_newstream.html \
|
||||
test_multipleinstanceobjects.html \
|
||||
test_streamNotify.html \
|
||||
test_instantiation.html \
|
||||
test_cookies.html \
|
||||
test_npn_timers.html \
|
||||
test_npn_asynccall.html \
|
||||
$(NULL)
|
||||
|
||||
# test_npruntime_npnsetexception.html \ Disabled for e10s
|
||||
# test_npruntime_npnsetexception.html \ Disabled for e10s
|
||||
|
||||
ifdef MOZ_IPC
|
||||
_MOCHITEST_FILES += \
|
||||
test_crashing.html \
|
||||
test_crashing2.html \
|
||||
crashing_subpage.html \
|
||||
$(NULL)
|
||||
test_crashing.html \
|
||||
test_crashing2.html \
|
||||
crashing_subpage.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
_MOCHITEST_FILES += \
|
||||
test_windowed_invalidate.html \
|
||||
$(NULL)
|
||||
test_windowed_invalidate.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
_MOCHICHROME_FILES = \
|
||||
test_bug479979.xul \
|
||||
test_npruntime.xul \
|
||||
test_privatemode.xul \
|
||||
test_wmode.xul \
|
||||
$(NULL)
|
||||
test_bug479979.xul \
|
||||
test_npruntime.xul \
|
||||
test_privatemode.xul \
|
||||
test_wmode.xul \
|
||||
$(NULL)
|
||||
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
_MOCHICHROME_FILES += \
|
||||
test_convertpoint.xul \
|
||||
$(NULL)
|
||||
test_convertpoint.xul \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef MOZ_IPC
|
||||
_MOCHICHROME_FILES += \
|
||||
test_crash_notify.xul \
|
||||
$(NULL)
|
||||
test_crash_notify.xul \
|
||||
test_crash_notify_no_report.xul \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
libs:: $(_MOCHICHROME_FILES)
|
||||
|
|
|
@ -19,12 +19,71 @@ SimpleTest.waitForExplicitFinish();
|
|||
|
||||
var success = false;
|
||||
|
||||
var observerFired = false;
|
||||
|
||||
var testObserver = {
|
||||
observe: function(subject, topic, data) {
|
||||
observerFired = true;
|
||||
ok(true, "Observer fired");
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
is(topic, "plugin-crashed", "Checking correct topic");
|
||||
is(data, null, "Checking null data");
|
||||
ok((subject instanceof Components.interfaces.nsIPropertyBag2), "got Propbag");
|
||||
ok((subject instanceof Components.interfaces.nsIWritablePropertyBag2),
|
||||
"got writable Propbag");
|
||||
|
||||
var id = subject.getPropertyAsAString("minidumpID");
|
||||
isnot(id, "", "got a non-empty crash id");
|
||||
let directoryService =
|
||||
Components.classes["@mozilla.org/file/directory_service;1"].
|
||||
getService(Components.interfaces.nsIProperties);
|
||||
let profD = directoryService.get("ProfD", Components.interfaces.nsIFile);
|
||||
profD.append("minidumps");
|
||||
let dumpFile = profD.clone();
|
||||
dumpFile.append(id + ".dmp");
|
||||
ok(dumpFile.exists(), "minidump exists");
|
||||
let extraFile = profD.clone();
|
||||
extraFile.append(id + ".extra");
|
||||
ok(extraFile.exists(), "extra file exists");
|
||||
// cleanup, to be nice
|
||||
dumpFile.remove(false);
|
||||
extraFile.remove(false);
|
||||
},
|
||||
|
||||
QueryInterface: function(iid) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
if (iid.equals(Components.interfaces.nsIObserver) ||
|
||||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
|
||||
iid.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function onPluginCrashed(aEvent) {
|
||||
ok(true, "Plugin crashed notification received");
|
||||
ok(observerFired, "Observer should have fired first");
|
||||
is(aEvent.type, "PluginCrashed", "event is correct type");
|
||||
|
||||
var pluginElement = document.getElementById("plugin1");
|
||||
is (pluginElement, aEvent.target, "Plugin crashed event target is plugin element");
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
|
||||
ok(aEvent instanceof Components.interfaces.nsIDOMDataContainerEvent,
|
||||
"plugin crashed event has the right interface");
|
||||
var pluginName = aEvent.getData("pluginName");
|
||||
is(pluginName, "Test Plug-in");
|
||||
var didReport = aEvent.getData("submittedCrashReport");
|
||||
// The app itself may or may not have decided to submit the report, so
|
||||
// allow either true or false here.
|
||||
ok((didReport == true || didReport == false), "event said crash report was submitted");
|
||||
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"].
|
||||
getService(Components.interfaces.nsIObserverService);
|
||||
os.removeObserver(testObserver, "plugin-crashed");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -38,6 +97,10 @@ function runTests() {
|
|||
return;
|
||||
}
|
||||
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"].
|
||||
getService(Components.interfaces.nsIObserverService);
|
||||
os.addObserver(testObserver, "plugin-crashed", true);
|
||||
|
||||
document.addEventListener("PluginCrashed", onPluginCrashed, false);
|
||||
|
||||
var pluginElement = document.getElementById("plugin1");
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
<window title="Basic Plugin Tests"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<title>Plugin Crash Notification Test</title>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
|
||||
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
|
||||
</body>
|
||||
<script class="testbody" type="application/javascript">
|
||||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var success = false;
|
||||
|
||||
var observerFired = false;
|
||||
|
||||
var testObserver = {
|
||||
observe: function(subject, topic, data) {
|
||||
observerFired = true;
|
||||
ok(true, "Observer fired");
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
is(topic, "plugin-crashed", "Checking correct topic");
|
||||
is(data, null, "Checking null data");
|
||||
ok((subject instanceof Components.interfaces.nsIPropertyBag2), "got Propbag");
|
||||
ok((subject instanceof Components.interfaces.nsIWritablePropertyBag2),
|
||||
"got writable Propbag");
|
||||
|
||||
var id = subject.getPropertyAsAString("minidumpID");
|
||||
isnot(id, "", "got a non-empty crash id");
|
||||
let directoryService =
|
||||
Components.classes["@mozilla.org/file/directory_service;1"].
|
||||
getService(Components.interfaces.nsIProperties);
|
||||
let pendingD = directoryService.get("UAppData",
|
||||
Components.interfaces.nsIFile);
|
||||
pendingD.append("Crash Reports");
|
||||
pendingD.append("pending");
|
||||
let dumpFile = pendingD.clone();
|
||||
dumpFile.append(id + ".dmp");
|
||||
ok(dumpFile.exists(), "minidump exists");
|
||||
let extraFile = pendingD.clone();
|
||||
extraFile.append(id + ".extra");
|
||||
ok(extraFile.exists(), "extra file exists");
|
||||
// cleanup, to be nice
|
||||
dumpFile.remove(false);
|
||||
extraFile.remove(false);
|
||||
},
|
||||
|
||||
QueryInterface: function(iid) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
if (iid.equals(Components.interfaces.nsIObserver) ||
|
||||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
|
||||
iid.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function onPluginCrashed(aEvent) {
|
||||
ok(true, "Plugin crashed notification received");
|
||||
ok(observerFired, "Observer should have fired first");
|
||||
is(aEvent.type, "PluginCrashed", "event is correct type");
|
||||
|
||||
var pluginElement = document.getElementById("plugin1");
|
||||
is (pluginElement, aEvent.target, "Plugin crashed event target is plugin element");
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
|
||||
ok(aEvent instanceof Components.interfaces.nsIDOMDataContainerEvent,
|
||||
"plugin crashed event has the right interface");
|
||||
var pluginName = aEvent.getData("pluginName");
|
||||
is(pluginName, "Test Plug-in");
|
||||
var didReport = aEvent.getData("submittedCrashReport");
|
||||
// The app itself may or may not have decided to submit the report, so
|
||||
// allow either true or false here.
|
||||
ok((didReport == true || didReport == false), "event said crash report was submitted");
|
||||
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"].
|
||||
getService(Components.interfaces.nsIObserverService);
|
||||
os.removeObserver(testObserver, "plugin-crashed");
|
||||
|
||||
// re-set MOZ_CRASHREPORTER_NO_REPORT
|
||||
let env = Components.classes["@mozilla.org/process/environment;1"]
|
||||
.getService(Components.interfaces.nsIEnvironment);
|
||||
env.set("MOZ_CRASHREPORTER_NO_REPORT", "1");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var prefs = Components.classes['@mozilla.org/preferences-service;1']
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
if (!prefs.getBoolPref('dom.ipc.plugins.enabled')) {
|
||||
ok(true, "Skipping this test when IPC plugins are not enabled.");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
// the test harness will have set MOZ_CRASHREPORTER_NO_REPORT,
|
||||
// ensure that we can change the setting and have our minidumps
|
||||
// wind up in Crash Reports/pending
|
||||
let env = Components.classes["@mozilla.org/process/environment;1"]
|
||||
.getService(Components.interfaces.nsIEnvironment);
|
||||
env.set("MOZ_CRASHREPORTER_NO_REPORT", "");
|
||||
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"].
|
||||
getService(Components.interfaces.nsIObserverService);
|
||||
os.addObserver(testObserver, "plugin-crashed", true);
|
||||
|
||||
document.addEventListener("PluginCrashed", onPluginCrashed, false);
|
||||
|
||||
var pluginElement = document.getElementById("plugin1");
|
||||
try {
|
||||
pluginElement.crash();
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
||||
|
|
@ -1727,11 +1727,7 @@ nsCookieService::AddInternal(const nsCString &aBaseDomain,
|
|||
|
||||
** Begin BNF:
|
||||
token = 1*<any allowed-chars except separators>
|
||||
value = token-value | quoted-string
|
||||
token-value = 1*<any allowed-chars except value-sep>
|
||||
quoted-string = ( <"> *( qdtext | quoted-pair ) <"> )
|
||||
qdtext = <any allowed-chars except <">> ; CR | LF removed by necko
|
||||
quoted-pair = "\" <any OCTET except NUL or cookie-sep> ; CR | LF removed by necko
|
||||
value = 1*<any allowed-chars except value-sep>
|
||||
separators = ";" | "="
|
||||
value-sep = ";"
|
||||
cookie-sep = CR | LF
|
||||
|
@ -1766,7 +1762,6 @@ nsCookieService::AddInternal(const nsCString &aBaseDomain,
|
|||
// helper functions for GetTokenValue
|
||||
static inline PRBool iswhitespace (char c) { return c == ' ' || c == '\t'; }
|
||||
static inline PRBool isterminator (char c) { return c == '\n' || c == '\r'; }
|
||||
static inline PRBool isquoteterminator(char c) { return isterminator(c) || c == '"'; }
|
||||
static inline PRBool isvalueseparator (char c) { return isterminator(c) || c == ';'; }
|
||||
static inline PRBool istokenseparator (char c) { return isvalueseparator(c) || c == '='; }
|
||||
|
||||
|
@ -1806,39 +1801,16 @@ nsCookieService::GetTokenValue(nsASingleFragmentCString::const_char_iterator &aI
|
|||
|
||||
start = aIter;
|
||||
|
||||
if (*aIter == '"') {
|
||||
// process <quoted-string>
|
||||
// (note: cookie terminators, CR | LF, can't happen:
|
||||
// they're removed by necko before the header gets here)
|
||||
// assume value mangled if no terminating '"', return
|
||||
while (++aIter != aEndIter && !isquoteterminator(*aIter)) {
|
||||
// if <qdtext> (backwhacked char), skip over it. this allows '\"' in <quoted-string>.
|
||||
// we increment once over the backwhack, nullcheck, then continue to the 'while',
|
||||
// which increments over the backwhacked char. one exception - we don't allow
|
||||
// CR | LF here either (see above about necko)
|
||||
if (*aIter == '\\' && (++aIter == aEndIter || isterminator(*aIter)))
|
||||
break;
|
||||
}
|
||||
// process <token>
|
||||
// just look for ';' to terminate ('=' allowed)
|
||||
while (aIter != aEndIter && !isvalueseparator(*aIter))
|
||||
++aIter;
|
||||
|
||||
if (aIter != aEndIter && !isterminator(*aIter)) {
|
||||
// include terminating quote in attribute string
|
||||
aTokenValue.Rebind(start, ++aIter);
|
||||
// skip to next ';'
|
||||
while (aIter != aEndIter && !isvalueseparator(*aIter))
|
||||
++aIter;
|
||||
}
|
||||
} else {
|
||||
// process <token-value>
|
||||
// just look for ';' to terminate ('=' allowed)
|
||||
while (aIter != aEndIter && !isvalueseparator(*aIter))
|
||||
++aIter;
|
||||
|
||||
// remove trailing <LWS>; first check we're not at the beginning
|
||||
if (aIter != start) {
|
||||
lastSpace = aIter;
|
||||
while (--lastSpace != start && iswhitespace(*lastSpace));
|
||||
aTokenValue.Rebind(start, ++lastSpace);
|
||||
}
|
||||
// remove trailing <LWS>; first check we're not at the beginning
|
||||
if (aIter != start) {
|
||||
lastSpace = aIter;
|
||||
while (--lastSpace != start && iswhitespace(*lastSpace));
|
||||
aTokenValue.Rebind(start, ++lastSpace);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1900,10 +1872,6 @@ nsCookieService::ParseAttributes(nsDependentCString &aCookieHeader,
|
|||
if (!tokenValue.IsEmpty()) {
|
||||
tokenValue.BeginReading(tempBegin);
|
||||
tokenValue.EndReading(tempEnd);
|
||||
if (*tempBegin == '"' && *--tempEnd == '"') {
|
||||
// our parameter is a quoted-string; remove quotes for later parsing
|
||||
tokenValue.Rebind(++tempBegin, tempEnd);
|
||||
}
|
||||
}
|
||||
|
||||
// decide which attribute we have, and copy the string
|
||||
|
@ -2272,8 +2240,15 @@ nsCookieService::GetExpiry(nsCookieAttributes &aCookieAttributes,
|
|||
PRTime tempExpires;
|
||||
PRInt64 expires;
|
||||
|
||||
// For Expires, we trim leading and trailing " characters to maximize
|
||||
// the compatibility of our date parsing. In principle, this processsing
|
||||
// should be done in our date parser.
|
||||
nsCString& expiresAttr = aCookieAttributes.expires;
|
||||
if (!expiresAttr.IsEmpty() && expiresAttr.First() == '"' && expiresAttr.Last() == '"')
|
||||
expiresAttr = Substring(expiresAttr.BeginReading() + 1, expiresAttr.EndReading() - 1);
|
||||
|
||||
// parse expiry time
|
||||
if (PR_ParseTimeString(aCookieAttributes.expires.get(), PR_TRUE, &tempExpires) == PR_SUCCESS) {
|
||||
if (PR_ParseTimeString(expiresAttr.get(), PR_TRUE, &tempExpires) == PR_SUCCESS) {
|
||||
expires = tempExpires / PR_USEC_PER_SEC;
|
||||
} else {
|
||||
return PR_TRUE;
|
||||
|
|
|
@ -462,39 +462,45 @@ main(PRInt32 argc, char *argv[])
|
|||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; expires=Thu, 10 Apr 1980 16:33:12 GMT", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[2] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; max-age=60", nsnull);
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; expires=\"Thu, 10 Apr 1980 16:33:12 GMT", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[3] = CheckResult(cookie.get(), MUST_EQUAL, "test=expiry");
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; max-age=-20", nsnull);
|
||||
rv[3] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; expires=\"Thu, 10 Apr 1980 16:33:12 GMT\"", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[4] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; max-age=60", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[5] = CheckResult(cookie.get(), MUST_EQUAL, "test=expiry");
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; expires=Thu, 10 Apr 1980 16:33:12 GMT", nsnull);
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; max-age=-20", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[6] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; max-age=60", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[7] = CheckResult(cookie.get(), MUST_EQUAL, "test=expiry");
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; expires=Thu, 10 Apr 1980 16:33:12 GMT", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[8] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=expiry; max-age=60", nsnull);
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "newtest=expiry; max-age=60", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[7] = CheckResult(cookie.get(), MUST_CONTAIN, "test=expiry");
|
||||
rv[8] = CheckResult(cookie.get(), MUST_CONTAIN, "newtest=expiry");
|
||||
rv[9] = CheckResult(cookie.get(), MUST_CONTAIN, "test=expiry");
|
||||
rv[10] = CheckResult(cookie.get(), MUST_CONTAIN, "newtest=expiry");
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "test=differentvalue; max-age=0", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[9] = CheckResult(cookie.get(), MUST_EQUAL, "newtest=expiry");
|
||||
rv[11] = CheckResult(cookie.get(), MUST_EQUAL, "newtest=expiry");
|
||||
SetACookie(cookieService, "http://expireme.org/", nsnull, "newtest=evendifferentvalue; max-age=0", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[10] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
|
||||
SetACookie(cookieService, "http://foo.expireme.org/", nsnull, "test=expiry; domain=.expireme.org; max-age=60", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[11] = CheckResult(cookie.get(), MUST_EQUAL, "test=expiry");
|
||||
SetACookie(cookieService, "http://bar.expireme.org/", nsnull, "test=differentvalue; domain=.expireme.org; max-age=0", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[12] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
|
||||
allTestsPassed = PrintResult(rv, 13) && allTestsPassed;
|
||||
SetACookie(cookieService, "http://foo.expireme.org/", nsnull, "test=expiry; domain=.expireme.org; max-age=60", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[13] = CheckResult(cookie.get(), MUST_EQUAL, "test=expiry");
|
||||
SetACookie(cookieService, "http://bar.expireme.org/", nsnull, "test=differentvalue; domain=.expireme.org; max-age=0", nsnull);
|
||||
GetACookie(cookieService, "http://expireme.org/", nsnull, getter_Copies(cookie));
|
||||
rv[14] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
|
||||
allTestsPassed = PrintResult(rv, 15) && allTestsPassed;
|
||||
|
||||
|
||||
// *** multiple cookie tests
|
||||
|
@ -535,7 +541,7 @@ main(PRInt32 argc, char *argv[])
|
|||
rv[1] = CheckResult(cookie.get(), MUST_BE_NULL);
|
||||
SetACookie(cookieService, "http://parser.test/", nsnull, "test=\"fubar! = foo;bar\\\";\" parser; domain=.parser.test; max-age=6\nfive; max-age=2.63,", nsnull);
|
||||
GetACookie(cookieService, "http://parser.test/", nsnull, getter_Copies(cookie));
|
||||
rv[2] = CheckResult(cookie.get(), MUST_CONTAIN, "test=\"fubar! = foo;bar\\\";\"");
|
||||
rv[2] = CheckResult(cookie.get(), MUST_CONTAIN, "test=\"fubar! = foo");
|
||||
rv[3] = CheckResult(cookie.get(), MUST_CONTAIN, "five");
|
||||
SetACookie(cookieService, "http://parser.test/", nsnull, "test=kill; domain=.parser.test; max-age=0 \n five; max-age=0", nsnull);
|
||||
GetACookie(cookieService, "http://parser.test/", nsnull, getter_Copies(cookie));
|
||||
|
|
|
@ -57,6 +57,9 @@ const PR_UINT32_MAX = Math.pow(2, 32) - 1;
|
|||
/** True if debugging output is enabled, false otherwise. */
|
||||
var DEBUG = false; // non-const *only* so tweakable in server tests
|
||||
|
||||
/** True if debugging output should be timestamped. */
|
||||
var DEBUG_TIMESTAMP = false; // non-const so tweakable in server tests
|
||||
|
||||
var gGlobalObject = this;
|
||||
|
||||
/**
|
||||
|
@ -75,7 +78,7 @@ function NS_ASSERT(cond, msg)
|
|||
|
||||
var stack = new Error().stack.split(/\n/);
|
||||
dumpn(stack.map(function(val) { return "###!!! " + val; }).join("\n"));
|
||||
|
||||
|
||||
throw Cr.NS_ERROR_ABORT;
|
||||
}
|
||||
}
|
||||
|
@ -164,12 +167,32 @@ const HEADERS_SUFFIX = HIDDEN_CHAR + "headers" + HIDDEN_CHAR;
|
|||
/** Type used to denote SJS scripts for CGI-like functionality. */
|
||||
const SJS_TYPE = "sjs";
|
||||
|
||||
/** Base for relative timestamps produced by dumpn(). */
|
||||
var firstStamp = 0;
|
||||
|
||||
/** dump(str) with a trailing "\n" -- only outputs if DEBUG */
|
||||
/** dump(str) with a trailing "\n" -- only outputs if DEBUG. */
|
||||
function dumpn(str)
|
||||
{
|
||||
if (DEBUG)
|
||||
dump(str + "\n");
|
||||
{
|
||||
var prefix = "HTTPD-INFO | ";
|
||||
if (DEBUG_TIMESTAMP)
|
||||
{
|
||||
if (firstStamp === 0)
|
||||
firstStamp = Date.now();
|
||||
|
||||
var elapsed = Date.now() - firstStamp; // milliseconds
|
||||
var min = Math.floor(elapsed / 60000);
|
||||
var sec = (elapsed % 60000) / 1000;
|
||||
|
||||
if (sec < 10)
|
||||
prefix += min + ":0" + sec.toFixed(3) + " | ";
|
||||
else
|
||||
prefix += min + ":" + sec.toFixed(3) + " | ";
|
||||
}
|
||||
|
||||
dump(prefix + str + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
/** Dumps the current JS stack if DEBUG. */
|
||||
|
|
|
@ -198,6 +198,7 @@ function createMochitestServer(serverBasePath)
|
|||
|
||||
server.registerDirectory("/", serverBasePath);
|
||||
server.registerPathHandler("/server/shutdown", serverShutdown);
|
||||
server.registerPathHandler("/server/debug", serverDebug);
|
||||
server.registerContentType("sjs", "sjs"); // .sjs == CGI-like functionality
|
||||
server.registerContentType("jar", "application/x-jar");
|
||||
server.registerContentType("ogg", "application/ogg");
|
||||
|
@ -310,6 +311,39 @@ function serverShutdown(metadata, response)
|
|||
server.stop(serverStopped);
|
||||
}
|
||||
|
||||
// /server/debug?[012]
|
||||
function serverDebug(metadata, response)
|
||||
{
|
||||
response.setStatusLine(metadata.httpVersion, 400, "Bad debugging level");
|
||||
if (metadata.queryString.length !== 1)
|
||||
return;
|
||||
|
||||
var mode;
|
||||
if (metadata.queryString === "0") {
|
||||
// do this now so it gets logged with the old mode
|
||||
dumpn("Server debug logs disabled.");
|
||||
DEBUG = false;
|
||||
DEBUG_TIMESTAMP = false;
|
||||
mode = "disabled";
|
||||
} else if (metadata.queryString === "1") {
|
||||
DEBUG = true;
|
||||
DEBUG_TIMESTAMP = false;
|
||||
mode = "enabled";
|
||||
} else if (metadata.queryString === "2") {
|
||||
DEBUG = true;
|
||||
DEBUG_TIMESTAMP = true;
|
||||
mode = "enabled, with timestamps";
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
response.setStatusLine(metadata.httpVersion, 200, "OK");
|
||||
response.setHeader("Content-type", "text/plain", false);
|
||||
var body = "Server debug logs " + mode + ".";
|
||||
response.bodyOutputStream.write(body, body.length);
|
||||
dumpn(body);
|
||||
}
|
||||
|
||||
//
|
||||
// DIRECTORY LISTINGS
|
||||
//
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=100533
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 100533</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=100533">Mozilla Bug 100533</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" >
|
||||
|
||||
<button id="thebutton">Test</button>
|
||||
<iframe style='display: none;' src='/static/bug100533_iframe.html' id='a'></iframe>
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
/** Test for Bug 100533 **/
|
||||
var submitIframeForm = function() {
|
||||
$('a').contentDocument.getElementById('b').submit();
|
||||
}
|
||||
|
||||
submitted = function() {
|
||||
ok(true, "Finished. Form submits when located in iframe set to display:none;");
|
||||
SimpleTest.finish();
|
||||
};
|
||||
|
||||
addLoadEvent(function() {
|
||||
connect("thebutton", "click", submitIframeForm);
|
||||
signal("thebutton", "click");
|
||||
});
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1297
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1297</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=1297">Mozilla Bug 1297</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td id="td1" onmousedown="alert(this.cellIndex)">cellIndex=0</td>
|
||||
<td id="td2" onmousedown="alert(this.cellIndex)">cellIndex=1</td>
|
||||
<td id="td3" onmousedown="alert(this.cellIndex)">cellIndex=2</td>
|
||||
<tr id="tr1"
|
||||
onmousedown="alert(this.rowIndex)"><td>rowIndex=1<td>rowIndex=1<td>rowIndex=1</t
|
||||
r>
|
||||
<tr id="tr2"
|
||||
onmousedown="alert(this.rowIndex)"><td>rowIndex=2<td>rowIndex=2<td>rowIndex=2</t
|
||||
r>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 1297 **/
|
||||
is($('td1').cellIndex, 0, "cellIndex / rowIndex working td1");
|
||||
is($('td2').cellIndex, 1, "cellIndex / rowIndex working td2");
|
||||
is($('td3').cellIndex, 2, "cellIndex / rowIndex working td3");
|
||||
is($('tr1').rowIndex, 1, "cellIndex / rowIndex working tr1");
|
||||
is($('tr2').rowIndex, 2, "cellIndex / rowIndex working tr2");
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1366
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1366</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=1366">Mozilla Bug 1366</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<table id="testtable" width=150 border>
|
||||
<tbody id="testbody">
|
||||
<tr>
|
||||
<td>cell content</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 1366 **/
|
||||
$('testtable').removeChild($('testbody'));
|
||||
$('display').innerHTML = "SCRIPT: deleted first ROWGROUP\n";
|
||||
is($('testbody'), null, "deleting tbody works");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1400
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1400</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=1400">Mozilla Bug 1400</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 1400 **/
|
||||
|
||||
table = document.createElement("TABLE");
|
||||
thead = table.createTHead();
|
||||
thead2 = table.createTHead();
|
||||
|
||||
table.appendChild(thead);
|
||||
table.appendChild(thead);
|
||||
table.appendChild(thead);
|
||||
table.appendChild(thead2);
|
||||
table.appendChild(thead2);
|
||||
table.appendChild(thead2);
|
||||
table.appendChild(thead);
|
||||
table.appendChild(thead2);
|
||||
|
||||
is(table.childNodes.length, 1,
|
||||
"adding multiple theads results in one thead child");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1682
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1682</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=1682">Mozilla Bug 1682</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 1682 **/
|
||||
var count = 1;
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function () {
|
||||
is(count, 1, "onload executes once");
|
||||
++count;
|
||||
});
|
||||
addLoadEvent(SimpleTest.finish);
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=172261
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 172261</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=172261">Mozilla Bug 172261</a>
|
||||
<p id="display">
|
||||
<iframe id="test"></iframe>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
/** Test for Bug 172261 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var callable = false;
|
||||
function toggleCallable() { callable = true; }
|
||||
|
||||
var doTestInIframe = false;
|
||||
|
||||
// Shouldn't do history stuff from inside onload
|
||||
addLoadEvent(function() { setTimeout(startTest, 10) });
|
||||
|
||||
function startTest() {
|
||||
// First, create a dummy document. Use onunload handlers to make sure
|
||||
// bfcache doesn't screw us up.
|
||||
var doc = $("test").contentDocument;
|
||||
|
||||
doc.write("<html><body onunload=''>First</body></html>");
|
||||
doc.close();
|
||||
|
||||
// Now write our test document
|
||||
doc.write("<html><script>window.onerror = parent.onerror; if (parent.doTestInIframe) { parent.is(document.domain, parent.document.domain, 'Domains should match'); parent.toggleCallable(); } <" + "/script><body>Second</body></html>");
|
||||
doc.close();
|
||||
|
||||
$("test").onload = goForward;
|
||||
history.back();
|
||||
}
|
||||
|
||||
function goForward() {
|
||||
$("test").onload = doTest;
|
||||
doTestInIframe = true;
|
||||
history.forward();
|
||||
}
|
||||
|
||||
function doTest() {
|
||||
is($("test").contentDocument.domain, document.domain,
|
||||
"Domains should match 2");
|
||||
// Make that into an is() once bug 269270 is fixed.
|
||||
todo($("test").contentDocument.location.href == location.href,
|
||||
"Locations should match");
|
||||
is(callable, true, "Subframe should be able to call us");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1823
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1823</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=1823">Mozilla Bug 1823</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 1823 **/
|
||||
ok((document.location + "").indexOf("[") == -1, "location object has a toString()");
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=2082
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 2082</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=2082">Mozilla Bug 2082</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<FORM name="gui" id="gui">
|
||||
<INPUT TYPE="text" NAME="field" VALUE="some value">
|
||||
</FORM>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 2082 **/
|
||||
var guiform = document.getElementById("gui");
|
||||
ok(document.getElementById("gui").hasChildNodes(), "form elements should be treated as form's children");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=218236
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 218236</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=218236">Mozilla Bug 218236</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 218236 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
/* Test data */
|
||||
|
||||
var url_200 = window.location.href;
|
||||
var url_404 = url_200.replace(/[^/]+$/, "this_file_is_not_going_to_be_there.dummy");
|
||||
var url_connection_error = url_200.replace(/^(\w+:\/\/[^/]+?)(:\d+)?\//, "$1:9546/");
|
||||
|
||||
// List of tests: name of the test, URL to be requested, expected sequence
|
||||
// of events and optionally a function to be called from readystatechange handler.
|
||||
// Numbers in the list of events are values of XMLHttpRequest.readyState
|
||||
// when readystatechange event is triggered.
|
||||
var tests = [
|
||||
["200 OK", url_200, [1, 2, 3, 4, "load"], null],
|
||||
["404 Not Found", url_404, [1, 2, 3, 4, "load"], null],
|
||||
["connection error", url_connection_error, [1, 2, 4, "error"], null],
|
||||
["abort() call on readyState = 1", url_200, [1, 4], doAbort1],
|
||||
["abort() call on readyState = 2", url_200, [1, 2, 4], doAbort2],
|
||||
];
|
||||
|
||||
var testName = null;
|
||||
var currentState = 0;
|
||||
var currentSequence = null;
|
||||
var expectedSequence = null;
|
||||
var currentCallback = null;
|
||||
|
||||
var request = null;
|
||||
|
||||
runNextTest();
|
||||
|
||||
function doAbort1() {
|
||||
if (request.readyState == 1)
|
||||
request.abort();
|
||||
}
|
||||
function doAbort2() {
|
||||
if (request.readyState == 2)
|
||||
request.abort();
|
||||
}
|
||||
|
||||
/* Utility functions */
|
||||
|
||||
function runNextTest() {
|
||||
if (tests.length > 0) {
|
||||
var test = tests.shift();
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
// Prepare request object
|
||||
request = new XMLHttpRequest();
|
||||
request.open("GET", test[1]);
|
||||
request.onreadystatechange = onReadyStateChange;
|
||||
request.onload = onLoad;
|
||||
request.onerror = onError;
|
||||
|
||||
// Initialize state variables
|
||||
testName = test[0]
|
||||
currentState = 0;
|
||||
currentSequence = [];
|
||||
expectedSequence = test[2];
|
||||
currentCallback = test[3];
|
||||
|
||||
// Start request
|
||||
request.send(null);
|
||||
}
|
||||
else
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function finalizeTest() {
|
||||
ok(compareArrays(expectedSequence, currentSequence), "event sequence for '" + testName + "' should be " + expectedSequence.join(", "));
|
||||
|
||||
runNextTest();
|
||||
}
|
||||
|
||||
function onReadyStateChange() {
|
||||
// Ignore duplicated calls for the same ready state
|
||||
if (request.readyState != currentState) {
|
||||
currentState = request.readyState;
|
||||
currentSequence.push(currentState);
|
||||
}
|
||||
|
||||
if (currentState == 4) {
|
||||
// Allow remaining event to fire but then we are finished with this test
|
||||
setTimeout(finalizeTest, 0);
|
||||
}
|
||||
|
||||
if (currentCallback)
|
||||
currentCallback();
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
currentSequence.push("load");
|
||||
}
|
||||
|
||||
function onError() {
|
||||
currentSequence.push("error");
|
||||
}
|
||||
|
||||
function compareArrays(array1, array2) {
|
||||
if (array1.length != array2.length)
|
||||
return false;
|
||||
|
||||
for (var i = 0; i < array1.length; i++)
|
||||
if (array1[i] != array2[i])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=218277
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 218277</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=218277">Mozilla Bug 218277</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: block">
|
||||
<input id="ctrl" name="ctrl" size="20" value="keep together" readonly />
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 218277 **/
|
||||
|
||||
is(escape($('ctrl').value), "keep%A0together", "nbsp preserved in form submissions");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=237071
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 237071</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=237071">Mozilla Bug 237071</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" >
|
||||
<ol id="theOL" start="22">
|
||||
<li id="foo" >should be 22</li>
|
||||
<li id="foo23">should be 23</li>
|
||||
</ol>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
/** Test for Bug 237071 **/
|
||||
is($('theOL').start, 22, "OL start attribute mapped to .start, not just text attribute");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=238409
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 238409</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=238409">Mozilla Bug 238409</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<table id="table_spacing0" cellspacing="0">
|
||||
<tr><td>cellspacing="0"</td></tr>
|
||||
</table>
|
||||
|
||||
<table id="table_spacing2" cellspacing="2">
|
||||
<tr><td>cellspacing="2"</td></tr>
|
||||
</table>
|
||||
|
||||
<table id="table_spacingNone">
|
||||
<tr><td>no cellspacing</td></tr>
|
||||
</table>
|
||||
|
||||
<table id="table_spacingMalformed" cellspacing>
|
||||
<tr><td>malformed cellspacing</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 238409 **/
|
||||
|
||||
ok(document.getElementById("table_spacing0").cellSpacing == "0", "parsing table with cellspacing='0'");
|
||||
ok(document.getElementById("table_spacing2").cellSpacing == "2", "parsing table with cellspacing='2'");
|
||||
ok(document.getElementById("table_spacingNone").cellSpacing == "", "parsing table without cellspacing");
|
||||
ok(document.getElementById("table_spacingMalformed").cellSpacing == "", "parsing table with malformed cellspacing");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=24958
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 24958</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<SCRIPT id="foo" TYPE="text/javascript">/*This space intentionally left blank*/</SCRIPT>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=24958">Mozilla Bug 24958</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 24958 **/
|
||||
ok($("foo").text, "\/*This space intentionally left blank*\/", "HTMLScriptElement.text should return text")
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=277724
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 277724</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=277724">Mozilla Bug 277724</a>
|
||||
<p id="display"></p>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 277724 **/
|
||||
|
||||
var childUnloaded = false;
|
||||
|
||||
var nodes = [
|
||||
[ "select", HTMLSelectElement ],
|
||||
[ "textarea", HTMLTextAreaElement ],
|
||||
[ "text", HTMLInputElement ],
|
||||
[ "password", HTMLInputElement ],
|
||||
[ "checkbox", HTMLInputElement ],
|
||||
[ "radio", HTMLInputElement ],
|
||||
[ "image", HTMLInputElement ],
|
||||
[ "submit", HTMLInputElement ],
|
||||
[ "reset", HTMLInputElement ],
|
||||
[ "button input", HTMLInputElement ],
|
||||
[ "hidden", HTMLInputElement ],
|
||||
[ "file", HTMLInputElement ],
|
||||
[ "submit button", HTMLButtonElement ],
|
||||
[ "reset button", HTMLButtonElement ],
|
||||
[ "button", HTMLButtonElement ]
|
||||
];
|
||||
|
||||
function startTest(frameid) {
|
||||
is(childUnloaded, false, "Child not unloaded yet");
|
||||
|
||||
var doc = $(frameid).contentDocument;
|
||||
ok(doc instanceof Document, "Check for doc", "doc should be a document");
|
||||
|
||||
for (var i = 0; i < nodes.length; ++i) {
|
||||
var id = nodes[i][0];
|
||||
var node = doc.getElementById(id);
|
||||
ok(node instanceof nodes[i][1],
|
||||
"Check for " + id, id + " should be a " + nodes[i][1]);
|
||||
is(node.disabled, false, "check for " + id + " state");
|
||||
node.disabled = true;
|
||||
is(node.disabled, true, "check for " + id + " state change");
|
||||
}
|
||||
|
||||
$(frameid).onload = function () { continueTest(frameid) };
|
||||
|
||||
// Do this off a timeout so it's not treated like a replace load.
|
||||
function loadBlank() {
|
||||
$(frameid).contentWindow.location = "about:blank";
|
||||
}
|
||||
setTimeout(loadBlank, 0);
|
||||
}
|
||||
|
||||
function continueTest(frameid) {
|
||||
is(childUnloaded, true, "Unload handler should have fired");
|
||||
var doc = $(frameid).contentDocument;
|
||||
ok(doc instanceof Document, "Check for doc", "doc should be a document");
|
||||
|
||||
for (var i = 0; i < nodes.length; ++i) {
|
||||
var id = nodes[i][0];
|
||||
var node = doc.getElementById(id);
|
||||
ok(node === null,
|
||||
"Check for " + id, id + " should be null");
|
||||
}
|
||||
|
||||
$(frameid).onload = function() { finishTest(frameid) };
|
||||
|
||||
// Do this off a timeout too. Why, I'm not sure. Something in session
|
||||
// history creates another history state if we don't. :(
|
||||
function goBack() {
|
||||
$(frameid).contentWindow.history.back();
|
||||
}
|
||||
setTimeout(goBack, 0);
|
||||
}
|
||||
|
||||
// XXXbz this is a nasty hack to work around the XML content sink not being
|
||||
// incremental, so that the _first_ control we test is ok but others are not.
|
||||
var testIs = is;
|
||||
var once = false;
|
||||
function flipper(a, b, c) {
|
||||
if (once) {
|
||||
todo(a == b, c);
|
||||
} else {
|
||||
once = true;
|
||||
is(a, b, c);
|
||||
}
|
||||
}
|
||||
|
||||
function finishTest(frameid) {
|
||||
var doc = $(frameid).contentDocument;
|
||||
ok(doc instanceof Document, "Check for doc", "doc should be a document");
|
||||
|
||||
for (var i = 0; i < nodes.length; ++i) {
|
||||
var id = nodes[i][0];
|
||||
var node = doc.getElementById(id);
|
||||
ok(node instanceof nodes[i][1],
|
||||
"Check for " + id, id + " should be a " + nodes[i][1]);
|
||||
testIs(node.disabled, true, "check for " + id + " state restore");
|
||||
}
|
||||
|
||||
if (frameid == "frame2") {
|
||||
SimpleTest.finish();
|
||||
} else {
|
||||
childUnloaded = false;
|
||||
|
||||
// XXXbz this is a nasty hack to deal with the content sink. See above.
|
||||
testIs = flipper;
|
||||
|
||||
$("frame2").onload = function () { startTest("frame2") };
|
||||
$("frame2").src = "/static/bug277724_iframe2.xhtml";
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
</pre>
|
||||
|
||||
<!-- Don't use display:none, since we don't support framestate restoration
|
||||
without a frame tree -->
|
||||
<div id="content" style="visibility: hidden">
|
||||
<iframe src="/static/bug277724_iframe1.html" id="frame1"
|
||||
onload="startTest('frame1')"></iframe>
|
||||
<iframe src="" id="frame2"></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=300691
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 300691</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.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=300691">Mozilla Bug 300691</a>
|
||||
<p id="display">
|
||||
<textarea id="target"></textarea>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
var t = $("target");
|
||||
|
||||
/** Test for Bug 300691 **/
|
||||
function valueIs(arg, reason) {
|
||||
is(t.value, arg, reason);
|
||||
}
|
||||
|
||||
function defValueIs(arg, reason) {
|
||||
is(t.defaultValue, arg, reason);
|
||||
}
|
||||
|
||||
valueIs("", "Nothing in the textarea");
|
||||
defValueIs("", "Nothing in the textarea 2");
|
||||
|
||||
t.appendChild(document.createTextNode("ab"));
|
||||
valueIs("ab", "Appended textnode");
|
||||
defValueIs("ab", "Appended textnode 2");
|
||||
|
||||
t.firstChild.data = "abcd";
|
||||
valueIs("abcd", "Modified textnode text");
|
||||
defValueIs("abcd", "Modified textnode text 2");
|
||||
|
||||
t.appendChild(document.createTextNode("efgh"));
|
||||
valueIs("abcdefgh", "Appended another textnode");
|
||||
defValueIs("abcdefgh", "Appended another textnode 2");
|
||||
|
||||
t.removeChild(t.lastChild);
|
||||
valueIs("abcd", "Removed textnode");
|
||||
defValueIs("abcd", "Removed textnode 2");
|
||||
|
||||
t.appendChild(document.createTextNode("efgh"));
|
||||
valueIs("abcdefgh", "Appended yet another textnode");
|
||||
defValueIs("abcdefgh", "Appended yet another textnode 2");
|
||||
|
||||
t.normalize();
|
||||
valueIs("abcdefgh", "Normalization changes nothing for the value");
|
||||
defValueIs("abcdefgh", "Normalization changes nothing for the value 2");
|
||||
|
||||
t.defaultValue = "abc";
|
||||
valueIs("abc", "Just set the default value on non-edited textarea");
|
||||
defValueIs("abc", "Just set the default value on non-edited textarea 2");
|
||||
|
||||
t.appendChild(document.createTextNode("defgh"));
|
||||
valueIs("abcdefgh", "Appended another textnode again");
|
||||
defValueIs("abcdefgh", "Appended another textnode again 2");
|
||||
|
||||
t.focus(); // This puts the caret at the end of the textarea, and doing
|
||||
// something like "home" in a cross-platform way is kinda hard.
|
||||
sendKey("left");
|
||||
sendKey("left");
|
||||
sendKey("left");
|
||||
sendString("Test");
|
||||
|
||||
valueIs("abcdeTestfgh", "Typed 'Test' after three left-arrows starting from end");
|
||||
defValueIs("abcdefgh", "Typing 'Test' shouldn't affect default value");
|
||||
|
||||
sendKey("right");
|
||||
sendKey("right");
|
||||
sendKey("back_space");
|
||||
sendKey("back_space");
|
||||
|
||||
valueIs("abcdeTesth",
|
||||
"Backspaced twice after two right-arrows starting from end of typing");
|
||||
defValueIs("abcdefgh", "Deleting shouldn't affect default value");
|
||||
|
||||
t.appendChild(document.createTextNode("ijk"));
|
||||
valueIs("abcdeTesth",
|
||||
"Appending textnode shouldn't affect value in edited textarea");
|
||||
defValueIs("abcdefghijk", "Appended textnode 3");
|
||||
|
||||
t.lastChild.data = "lmno";
|
||||
valueIs("abcdeTesth",
|
||||
"Modifying textnode text shouldn't affect value in edited textarea");
|
||||
defValueIs("abcdefghlmno", "Modified textnode text 3");
|
||||
|
||||
t.removeChild(t.firstChild);
|
||||
valueIs("abcdeTesth",
|
||||
"Removing child textnode shouldn't affect value in edited textarea");
|
||||
defValueIs("defghlmno", "Removed textnode 3");
|
||||
|
||||
t.insertBefore(document.createTextNode("abc"), t.firstChild);
|
||||
valueIs("abcdeTesth",
|
||||
"Inserting child textnode shouldn't affect value in edited textarea");
|
||||
defValueIs("abcdefghlmno", "Inserted a text node");
|
||||
|
||||
t.normalize();
|
||||
valueIs("abcdeTesth", "Normalization changes nothing for the value 3");
|
||||
defValueIs("abcdefghlmno", "Normalization changes nothing for the value 4");
|
||||
|
||||
t.defaultValue = "abc";
|
||||
valueIs("abcdeTesth", "Setting default value shouldn't affect edited textarea");
|
||||
defValueIs("abc", "Just set the default value textarea");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=300691
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 300691</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=300691">Mozilla Bug 300691</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="text/javascript">
|
||||
// First, setup. We'll be toggling these variables as we go.
|
||||
// Note that scripts don't execute immediately when you put text in them --
|
||||
// they wait for the currently-running script to finish.
|
||||
var test1Ran = false;
|
||||
var test2Ran = false;
|
||||
var test3Ran = false;
|
||||
var test4Ran = false;
|
||||
var test5Ran = false;
|
||||
var test6Ran = false;
|
||||
var test7Ran = false;
|
||||
var test8Ran = false;
|
||||
var test9Ran = false;
|
||||
var test10Ran = false;
|
||||
var test11Ran = false;
|
||||
var test12Ran = false;
|
||||
var test13Ran = false;
|
||||
var test14aRan = false;
|
||||
var test14bRan = false;
|
||||
var test15aRan = false;
|
||||
var test15bRan = false;
|
||||
</script>
|
||||
<script id="test1" type="text/javascript">test1Ran = true;</script>
|
||||
<script id="test2" type="text/javascript"></script>
|
||||
<script id="test3" type="text/javascript">;</script>
|
||||
<script id="test4" type="text/javascript"> </script>
|
||||
<script id="test5" type="text/javascript"></script>
|
||||
<script id="test6" type="text/javascript"></script>
|
||||
<script id="test7" type="text/javascript"></script>
|
||||
<script id="test8" type="text/javascript"></script>
|
||||
<script id="test9" type="text/javascript"></script>
|
||||
<script id="test10" type="text/javascript" src="data:text/javascript,">
|
||||
test10Ran = true;
|
||||
</script>
|
||||
<script id="test11" type="text/javascript"
|
||||
src="data:text/javascript,test11Ran = true">
|
||||
test11Ran = false;
|
||||
</script>
|
||||
<script id="test12" type="text/javascript"></script>
|
||||
<script id="test13" type="text/javascript"></script>
|
||||
<script id="test14" type="text/javascript"></script>
|
||||
<script id="test15" type="text/javascript"></script>
|
||||
<script class="testbody" type="text/javascript">
|
||||
/** Test for Bug 300691 **/
|
||||
$("test2").appendChild(document.createTextNode("test2Ran = true"));
|
||||
is(test2Ran, false, "Not yet 2!");
|
||||
|
||||
$("test3").appendChild(document.createTextNode("test3Ran = true"));
|
||||
is(test3Ran, false, "Not yet 3!");
|
||||
|
||||
$("test4").appendChild(document.createTextNode("test4Ran = true"));
|
||||
is(test4Ran, false, "Not yet 4!");
|
||||
|
||||
$("test5").appendChild(document.createTextNode(" "));
|
||||
$("test5").appendChild(document.createTextNode("test5Ran = true"));
|
||||
is(test5Ran, false, "Not yet 5!");
|
||||
|
||||
$("test6").appendChild(document.createTextNode(" "));
|
||||
|
||||
$("test7").appendChild(document.createTextNode(""));
|
||||
|
||||
$("test8").appendChild(document.createTextNode(""));
|
||||
|
||||
$("test9").appendChild(document.createTextNode(""));
|
||||
|
||||
$("test12").src = "data:text/javascript,test12Ran = true;";
|
||||
is(test12Ran, false, "Not yet 12!");
|
||||
|
||||
$("test13").setAttribute("src", "data:text/javascript,test13Ran = true;");
|
||||
is(test13Ran, false, "Not yet 13!");
|
||||
|
||||
$("test14").src = "data:text/javascript,test14aRan = true;";
|
||||
$("test14").appendChild(document.createTextNode("test14bRan = true"));
|
||||
is(test14aRan, false, "Not yet 14a!");
|
||||
is(test14bRan, false, "Not yet 14b!");
|
||||
|
||||
$("test15").src = "data:text/javascript,test15aRan = true;";
|
||||
$("test15").appendChild(document.createTextNode("test15bRan = true"));
|
||||
$("test15").removeAttribute("src");
|
||||
is(test15aRan, false, "Not yet 15a!");
|
||||
is(test15bRan, false, "Not yet 15b!");
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
// Follow up on some of those
|
||||
$("test6").appendChild(document.createTextNode("test6Ran = true"));
|
||||
is(test6Ran, false, "Not yet 6!");
|
||||
|
||||
$("test7").appendChild(document.createTextNode("test7Ran = true"));
|
||||
is(test7Ran, false, "Not yet 7!");
|
||||
|
||||
$("test8").insertBefore(document.createTextNode("test8Ran = true"),
|
||||
$("test8").firstChild);
|
||||
is(test8Ran, false, "Not yet 8!");
|
||||
|
||||
$("test9").firstChild.data = "test9Ran = true";
|
||||
is(test9Ran, false, "Not yet 9!");
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
is(test1Ran, true, "Should have run!");
|
||||
is(test2Ran, true, "Should execute empty script on child append");
|
||||
is(test3Ran, false, "Already executed test3 script once");
|
||||
is(test4Ran, false,
|
||||
"Shouldn't execute whitespace-only script on child append; should have executed it before");
|
||||
is(test5Ran, true,
|
||||
"By the time it tries to execute, it's got both textnodes");
|
||||
is(test6Ran, false,
|
||||
"Shouldn't execute whitespace-only script on child append 2; should have executed it when it became nonempty");
|
||||
is(test7Ran, true, "Should execute empty script on child append 2");
|
||||
is(test8Ran, true, "Should execute empty script on child insert");
|
||||
is(test9Ran, true, "Should execute empty script if child gets some text");
|
||||
is(test10Ran, false, "Has an src; inline part shouldn't run");
|
||||
is(test11Ran, true, "Script with src should have run");
|
||||
is(test12Ran, true, "Setting src should execute script");
|
||||
is(test13Ran, true, "Setting src attribute should execute script");
|
||||
is(test14aRan, true, "src attribute takes precedence over inline content");
|
||||
is(test14bRan, false, "src attribute takes precedence over inline content 2");
|
||||
is(test15aRan, true,
|
||||
"src attribute load should have started before the attribute got removed");
|
||||
is(test15bRan, false,
|
||||
"src attribute still got executed, so this shouldn't have been");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=300691
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 300691</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=300691">Mozilla Bug 300691</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="text/javascript">
|
||||
// First, setup. We'll be toggling these variables as we go.
|
||||
// Note that scripts don't execute immediately when you put text in them --
|
||||
// they wait for the currently-running script to finish.
|
||||
var test1Ran = false;
|
||||
var test2Ran = false;
|
||||
var test3Ran = false;
|
||||
</script>
|
||||
<script id="test1" type="text/javascript">test1Ran = true;</script>
|
||||
<script id="test2" type="text/javascript"></script>
|
||||
<script id="test3" type="text/javascript"></script>
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
/** Test for Bug 300691 **/
|
||||
$("test2").appendChild(document.createCDATASection("test2Ran = true"));
|
||||
is(test2Ran, false, "Not yet 2!");
|
||||
|
||||
$("test3").appendChild(document.createCDATASection(""));
|
||||
]]>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
// Follow up on some of those
|
||||
$("test3").firstChild.data = "test3Ran = true";
|
||||
is(test3Ran, false, "Not yet 3!");
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
is(test1Ran, true, "Should have run!");
|
||||
is(test2Ran, true, "Should execute empty script on child append");
|
||||
is(test3Ran, true, "Should execute empty script if child gets some text");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,423 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=302186
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 302186</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
span { color: red }
|
||||
:default + span { color: green }
|
||||
|
||||
|
||||
/* static default 5 */
|
||||
span.reverse5 { color: green }
|
||||
:default + span.reverse5 { color: red }
|
||||
|
||||
|
||||
/* dynamic default 6 */
|
||||
span.reverse6 { color: green }
|
||||
:default + span.reverse6 { color: red }
|
||||
|
||||
/* dynamic default 7 */
|
||||
span.reverse7 { color: green }
|
||||
:default + span.reverse7 { color: red }
|
||||
|
||||
/* dynamic default 8 */
|
||||
span.reverse8 { color: green }
|
||||
:default + span.reverse8 { color: red }
|
||||
|
||||
/* dynamic default 9 */
|
||||
span.reverse9 { color: green }
|
||||
:default + span.reverse9 { color: red }
|
||||
|
||||
/* dynamic default 10 */
|
||||
span.reverse10 { color: green }
|
||||
:default + span.reverse10 { color: red }
|
||||
|
||||
/* dynamic default 11 */
|
||||
span.reverse11 { color: green }
|
||||
:default + span.reverse11 { color: red }
|
||||
|
||||
/* dynamic default 12 */
|
||||
span.reverse12 { color: green }
|
||||
:default + span.reverse12 { color: red }
|
||||
|
||||
/* dynamic default 13 */
|
||||
span.reverse13 { color: green }
|
||||
:default + span.reverse13 { color: red }
|
||||
|
||||
/* dynamic default 14 */
|
||||
span.reverse14 { color: green }
|
||||
:default + span.reverse14 { color: red }
|
||||
|
||||
/* dynamic default 15 */
|
||||
span.reverse15 { color: green }
|
||||
:default + span.reverse15 { color: red }
|
||||
|
||||
/* dynamic default 16 */
|
||||
span.reverse16 { color: green }
|
||||
:default + span.reverse16 { color: red }
|
||||
|
||||
/* dynamic default 17 */
|
||||
span.reverse17 { color: green }
|
||||
:default + span.reverse17 { color: red }
|
||||
|
||||
/* dynamic default 18 */
|
||||
span.reverse18 { color: green }
|
||||
:default + span.reverse18 { color: red }
|
||||
|
||||
/* dynamic default 19 */
|
||||
span.reverse19 { color: green }
|
||||
:default + span.reverse19 { color: red }
|
||||
|
||||
/* dynamic default 20 */
|
||||
span.reverse20 { color: green }
|
||||
:default + span.reverse20 { color: red }
|
||||
|
||||
|
||||
button { display: none }
|
||||
input { display: none }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=302186">Mozilla Bug 302186</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: block">
|
||||
|
||||
<!-- static default 5 -->
|
||||
<form>
|
||||
<div>
|
||||
<input type="image"><span id="5a">There should be no red.</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="image"><span id="5b" class="reverse5">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 6 -->
|
||||
<form>
|
||||
<div id="div6">
|
||||
<span id="6a">There should be no red.</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit"><span id="6b" class="reverse6">There should be no red.</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 7 -->
|
||||
<form>
|
||||
<div>
|
||||
<input type="submit"><span id="7a">There should be no red.</span>
|
||||
</div>
|
||||
<div id="div7">
|
||||
<span class="reverse7" id="7b">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 8 -->
|
||||
<form>
|
||||
<div id="div8"><span id="8a">There should be no red.</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="image" id="foo"><span class="reverse8" id="8b">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 9 -->
|
||||
<form>
|
||||
<div>
|
||||
<input type="image"><span id="9a">There should be no red.</span>
|
||||
</div>
|
||||
<div id="div9">
|
||||
<span class="reverse9" id="9b">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 10 -->
|
||||
<form>
|
||||
<div id="div10">
|
||||
<input type="submit"><span id="10a" class="reverse10">There should be no red.</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit"><span id="10b" >There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 11 -->
|
||||
<form>
|
||||
<div id="div11a">
|
||||
<input type="submit"><span id="11a">There should be no red.</span>
|
||||
</div>
|
||||
<div id="div11">
|
||||
<input type="submit"><span id="11b" class="reverse11">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 12 -->
|
||||
<form>
|
||||
<div id="div12">
|
||||
<input type="image"><span id="12a" class="reverse12">There should be no red.</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="image"><span id="12b">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 13 -->
|
||||
<form>
|
||||
<div id="div13a">
|
||||
<input type="image"><span id="13a">There should be no red.</span>
|
||||
</div>
|
||||
<div id="div13">
|
||||
<input type="image"><span id="13b" class="reverse13">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 14 -->
|
||||
<form>
|
||||
<div id="div14a">
|
||||
<input type="submit" id="foo14"><span id="14a">There should be no red.</span>
|
||||
</div>
|
||||
<div id="div14b">
|
||||
<input type="submit" id="foo14b"><span id="14b" class="reverse14">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 15 -->
|
||||
<form>
|
||||
<div id="div15a">
|
||||
<input type="image" id="foo15a"><span id="15a">There should be no red.</span>
|
||||
</div>
|
||||
<div id="div15b">
|
||||
<input type="image" id="foo15b"><span id="15b" class="reverse15">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 16 -->
|
||||
<form>
|
||||
<div>
|
||||
<input type="image" checked="checked" id="foo16"></button>
|
||||
<span class="reverse16" id="16a">There should be no red.</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="image"></button><span id="16b">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 17 -->
|
||||
<form>
|
||||
<div>
|
||||
<button type="button" id="foo17"></button>
|
||||
<span id="17a">There should be no red.</span>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit"></button><span class="reverse17" id="17b">There should be no red.</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 18 -->
|
||||
<form>
|
||||
<div>
|
||||
<input type="button" id="foo18"></button>
|
||||
<span id="18a">There should be no red.</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit"></button><span id="18b" class="reverse18">There should be no red.</span>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<!-- dynamic default 19 -->
|
||||
<form>
|
||||
<div id="div19">
|
||||
<span id="19a">There should be no red.</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- dynamic default 20 -->
|
||||
<form>
|
||||
<div id="div20">
|
||||
<span id="20a">There should be no red.</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 302186 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function idColor(anId) {
|
||||
var color = Color.fromComputedStyle(anId, "color");
|
||||
return color.toRGBString();
|
||||
}
|
||||
|
||||
is(idColor("5a"),"rgb(0,128,0)", "CSS static-default 5a");
|
||||
is(idColor("5b"),"rgb(0,128,0)", "CSS static-default 5b");
|
||||
|
||||
function dynamicDefault6() {
|
||||
var but = document.createElement("input");
|
||||
but.setAttribute("type", "submit");
|
||||
$('div6').insertBefore(but, $('div6').firstChild);
|
||||
is(idColor("6a"),"rgb(0,128,0)", "CSS dynamic-default 6a");
|
||||
is(idColor("6b"),"rgb(0,128,0)", "CSS dynamic-default 6b");
|
||||
}
|
||||
|
||||
function dynamicDefault7() {
|
||||
var but = document.createElement("input");
|
||||
but.setAttribute("type", "submit");
|
||||
$('div7').insertBefore(but, $('div7').firstChild);
|
||||
is(idColor("7a"),"rgb(0,128,0)", "CSS dynamic-default 7a");
|
||||
is(idColor("7b"),"rgb(0,128,0)", "CSS dynamic-default 7b");
|
||||
}
|
||||
|
||||
function dynamicDefault8() {
|
||||
var but = document.createElement("input");
|
||||
but.setAttribute("type", "image");
|
||||
$('div8').insertBefore(but, $('div8').firstChild);
|
||||
is(idColor("8a"),"rgb(0,128,0)", "CSS dynamic-default 8a");
|
||||
is(idColor("8b"),"rgb(0,128,0)", "CSS dynamic-default 8b");
|
||||
}
|
||||
|
||||
function dynamicDefault9() {
|
||||
var but = document.createElement("input");
|
||||
but.setAttribute("type", "image");
|
||||
$('div9').insertBefore(but, $('div9').firstChild);
|
||||
is(idColor("9a"),"rgb(0,128,0)", "CSS dynamic-default 9a");
|
||||
is(idColor("9b"),"rgb(0,128,0)", "CSS dynamic-default 9b");
|
||||
}
|
||||
|
||||
function dynamicDefault10() {
|
||||
var inputs = $('div10').getElementsByTagName("input");
|
||||
$('div10').removeChild(inputs[0]);
|
||||
todo(idColor("10a") == "rgb(0,128,0)", "CSS dynamic-default 10a");
|
||||
is(idColor("10b"),"rgb(0,128,0)", "CSS dynamic-default 10b");
|
||||
}
|
||||
|
||||
function dynamicDefault11() {
|
||||
var inputs = $('div11').getElementsByTagName("input");
|
||||
$('div11').removeChild(inputs[0]);
|
||||
is(idColor("11a"),"rgb(0,128,0)", "CSS dynamic-default 11a");
|
||||
is(idColor("11b"),"rgb(0,128,0)", "CSS dynamic-default 11b");
|
||||
}
|
||||
|
||||
function dynamicDefault12() {
|
||||
var inputs = $('div12').getElementsByTagName("input");
|
||||
$('div12').removeChild(inputs[0]);
|
||||
todo(idColor("12a") == "rgb(0,128,0)", "CSS dynamic-default 12a");
|
||||
is(idColor("12b"),"rgb(0,128,0)", "CSS dynamic-default 12b");
|
||||
}
|
||||
|
||||
function dynamicDefault13() {
|
||||
var inputs = $('div13').getElementsByTagName("input");
|
||||
$('div13').removeChild(inputs[0]);
|
||||
is(idColor("13a"),"rgb(0,128,0)", "CSS dynamic-default 13a");
|
||||
is(idColor("13b"),"rgb(0,128,0)", "CSS dynamic-default 13b");
|
||||
}
|
||||
|
||||
function dynamicDefault14() {
|
||||
var div1 = document.getElementById("div14a");
|
||||
var inputs = div1.getElementsByTagName("input");
|
||||
var firstElement = div1.removeChild(inputs[0]);
|
||||
var div2 = document.getElementById("div14b");
|
||||
inputs = div2.getElementsByTagName("input");
|
||||
var secondElement = div2.removeChild(inputs[0]);
|
||||
div1.insertBefore(secondElement, div1.firstChild);
|
||||
div2.insertBefore(firstElement, div2.firstChild);
|
||||
is(idColor("14a"),"rgb(0,128,0)", "CSS dynamic-default 14a");
|
||||
is(idColor("14b"),"rgb(0,128,0)", "CSS dynamic-default 14b");
|
||||
}
|
||||
|
||||
function dynamicDefault15() {
|
||||
var div1 = document.getElementById("div15a");
|
||||
var inputs = div1.getElementsByTagName("input");
|
||||
var firstElement = div1.removeChild(inputs[0]);
|
||||
var div2 = document.getElementById("div15b");
|
||||
inputs = div2.getElementsByTagName("input");
|
||||
var secondElement = div2.removeChild(inputs[0]);
|
||||
div1.insertBefore(secondElement, div1.firstChild);
|
||||
div2.insertBefore(firstElement, div2.firstChild);
|
||||
is(idColor("15a"),"rgb(0,128,0)", "CSS dynamic-default 15a");
|
||||
is(idColor("15b"),"rgb(0,128,0)", "CSS dynamic-default 15b");
|
||||
}
|
||||
|
||||
function dynamicDefault16() {
|
||||
$("foo16").setAttribute("type", "button");
|
||||
is(idColor("16a"),"rgb(0,128,0)", "CSS dynamic-default 16a");
|
||||
is(idColor("16b"),"rgb(0,128,0)", "CSS dynamic-default 16b");
|
||||
}
|
||||
|
||||
function dynamicDefault17() {
|
||||
$("foo17").setAttribute("type", "submit");
|
||||
is(idColor("17a"),"rgb(0,128,0)", "CSS dynamic-default 17a");
|
||||
is(idColor("17b"),"rgb(0,128,0)", "CSS dynamic-default 17b");
|
||||
}
|
||||
|
||||
function dynamicDefault18() {
|
||||
$("foo18").setAttribute("type", "submit");
|
||||
is(idColor("18a"),"rgb(0,128,0)", "CSS dynamic-default 18a");
|
||||
is(idColor("18b"),"rgb(0,128,0)", "CSS dynamic-default 18b");
|
||||
}
|
||||
|
||||
function dynamicDefault19() {
|
||||
var newSubmit = document.createElement("input");
|
||||
newSubmit.setAttribute("type", "submit");
|
||||
var div1 = document.getElementById("div19");
|
||||
div1.insertBefore(newSubmit, div1.firstChild);
|
||||
is(idColor("19a"),"rgb(0,128,0)", "CSS dynamic-default 19a");
|
||||
}
|
||||
|
||||
function dynamicDefault20() {
|
||||
var newSubmit = document.createElement("input");
|
||||
newSubmit.setAttribute("type", "image");
|
||||
var div1 = document.getElementById("div20");
|
||||
div1.insertBefore(newSubmit, div1.firstChild);
|
||||
is(idColor("20a"),"rgb(0,128,0)", "CSS dynamic-default 20a");
|
||||
}
|
||||
|
||||
addLoadEvent(dynamicDefault6);
|
||||
addLoadEvent(dynamicDefault7);
|
||||
addLoadEvent(dynamicDefault8);
|
||||
addLoadEvent(dynamicDefault9);
|
||||
addLoadEvent(dynamicDefault10);
|
||||
addLoadEvent(dynamicDefault11);
|
||||
addLoadEvent(dynamicDefault12);
|
||||
addLoadEvent(dynamicDefault13);
|
||||
addLoadEvent(dynamicDefault14);
|
||||
addLoadEvent(dynamicDefault15);
|
||||
addLoadEvent(dynamicDefault16);
|
||||
addLoadEvent(dynamicDefault17);
|
||||
addLoadEvent(dynamicDefault18);
|
||||
addLoadEvent(dynamicDefault19);
|
||||
addLoadEvent(dynamicDefault20);
|
||||
|
||||
addLoadEvent(SimpleTest.finish);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=308484
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 308484</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=308484">Mozilla Bug 308484</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 308484 **/
|
||||
|
||||
var headers = ["Host", "Content-Length", "Transfer-Encoding", "Via", "Upgrade"];
|
||||
var i, request;
|
||||
|
||||
// Try setting headers in unprivileged context
|
||||
request = new XMLHttpRequest();
|
||||
request.open("GET", window.location.href);
|
||||
for (i = 0; i < headers.length; i++)
|
||||
request.setRequestHeader(headers[i], "test" + i);
|
||||
|
||||
// Read out headers
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
|
||||
var channel = request.channel.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
for (i = 0; i < headers.length; i++) {
|
||||
// Retrieving Content-Length will throw an exception
|
||||
var value = null;
|
||||
try {
|
||||
value = channel.getRequestHeader(headers[i]);
|
||||
}
|
||||
catch(e) {}
|
||||
|
||||
isnot(value, "test" + i, "Setting " + headers[i] + " header in unprivileged context");
|
||||
}
|
||||
|
||||
// Try setting headers in privileged context
|
||||
request = new XMLHttpRequest();
|
||||
request.open("GET", window.location.href);
|
||||
for (i = 0; i < headers.length; i++)
|
||||
request.setRequestHeader(headers[i], "test" + i);
|
||||
|
||||
// Read out headers
|
||||
var channel = request.channel.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
for (i = 0; i < headers.length; i++) {
|
||||
var value = channel.getRequestHeader(headers[i]);
|
||||
is(value, "test" + i, "Setting " + headers[i] + " header in privileged context");
|
||||
}
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=308856
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 308856</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=308856">Mozilla Bug 308856</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 308856 **/
|
||||
|
||||
var monkey = 12;
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
is(12,window.monkey,"Window global is correct value");
|
||||
var found = false;
|
||||
for (var p in window) {
|
||||
if (p == "monkey") {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
ok(found, "Global js variables show up when enumerating [Window]");
|
||||
});
|
||||
addLoadEvent(SimpleTest.finish);
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=311681
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 311681</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=311681">Mozilla Bug 311681</a>
|
||||
<script class="testbody" type="text/javascript">
|
||||
// Setup script
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// Make sure to trigger the hashtable case by asking for enough elements
|
||||
// by ID.
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
var x = document.getElementById(i);
|
||||
}
|
||||
|
||||
// save off the document.getElementById function, since getting it as a
|
||||
// property off the document it causes a content flush.
|
||||
var fun = document.getElementById;
|
||||
|
||||
// Slot for our initial element with id "content"
|
||||
var testNode;
|
||||
|
||||
function getCont() {
|
||||
return fun.call(document, "content");
|
||||
}
|
||||
|
||||
function testClone() {
|
||||
// Test to make sure that if we have multiple nodes with the same ID in
|
||||
// a document we don't forget about one of them when the other is
|
||||
// removed.
|
||||
var newParent = $("display");
|
||||
var node = testNode.cloneNode(true);
|
||||
isnot(node, testNode, "Clone should be a different node");
|
||||
|
||||
newParent.appendChild(node);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), testNode, "Should be getting orig node pre-flush 1");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), testNode, "Should be getting orig node post-flush 1");
|
||||
|
||||
clear(newParent);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), testNode, "Should be getting orig node pre-flush 2");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), testNode, "Should be getting orig node post-flush 2");
|
||||
|
||||
node = testNode.cloneNode(true);
|
||||
newParent.appendChild(node);
|
||||
testNode.parentNode.removeChild(testNode);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), node, "Should be getting clone pre-flush");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), node, "Should be getting clone post-flush");
|
||||
|
||||
}
|
||||
|
||||
function clear(node) {
|
||||
while (node.hasChildNodes()) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
addLoadEvent(testClone);
|
||||
addLoadEvent(SimpleTest.finish);
|
||||
</script>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<script class="testbody" type="text/javascript">
|
||||
testNode = fun.call(document, "content");
|
||||
isnot(testNode, null, "Should have node here");
|
||||
</script>
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=311681
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 311681</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=311681">Mozilla Bug 311681</a>
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
// Setup script
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// Make sure to trigger the hashtable case by asking for enough elements
|
||||
// by ID.
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
var x = document.getElementById(i);
|
||||
}
|
||||
|
||||
// save off the document.getElementById function, since getting it as a
|
||||
// property off the document it causes a content flush.
|
||||
var fun = document.getElementById;
|
||||
|
||||
// Slot for our initial element with id "content"
|
||||
var testNode;
|
||||
|
||||
function getCont() {
|
||||
return fun.call(document, "content");
|
||||
}
|
||||
|
||||
function testClone() {
|
||||
// Test to make sure that if we have multiple nodes with the same ID in
|
||||
// a document we don't forget about one of them when the other is
|
||||
// removed.
|
||||
var newParent = $("display");
|
||||
var node = testNode.cloneNode(true);
|
||||
isnot(node, testNode, "Clone should be a different node");
|
||||
|
||||
newParent.appendChild(node);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), testNode, "Should be getting orig node pre-flush 1");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), testNode, "Should be getting orig node post-flush 1");
|
||||
|
||||
clear(newParent);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), testNode, "Should be getting orig node pre-flush 2");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), testNode, "Should be getting orig node post-flush 2");
|
||||
|
||||
node = testNode.cloneNode(true);
|
||||
newParent.appendChild(node);
|
||||
testNode.parentNode.removeChild(testNode);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), node, "Should be getting clone pre-flush");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), node, "Should be getting clone post-flush");
|
||||
|
||||
}
|
||||
|
||||
function clear(node) {
|
||||
while (node.hasChildNodes()) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
// Actually run the test once the XML parser works incrementally
|
||||
// addLoadEvent(testClone);
|
||||
addLoadEvent(SimpleTest.finish);
|
||||
]]>
|
||||
</script>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
testNode = fun.call(document, "content");
|
||||
// Needs incremental XML parser
|
||||
todo(testNode != null, "Should have node here");
|
||||
]]>
|
||||
</script>
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=311681
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 311681</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=311681">Mozilla Bug 311681</a>
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
// Setup script
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// Make sure to trigger the hashtable case by asking for enough elements
|
||||
// by ID.
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
var x = document.getElementById(i);
|
||||
}
|
||||
|
||||
// save off the document.getElementById function, since getting it as a
|
||||
// property off the document it causes a content flush.
|
||||
var fun = document.getElementById;
|
||||
|
||||
// Slot for our initial element with id "content"
|
||||
var testNode;
|
||||
|
||||
function getCont() {
|
||||
return fun.call(document, "content");
|
||||
}
|
||||
|
||||
function testClone() {
|
||||
// Test to make sure that if we have multiple nodes with the same ID in
|
||||
// a document we don't forget about one of them when the other is
|
||||
// removed.
|
||||
var newParent = $("display");
|
||||
var node = testNode.cloneNode(true);
|
||||
isnot(node, testNode, "Clone should be a different node");
|
||||
|
||||
newParent.appendChild(node);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
todo(getCont() == testNode, "Should be getting orig node pre-flush 1");
|
||||
is(getCont(), node, "XML does it differently, for now");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
todo(getCont() == testNode, "Should be getting orig node post-flush 1");
|
||||
is(getCont(), node, "XML does it differently, for now");
|
||||
|
||||
clear(newParent);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), testNode, "Should be getting orig node pre-flush 2");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), testNode, "Should be getting orig node post-flush 2");
|
||||
|
||||
node = testNode.cloneNode(true);
|
||||
newParent.appendChild(node);
|
||||
testNode.parentNode.removeChild(testNode);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), node, "Should be getting clone pre-flush");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), node, "Should be getting clone post-flush");
|
||||
|
||||
}
|
||||
|
||||
function clear(node) {
|
||||
while (node.hasChildNodes()) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
addLoadEvent(testClone);
|
||||
addLoadEvent(SimpleTest.finish);
|
||||
]]>
|
||||
</script>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
testNode = fun.call(document, "content");
|
||||
// Needs incremental XML parser
|
||||
isnot(testNode, null, "Should have node here");
|
||||
]]>
|
||||
</script>
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=311681
|
||||
-->
|
||||
<window title="Mozilla Bug 311681"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<title>Test for Bug 311681</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=311681">Mozilla Bug 311681</a>
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
// Setup script
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// Make sure to trigger the hashtable case by asking for enough elements
|
||||
// by ID.
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
var x = document.getElementById(i);
|
||||
}
|
||||
|
||||
// save off the document.getElementById function, since getting it as a
|
||||
// property off the document it causes a content flush.
|
||||
var fun = document.getElementById;
|
||||
|
||||
// Slot for our initial element with id "content"
|
||||
var testNode;
|
||||
|
||||
function getCont() {
|
||||
return fun.call(document, "content");
|
||||
}
|
||||
|
||||
function testClone() {
|
||||
// Test to make sure that if we have multiple nodes with the same ID in
|
||||
// a document we don't forget about one of them when the other is
|
||||
// removed.
|
||||
var newParent = $("display");
|
||||
var node = testNode.cloneNode(true);
|
||||
isnot(node, testNode, "Clone should be a different node");
|
||||
|
||||
newParent.appendChild(node);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), testNode, "Should be getting orig node pre-flush 1");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), testNode, "Should be getting orig node post-flush 1");
|
||||
|
||||
clear(newParent);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), testNode, "Should be getting orig node pre-flush 2");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), testNode, "Should be getting orig node post-flush 2");
|
||||
|
||||
node = testNode.cloneNode(true);
|
||||
newParent.appendChild(node);
|
||||
testNode.parentNode.removeChild(testNode);
|
||||
|
||||
// Check what getElementById returns, no flushing
|
||||
is(getCont(), node, "Should be getting clone pre-flush");
|
||||
|
||||
// Trigger a layout flush, just in case.
|
||||
var itemHeight = newParent.offsetHeight/10;
|
||||
|
||||
// Check what getElementById returns now.
|
||||
is(getCont(), node, "Should be getting clone post-flush");
|
||||
|
||||
}
|
||||
|
||||
function clear(node) {
|
||||
while (node.hasChildNodes()) {
|
||||
node.removeChild(node.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
addLoadEvent(testClone);
|
||||
addLoadEvent(SimpleTest.finish);
|
||||
]]>
|
||||
</script>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
testNode = fun.call(document, "content");
|
||||
// Needs incremental XML parser
|
||||
isnot(testNode, null, "Should have node here");
|
||||
]]>
|
||||
</script>
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
</window>
|
|
@ -1,90 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=319381
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 319381</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=319381">Mozilla Bug 319381</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<div id="t"></div>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 319381 **/
|
||||
|
||||
function c() {
|
||||
return document.defaultView.getComputedStyle($('t'), "").
|
||||
getPropertyValue("overflow");
|
||||
}
|
||||
|
||||
function cval() {
|
||||
return document.defaultView.getComputedStyle($('t'), "").
|
||||
getPropertyCSSValue("overflow");
|
||||
}
|
||||
|
||||
var vals = ["visible", "hidden", "auto", "scroll"];
|
||||
var mozVals = ["-moz-scrollbars-vertical", "-moz-scrollbars-horizontal"];
|
||||
var i, j;
|
||||
|
||||
for (i = 0; i < vals.length; ++i) {
|
||||
$('t').style.overflow = vals[i];
|
||||
is($('t').style.overflow, vals[i], "Roundtrip");
|
||||
is(c(), vals[i], "Simple property set");
|
||||
isnot(cval(), null, "Simple property as CSSValue");
|
||||
}
|
||||
|
||||
$('t').style.overflow = mozVals[0];
|
||||
is($('t').style.getPropertyValue("overflow-y"), "scroll", "Roundtrip");
|
||||
is($('t').style.getPropertyValue("overflow-x"), "hidden", "Roundtrip");
|
||||
is($('t').style.overflow, "", "Shorthand read directly");
|
||||
is(c(), "", "Shorthand computed");
|
||||
is(cval(), null, "Shorthand as CSSValue");
|
||||
|
||||
$('t').style.overflow = mozVals[1];
|
||||
is($('t').style.getPropertyValue("overflow-x"), "scroll", "Roundtrip");
|
||||
is($('t').style.getPropertyValue("overflow-y"), "hidden", "Roundtrip");
|
||||
is($('t').style.overflow, "", "Shorthand read directly");
|
||||
is(c(), "", "Shorthand computed");
|
||||
is(cval(), null, "Shorthand as CSSValue");
|
||||
|
||||
for (i = 0; i < vals.length; ++i) {
|
||||
for (j = 0; j < vals.length; ++j) {
|
||||
$('t').setAttribute("style",
|
||||
"overflow-x: " + vals[i] + "; overflow-y: " + vals[j]);
|
||||
is($('t').style.getPropertyValue("overflow-x"), vals[i], "Roundtrip");
|
||||
is($('t').style.getPropertyValue("overflow-y"), vals[j], "Roundtrip");
|
||||
|
||||
if (i == j) {
|
||||
is($('t').style.overflow, vals[i], "Shorthand serialization");
|
||||
} else {
|
||||
is($('t').style.overflow, "", "Shorthand serialization");
|
||||
}
|
||||
|
||||
// "visible" overflow-x and overflow-y become "auto" in computed style if
|
||||
// the other direction is not also "visible".
|
||||
if (i == j || (vals[i] == "visible" && vals[j] == "auto")) {
|
||||
is(c(), vals[j], "Shorthand computation");
|
||||
isnot(cval(), null, "Shorthand computation as CSSValue");
|
||||
} else if (vals[j] == "visible" && vals[i] == "auto") {
|
||||
is(c(), vals[i], "Shorthand computation");
|
||||
isnot(cval(), null, "Shorthand computation as CSSValue");
|
||||
} else {
|
||||
is(c(), "", "Shorthand computation");
|
||||
is(cval(), null, "Shorthand computation as CSSValue");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=332848
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 332848</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=332848">Mozilla Bug 332848</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
|
||||
/** Test for Bug 332848 **/
|
||||
|
||||
// parseChecker will become true if we keep parsing after calling close().
|
||||
var parseChecker = false;
|
||||
|
||||
function test() {
|
||||
try {
|
||||
document.open();
|
||||
is(0, 1, "document.open succeeded");
|
||||
} catch (e) {
|
||||
is (e.code, DOMException.NOT_SUPPORTED_ERR,
|
||||
"Wrong exception from document.open");
|
||||
}
|
||||
|
||||
try {
|
||||
document.write("aaa");
|
||||
is(0, 1, "document.write succeeded");
|
||||
} catch (e) {
|
||||
is (e.code, DOMException.NOT_SUPPORTED_ERR,
|
||||
"Wrong exception from document.write");
|
||||
}
|
||||
|
||||
try {
|
||||
document.close();
|
||||
is(0, 1, "document.close succeeded");
|
||||
} catch (e) {
|
||||
is (e.code, DOMException.NOT_SUPPORTED_ERR,
|
||||
"Wrong exception from document.close");
|
||||
}
|
||||
}
|
||||
|
||||
function loadTest() {
|
||||
is(parseChecker, true, "Parsing stopped");
|
||||
test();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
window.onload = loadTest;
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
test();
|
||||
]]>
|
||||
</script>
|
||||
<script>
|
||||
parseChecker = true;
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=333983
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 333983</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=333983">Mozilla Bug 333983</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 333983 **/
|
||||
HTMLElement.prototype.foopy = function () { return "foopy"; }
|
||||
|
||||
var foopy = "";
|
||||
try {
|
||||
foopy = document.body.foopy()
|
||||
} catch (ex) {
|
||||
foopy = ex + "";
|
||||
}
|
||||
|
||||
is(foopy, "foopy", "HTMLElement.prototype functions work");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=3348
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 3348</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=3348">Mozilla Bug 3348</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
<form id="form1">
|
||||
<input type="button" value="click here" onclick="buttonClick();">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 3348 **/
|
||||
|
||||
var oForm = document.getElementById("form1");
|
||||
is(oForm.tagName, "FORM", "tagName of HTML element gives tag in upper case");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<html><head>
|
||||
<title>Test for Bug 337124</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=337124">Mozilla Bug 337124</a>
|
||||
|
||||
<span style="display: table-row-group;">
|
||||
<input type="text">
|
||||
</span>
|
||||
<div style="display: table-column-group;">
|
||||
<script>document.body.offsetHeight;</script>
|
||||
</div><span style="display: table-row-group;">
|
||||
<input id="i1" type="text">
|
||||
</span><fieldset id="f1" style="display: table-column-group;">
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
var passed = false;
|
||||
if ( document.getElementById("f1").offsetTop > document.getElementById("i1").offsetTop) {
|
||||
passed = true;
|
||||
}
|
||||
|
||||
ok(passed, "right layout order");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,100 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=337631
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 337631</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=337631">Mozilla Bug 337631</a>
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
|
||||
<a href="foo" id="test4">foo</a>
|
||||
<input id="test1" value="test">
|
||||
<p id="test2">adsf<a href="#" id="test3">asdf</a><input id="test5"></p>
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 337631 **/
|
||||
|
||||
function getActiveElement()
|
||||
{
|
||||
var rv;
|
||||
|
||||
var el = document.activeElement;
|
||||
if (!el) {
|
||||
rv = "none";
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (el && el != document.documentElement) {
|
||||
var nt;
|
||||
try {
|
||||
nt = el.nodeType;
|
||||
} catch (e) {
|
||||
rv = "[no permission]";
|
||||
return rv;
|
||||
}
|
||||
if (!nt) {
|
||||
rv = "[unknown]";
|
||||
} else if (nt == 1) {
|
||||
rv = el.tagName;
|
||||
} else if (nt == 3) {
|
||||
rv = "textnode"
|
||||
} else {
|
||||
rv = nt;
|
||||
}
|
||||
|
||||
el = el.parentNode;
|
||||
while (el && el != document.documentElement) {
|
||||
rv += " in ";
|
||||
try {
|
||||
nt = el.nodeType;
|
||||
} catch (e) {
|
||||
rv += "[no permission]";
|
||||
return rv;
|
||||
}
|
||||
if (!nt) {
|
||||
rv += "[unknown]";
|
||||
} else if (nt == 1) {
|
||||
rv += el.tagName;
|
||||
} else if (nt == 3) {
|
||||
rv += "textnode"
|
||||
} else {
|
||||
rv += nt;
|
||||
}
|
||||
|
||||
el = el.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
$('test1').focus();
|
||||
is(getActiveElement(), "INPUT in DIV in BODY", "getActiveElement tests");
|
||||
|
||||
$('test2').focus();
|
||||
is(getActiveElement(), "INPUT in DIV in BODY", "getActiveElement tests");
|
||||
|
||||
$('test3').focus();
|
||||
is(getActiveElement(), "A in P in DIV in BODY", "getActiveElement tests");
|
||||
|
||||
$('test4').focus();
|
||||
is(getActiveElement(), "A in DIV in BODY", "getActiveElement tests");
|
||||
|
||||
$('test5').focus();
|
||||
is(getActiveElement(), "INPUT in P in DIV in BODY", "getActiveElement tests");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=338541
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 338541</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=338541">Mozilla Bug 338541</a>
|
||||
<p id="display"></p>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 338541 **/
|
||||
function getName(aNode, f)
|
||||
{
|
||||
return (aNode ? aNode.nodeName : "(null)");
|
||||
}
|
||||
|
||||
function walkDOM()
|
||||
{
|
||||
var walker = document.createTreeWalker($('content'), Components.interfaces.nsIDOMNodeFilter.SHOW_ELEMENT, null, true);
|
||||
var output = "";
|
||||
while (walker.nextNode())
|
||||
{
|
||||
output += getName(walker.currentNode) + "\n";
|
||||
}
|
||||
output += "Final currentNode: " + getName(walker.currentNode);
|
||||
is(output, "foo\nbar\nhtml:b\nqux\nbaz\nFinal currentNode: baz","treewalker returns correct nodeName");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(walkDOM, ok);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
<div id="content" style="display: none">
|
||||
<foo xmlns="http://example.com">
|
||||
<bar><html:b xmlns:html="http://www.w3.org/1999/xhtml"><qux/></html:b>
|
||||
<baz/>
|
||||
</bar>
|
||||
</foo>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=338679
|
||||
-->
|
||||
<head>
|
||||
<title>Testcase bug 338679</title>
|
||||
<script type="text/javascript" src="../MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=338679">Mozilla Bug 338679</a>
|
||||
<div >
|
||||
<dl>
|
||||
<dt>Actual result:</dt>
|
||||
<dd>
|
||||
<pre id="out" style="width: 20em">
|
||||
</pre>
|
||||
</dd>
|
||||
|
||||
<dt>Expected result:</dt>
|
||||
|
||||
<dd>
|
||||
<pre>
|
||||
Previous: width: 20em;
|
||||
New: width: auto;
|
||||
</pre>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script>
|
||||
|
||||
/* This is our event handler function */
|
||||
function attr_modified(ev) {
|
||||
$("out").textContent = "Previous:\t" + ev.prevValue + "\nNew:\t\t" + ev.newValue;
|
||||
is(ev.newValue, "width: auto;", "DOMAttrModified event reports correct newValue");
|
||||
todo(ev.prevValue == "width: 20em;", "DOMAttrModified event reports correct prevValue");
|
||||
SimpleTest.finish(); // trigger the end of our test sequence
|
||||
}
|
||||
|
||||
/* Call this to tell SimpleTest to wait for SimpleTest.finish() */
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
$("out").addEventListener("DOMAttrModified", attr_modified, false);
|
||||
$("out").style.width = "auto";
|
||||
|
||||
/* End of script, but SimpleTest will keep listening because
|
||||
we called waitForExplicitFinish() */
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,61 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
Tests by Sam Ruby - WTFPL License (http://sam.zoy.org/wtfpl/)
|
||||
|
||||
http://www.intertwingly.net/blog/2006/10/03/Firefox-XHTML-innerHTML-quirk#comments
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=339350
|
||||
-->
|
||||
<head>
|
||||
<!-- XHTML needs the packed version -->
|
||||
<script type="text/javascript" src="../MochiKit/packed.js"/>
|
||||
<script type="text/javascript" src="SimpleTest/SimpleTest.js"/>
|
||||
<link rel="stylesheet" type="text/css" href="SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339350">Mozilla Bug 339350</a>
|
||||
<div style="display: none">
|
||||
<table border="1" cellspacing="0">
|
||||
<thead>
|
||||
<th></th>
|
||||
<th>plain</th>
|
||||
<th>brackets</th>
|
||||
<th>braces</th>
|
||||
</thead>
|
||||
|
||||
<tr>
|
||||
<th>innerHTML</th>
|
||||
<td><div id="i1"/></td>
|
||||
<td style="background:yellow"><div id="i2"/></td>
|
||||
<td><div id="i3"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>textNode</th>
|
||||
<td><div id="t1"/></td>
|
||||
<td><div id="t2"/></td>
|
||||
<td><div id="t3"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="text/javascript">
|
||||
var text1 = 'foo bar';
|
||||
var text2 = 'foo [bar]';
|
||||
var text3 = 'foo {bar}';
|
||||
|
||||
<!-- This is the long way to write this stuff,
|
||||
you can use MochiKit functions too -->
|
||||
document.getElementById('i1').innerHTML = text1;
|
||||
document.getElementById('i2').innerHTML = text2;
|
||||
document.getElementById('i3').innerHTML = text3;
|
||||
|
||||
document.getElementById('t1').appendChild(document.createTextNode(text1));
|
||||
document.getElementById('t2').appendChild(document.createTextNode(text2));
|
||||
document.getElementById('t3').appendChild(document.createTextNode(text3));
|
||||
|
||||
<!-- The is() function is one way to add a test -->
|
||||
is(document.getElementById('i2').innerHTML, text2, "XHTML innerHTML with trailing brackets ']]'");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,62 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=339494
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 339494</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=339494">Mozilla Bug 339494</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<div id="d"></div>
|
||||
<div id="s"></div>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 339494 **/
|
||||
|
||||
var d = document.getElementById("d");
|
||||
|
||||
d.setAttribute("hhh", "testvalue");
|
||||
|
||||
document.addEventListener("DOMAttrModified", removeItAgain, false);
|
||||
d.removeAttribute("hhh");
|
||||
document.removeEventListener("DOMAttrModified", removeItAgain, false);
|
||||
|
||||
function removeItAgain()
|
||||
{
|
||||
ok(!d.hasAttribute("hhh"), "Value check 1",
|
||||
"There should be no value");
|
||||
isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
|
||||
document.removeEventListener("DOMAttrModified", removeItAgain, false);
|
||||
d.removeAttribute("hhh");
|
||||
ok(true, "Reachability", "We shouldn't have crashed");
|
||||
}
|
||||
|
||||
var s = document.getElementById("s");
|
||||
|
||||
s.setAttribute("ggg", "testvalue");
|
||||
|
||||
document.addEventListener("DOMAttrModified", compareVal, false);
|
||||
s.setAttribute("ggg", "othervalue");
|
||||
document.removeEventListener("DOMAttrModified", compareVal, false);
|
||||
|
||||
function compareVal()
|
||||
{
|
||||
ok(s.hasAttribute("ggg"), "Value check 3",
|
||||
"There should be a value");
|
||||
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
|
||||
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=339494
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 339494</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=339494">Mozilla Bug 339494</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<div id="d" />
|
||||
<div id="s" />
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 339494 **/
|
||||
|
||||
var d = document.getElementById("d");
|
||||
|
||||
d.setAttribute("hhh", "testvalue");
|
||||
|
||||
document.addEventListener("DOMAttrModified", removeItAgain, false);
|
||||
d.removeAttribute("hhh");
|
||||
document.removeEventListener("DOMAttrModified", removeItAgain, false);
|
||||
|
||||
function removeItAgain()
|
||||
{
|
||||
ok(!d.hasAttribute("hhh"), "Value check 1",
|
||||
"There should be no value");
|
||||
isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
|
||||
document.removeEventListener("DOMAttrModified", removeItAgain, false);
|
||||
d.removeAttribute("hhh");
|
||||
ok(true, "Reachability", "We shouldn't have crashed");
|
||||
}
|
||||
|
||||
var s = document.getElementById("s");
|
||||
|
||||
s.setAttribute("ggg", "testvalue");
|
||||
|
||||
document.addEventListener("DOMAttrModified", compareVal, false);
|
||||
s.setAttribute("ggg", "othervalue");
|
||||
document.removeEventListener("DOMAttrModified", compareVal, false);
|
||||
|
||||
function compareVal()
|
||||
{
|
||||
ok(s.hasAttribute("ggg"), "Value check 3",
|
||||
"There should be a value");
|
||||
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
|
||||
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=339494
|
||||
-->
|
||||
<window title="Mozilla Bug 339494"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<title>Test for Bug 339494</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<xul:hbox id="d"/>
|
||||
<xul:hbox id="s"/>
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<script class="testbody" type="application/javascript">
|
||||
|
||||
/** Test for Bug 339494 **/
|
||||
|
||||
var d = document.getElementById("d");
|
||||
|
||||
d.setAttribute("hhh", "testvalue");
|
||||
|
||||
document.addEventListener("DOMAttrModified", removeItAgain, false);
|
||||
d.removeAttribute("hhh");
|
||||
document.removeEventListener("DOMAttrModified", removeItAgain, false);
|
||||
|
||||
function removeItAgain()
|
||||
{
|
||||
ok(!d.hasAttribute("hhh"), "Value check 1",
|
||||
"There should be no value");
|
||||
isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
|
||||
document.removeEventListener("DOMAttrModified", removeItAgain, false);
|
||||
d.removeAttribute("hhh");
|
||||
ok(true, "Reachability", "We shouldn't have crashed");
|
||||
}
|
||||
|
||||
var s = document.getElementById("s");
|
||||
|
||||
s.setAttribute("ggg", "testvalue");
|
||||
|
||||
document.addEventListener("DOMAttrModified", compareVal, false);
|
||||
s.setAttribute("ggg", "othervalue");
|
||||
document.removeEventListener("DOMAttrModified", compareVal, false);
|
||||
|
||||
function compareVal()
|
||||
{
|
||||
ok(s.hasAttribute("ggg"), "Value check 3",
|
||||
"There should be a value");
|
||||
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
|
||||
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</window>
|
|
@ -1,56 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=340800
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 340800</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=340800">Mozilla Bug 340800</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<h1>iframe text/plain as DOM test</h1>
|
||||
|
||||
<div>
|
||||
|
||||
<iframe name="iframe1" width="100%" height="200"
|
||||
src="/static/bug340800_iframe.txt"></iframe>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>textarea with iframe content</h2>
|
||||
<textarea rows="10" cols="80" id="textarea1"></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>div with white-space: pre and iframe content</h2>
|
||||
<div id="div1"></div>
|
||||
</div>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 340800 **/
|
||||
function populateIframes () {
|
||||
var iframe, iframeBody;
|
||||
if ((iframe = window.frames.iframe1) && (iframeBody = iframe.document.body)) {
|
||||
$('div1').innerHTML = iframeBody.innerHTML;
|
||||
$('textarea1').value = iframeBody.innerHTML;
|
||||
}
|
||||
is($('div1').firstChild.tagName, "PRE", "innerHTML from txt iframe works with div");
|
||||
ok($('textarea1').value.indexOf("<pre>") > -1, "innerHTML from txt iframe works with textarea.value");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
addLoadEvent(populateIframes);
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=342448
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 342448</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=342448">Mozilla Bug 342448</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 342448 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
try {
|
||||
setTimeout(1, 0);
|
||||
} catch (ex) {}
|
||||
callLater(.1, function() { ok(true, "crash when passing a number as the first arg to setTimeout"); SimpleTest.finish(); })
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=343596
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 343596</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=343596">Mozilla Bug 343596</a>
|
||||
<p id="display"></p>
|
||||
<script id="foo"></script>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 343596 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
try{
|
||||
// Insert text into an empty script node that will cause a syntax error.
|
||||
document.getElementById("foo").appendChild(document.createTextNode("("));
|
||||
}
|
||||
catch(ex){
|
||||
// Note that this catch block does not execute.
|
||||
ok(false, "this catch block should not execute");
|
||||
}
|
||||
|
||||
setTimeout(function(){ok(true,"setTimeout still executes after bogus script insertion"); SimpleTest.finish();}, 200);
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=344830
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 344830</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.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=344830">Mozilla Bug 344830</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: block">
|
||||
<embed name="svg1"
|
||||
width="200" height="200"
|
||||
type="image/svg+xml"
|
||||
src="/static/bug344830_testembed.svg">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 344830 **/
|
||||
function getSVG() {
|
||||
var embed = document.embeds["svg1"];
|
||||
var svgDocument = embed.getSVGDocument();
|
||||
var element = svgDocument.getElementById("g1");
|
||||
ok(embed, "document.embeds[] works with SVG");
|
||||
ok(svgDocument, "document.embeds[] works with SVG and embed.getSVGDocument()");
|
||||
ok(element, "document.embeds[] works with SVG and svgDocument.getElementById()");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
addLoadEvent(getSVG);
|
||||
SimpleTest.waitForExplicitFinish()
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче