merge mozilla-central to b2g-inbound

This commit is contained in:
Carsten "Tomcat" Book 2013-08-08 14:46:05 +02:00
commit 7ea1382e12
464 changed files with 3712 additions and 3783 deletions

View File

@ -14,7 +14,6 @@
#include "States.h"
#include "nsGUIEvent.h"
#include "nsILink.h"
#include "nsINameSpaceManager.h"
#include "nsIURI.h"

View File

@ -15,7 +15,6 @@
#include "nsGenericHTMLElement.h"
#include "nsIDocument.h"
#include "nsIImageLoadingContent.h"
#include "nsILink.h"
#include "nsIPresShell.h"
#include "nsIServiceManager.h"
#include "nsIDOMHTMLImageElement.h"

View File

@ -624,6 +624,9 @@ pref("network.protocol-handler.expose.news", false);
pref("network.protocol-handler.expose.snews", false);
pref("network.protocol-handler.expose.nntp", false);
// Warning for about:networking page
pref("network.warnOnAboutNetworking", true);
pref("accessibility.typeaheadfind", false);
pref("accessibility.typeaheadfind.timeout", 5000);
pref("accessibility.typeaheadfind.linksonly", false);

View File

@ -9,7 +9,7 @@ searchbar {
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar");
}
browser[remote="true"] {
.browserStack > browser[remote="true"] {
-moz-binding: url("chrome://global/content/bindings/remote-browser.xml#remote-browser");
}

View File

@ -38,7 +38,11 @@ addMessageListener("Browser:HideSessionRestoreButton", function (message) {
}
});
if (!Services.prefs.getBoolPref("browser.tabs.remote")) {
if (Services.prefs.getBoolPref("browser.tabs.remote")) {
addEventListener("contextmenu", function (event) {
sendAsyncMessage("contextmenu", {}, { event: event });
}, false);
} else {
addEventListener("DOMContentLoaded", function(event) {
LoginManagerContent.onContentLoaded(event);
});

View File

@ -4,6 +4,8 @@
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
var gContextMenuContentData = null;
function nsContextMenu(aXulMenu, aIsShift) {
this.shouldDisplay = true;
this.initMenu(aXulMenu, aIsShift);
@ -39,6 +41,7 @@ nsContextMenu.prototype = {
},
hiding: function CM_hiding() {
gContextMenuContentData = null;
InlineSpellCheckerUI.clearSuggestionsFromMenu();
InlineSpellCheckerUI.clearDictionaryListFromMenu();
InlineSpellCheckerUI.uninit();
@ -500,6 +503,15 @@ nsContextMenu.prototype = {
// Set various context menu attributes based on the state of the world.
setTarget: function (aNode, aRangeParent, aRangeOffset) {
// If gContextMenuContentData is not null, this event was forwarded from a
// child process, so use that information instead.
if (gContextMenuContentData) {
this.isRemote = true;
aNode = gContextMenuContentData.event.target;
} else {
this.isRemote = false;
}
const xulNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
if (aNode.namespaceURI == xulNS ||
aNode.nodeType == Node.DOCUMENT_NODE ||
@ -539,11 +551,17 @@ nsContextMenu.prototype = {
// Remember the node that was clicked.
this.target = aNode;
this.browser = this.target.ownerDocument.defaultView
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
// If this is a remote context menu event, use the information from
// gContextMenuContentData instead.
if (this.isRemote) {
this.browser = gContextMenuContentData.browser;
} else {
this.browser = this.target.ownerDocument.defaultView
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell)
.chromeEventHandler;
}
this.onSocial = !!this.browser.getAttribute("origin");
// Check if we are in a synthetic document (stand alone image, video, etc.).
@ -772,10 +790,22 @@ nsContextMenu.prototype = {
this.linkProtocol == "snews" );
},
_unremotePrincipal: function(aRemotePrincipal) {
if (this.isRemote) {
return Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager)
.getAppCodebasePrincipal(aRemotePrincipal.URI,
aRemotePrincipal.appId,
aRemotePrincipal.isInBrowserElement);
}
return aRemotePrincipal;
},
// Open linked-to URL in a new window.
openLink : function () {
var doc = this.target.ownerDocument;
urlSecurityCheck(this.linkURL, doc.nodePrincipal);
urlSecurityCheck(this.linkURL, this._unremotePrincipal(doc.nodePrincipal));
openLinkIn(this.linkURL, "window",
{ charset: doc.characterSet,
referrerURI: doc.documentURIObject });
@ -784,7 +814,7 @@ nsContextMenu.prototype = {
// Open linked-to URL in a new private window.
openLinkInPrivateWindow : function () {
var doc = this.target.ownerDocument;
urlSecurityCheck(this.linkURL, doc.nodePrincipal);
urlSecurityCheck(this.linkURL, this._unremotePrincipal(doc.nodePrincipal));
openLinkIn(this.linkURL, "window",
{ charset: doc.characterSet,
referrerURI: doc.documentURIObject,
@ -794,7 +824,7 @@ nsContextMenu.prototype = {
// Open linked-to URL in a new tab.
openLinkInTab: function() {
var doc = this.target.ownerDocument;
urlSecurityCheck(this.linkURL, doc.nodePrincipal);
urlSecurityCheck(this.linkURL, this._unremotePrincipal(doc.nodePrincipal));
openLinkIn(this.linkURL, "tab",
{ charset: doc.characterSet,
referrerURI: doc.documentURIObject });
@ -803,7 +833,7 @@ nsContextMenu.prototype = {
// open URL in current tab
openLinkInCurrent: function() {
var doc = this.target.ownerDocument;
urlSecurityCheck(this.linkURL, doc.nodePrincipal);
urlSecurityCheck(this.linkURL, this._unremotePrincipal(doc.nodePrincipal));
openLinkIn(this.linkURL, "current",
{ charset: doc.characterSet,
referrerURI: doc.documentURIObject });
@ -839,7 +869,8 @@ nsContextMenu.prototype = {
var doc = this.target.ownerDocument;
var frameURL = doc.location.href;
urlSecurityCheck(frameURL, this.browser.contentPrincipal,
urlSecurityCheck(frameURL,
this._unremotePrincipal(this.browser.contentPrincipal),
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
var referrer = doc.referrer;
openUILinkIn(frameURL, "current", { disallowInheritPrincipal: true,
@ -902,7 +933,8 @@ nsContextMenu.prototype = {
viewImageDesc: function(e) {
var doc = this.target.ownerDocument;
urlSecurityCheck(this.imageDescURL, this.browser.contentPrincipal,
urlSecurityCheck(this.imageDescURL,
this._unremotePrincipal(this.browser.contentPrincipal),
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
openUILink(this.imageDescURL, e, { disallowInheritPrincipal: true,
referrerURI: doc.documentURIObject });
@ -914,7 +946,7 @@ nsContextMenu.prototype = {
reloadImage: function(e) {
urlSecurityCheck(this.mediaURL,
this.browser.contentPrincipal,
this._unremotePrincipal(this.browser.contentPrincipal),
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
if (this.target instanceof Ci.nsIImageLoadingContent)
@ -930,7 +962,7 @@ nsContextMenu.prototype = {
else {
viewURL = this.mediaURL;
urlSecurityCheck(viewURL,
this.browser.contentPrincipal,
this._unremotePrincipal(this.browser.contentPrincipal),
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
}
@ -940,7 +972,8 @@ nsContextMenu.prototype = {
},
saveVideoFrameAsImage: function () {
urlSecurityCheck(this.mediaURL, this.browser.contentPrincipal,
urlSecurityCheck(this.mediaURL,
this._unremotePrincipal(this.browser.contentPrincipal),
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
let name = "";
try {
@ -973,7 +1006,7 @@ nsContextMenu.prototype = {
// Change current window to the URL of the background image.
viewBGImage: function(e) {
urlSecurityCheck(this.bgImageURL,
this.browser.contentPrincipal,
this._unremotePrincipal(this.browser.contentPrincipal),
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
var doc = this.target.ownerDocument;
openUILink(this.bgImageURL, e, { disallowInheritPrincipal: true,
@ -1007,8 +1040,9 @@ nsContextMenu.prototype = {
if (this.disableSetDesktopBackground())
return;
var doc = this.target.ownerDocument;
urlSecurityCheck(this.target.currentURI.spec,
this.target.ownerDocument.nodePrincipal);
this._unremotePrincipal(doc.nodePrincipal));
// Confirm since it's annoying if you hit this accidentally.
const kDesktopBackgroundURL =
@ -1185,7 +1219,7 @@ nsContextMenu.prototype = {
linkText = document.commandDispatcher.focusedWindow.getSelection().toString().trim();
else
linkText = this.linkText();
urlSecurityCheck(this.linkURL, doc.nodePrincipal);
urlSecurityCheck(this.linkURL, this._unremotePrincipal(doc.nodePrincipal));
this.saveHelper(this.linkURL, linkText, null, true, doc);
},
@ -1205,12 +1239,14 @@ nsContextMenu.prototype = {
true, false, doc.documentURIObject, doc);
}
else if (this.onImage) {
urlSecurityCheck(this.mediaURL, doc.nodePrincipal);
urlSecurityCheck(this.mediaURL,
this._unremotePrincipal(doc.nodePrincipal));
saveImageURL(this.mediaURL, null, "SaveImageTitle", false,
false, doc.documentURIObject, doc);
}
else if (this.onVideo || this.onAudio) {
urlSecurityCheck(this.mediaURL, doc.nodePrincipal);
urlSecurityCheck(this.mediaURL,
this._unremotePrincipal(doc.nodePrincipal));
var dialogTitle = this.onVideo ? "SaveVideoTitle" : "SaveAudioTitle";
this.saveHelper(this.mediaURL, null, dialogTitle, false, doc);
}

View File

@ -2645,6 +2645,7 @@
} catch (e) {
let url = this.mCurrentBrowser.currentURI.spec;
this._updateBrowserRemoteness(this.mCurrentBrowser, this._shouldBrowserBeRemote(url));
throw e;
}
#endif
]]>
@ -2669,6 +2670,7 @@
} catch (e) {
let url = this.mCurrentBrowser.currentURI.spec;
this._updateBrowserRemoteness(this.mCurrentBrowser, this._shouldBrowserBeRemote(url));
throw e;
}
#endif
]]>
@ -2908,6 +2910,16 @@
let titleChanged = this.setTabTitle(tab);
if (titleChanged && !tab.selected && !tab.hasAttribute("busy"))
tab.setAttribute("titlechanged", "true");
break;
case "contextmenu":
gContextMenuContentData = { event: aMessage.objects.event,
browser: browser };
let popup = browser.ownerDocument.getElementById("contentAreaContextMenu");
popup.openPopup(browser, "overlap",
gContextMenuContentData.event.clientX,
gContextMenuContentData.event.clientY,
true, false, null);
break;
}
]]></body>
</method>
@ -2916,12 +2928,6 @@
<![CDATA[
let browserStack = document.getAnonymousElementByAttribute(this, "anonid", "browserStack");
this.mCurrentBrowser = document.getAnonymousElementByAttribute(this, "anonid", "initialBrowser");
if (Services.prefs.getBoolPref("browser.tabs.remote")) {
browserStack.removeChild(this.mCurrentBrowser);
this.mCurrentBrowser.setAttribute("remote", true);
browserStack.appendChild(this.mCurrentBrowser);
this.tabContainer.firstChild.setAttribute("remote", "true");
}
this.mCurrentTab = this.tabContainer.firstChild;
document.addEventListener("keypress", this, false);
@ -2957,8 +2963,10 @@
"-moz-default-background-color" :
Services.prefs.getCharPref("browser.display.background_color");
if (Services.prefs.getBoolPref("browser.tabs.remote"))
if (Services.prefs.getBoolPref("browser.tabs.remote")) {
messageManager.addMessageListener("DOMTitleChanged", this);
messageManager.addMessageListener("contextmenu", this);
}
]]>
</constructor>
@ -2993,8 +3001,10 @@
document.removeEventListener("keypress", this, false);
window.removeEventListener("sizemodechange", this, false);
if (Services.prefs.getBoolPref("browser.tabs.remote"))
if (Services.prefs.getBoolPref("browser.tabs.remote")) {
messageManager.removeMessageListener("DOMTitleChanged", this);
messageManager.removeMessageListener("contextmenu", this);
}
]]>
</destructor>

View File

@ -465,9 +465,11 @@ function synthesizeNativeMouseEvent(aElement, aMsg, aOffsetX = 0, aOffsetY = 0)
let x = aOffsetX + win.mozInnerScreenX + rect.left + rect.width / 2;
let y = aOffsetY + win.mozInnerScreenY + rect.top + rect.height / 2;
win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils)
.sendNativeMouseEvent(x, y, aMsg, 0, null);
let utils = win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let scale = utils.screenPixelsPerCSSPixel;
utils.sendNativeMouseEvent(x * scale, y * scale, aMsg, 0, null);
}
/**

View File

@ -3007,6 +3007,10 @@ let SessionStoreInternal = {
delete this._statesToRestore[aWindow.__SS_restoreID];
delete aWindow.__SS_restoreID;
delete this._windows[aWindow.__SSi]._restoring;
// It's important to set the window state to dirty so that
// we collect their data for the first time when saving state.
this._dirtyWindows[aWindow.__SSi] = true;
}
if (aTabs.length == 0) {

View File

@ -122,6 +122,8 @@ MOCHITEST_BROWSER_FILES = \
browser_628270.js \
browser_635418.js \
browser_636279.js \
browser_637020.js \
browser_637020_slow.sjs \
browser_644409-scratchpads.js \
browser_645428.js \
browser_659591.js \

View File

@ -0,0 +1,65 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URL = "http://mochi.test:8888/browser/browser/components/" +
"sessionstore/test/browser_637020_slow.sjs";
const TEST_STATE = {
windows: [{
tabs: [
{ entries: [{ url: "about:mozilla" }] },
{ entries: [{ url: "about:robots" }] }
]
}, {
tabs: [
{ entries: [{ url: TEST_URL }] },
{ entries: [{ url: TEST_URL }] }
]
}]
};
function test() {
TestRunner.run();
}
/**
* This test ensures that windows that have just been restored will be marked
* as dirty, otherwise _getCurrentState() might ignore them when collecting
* state for the first time and we'd just save them as empty objects.
*
* The dirty state acts as a cache to not collect data from all windows all the
* time, so at the beginning, each window must be dirty so that we collect
* their state at least once.
*/
function runTests() {
let win;
// Wait until the new window has been opened.
Services.obs.addObserver(function onOpened(subject) {
Services.obs.removeObserver(onOpened, "domwindowopened");
win = subject;
executeSoon(next);
}, "domwindowopened", false);
// Set the new browser state that will
// restore a window with two slowly loading tabs.
yield SessionStore.setBrowserState(JSON.stringify(TEST_STATE));
// The window has now been opened. Check the state that is returned,
// this should come from the cache while the window isn't restored, yet.
info("the window has been opened");
checkWindows();
// The history has now been restored and the tabs are loading. The data must
// now come from the window, if it's correctly been marked as dirty before.
yield whenDelayedStartupFinished(win, next);
info("the delayed startup has finished");
checkWindows();
}
function checkWindows() {
let state = JSON.parse(SessionStore.getBrowserState());
is(state.windows[0].tabs.length, 2, "first window has two tabs");
is(state.windows[1].tabs.length, 2, "second window has two tabs");
}

View File

@ -0,0 +1,21 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const Cc = Components.classes;
const Ci = Components.interfaces;
const DELAY_MS = "2000";
let timer;
function handleRequest(req, resp) {
resp.processAsync();
resp.setHeader("Cache-Control", "no-cache", false);
resp.setHeader("Content-Type", "text/html;charset=utf-8", false);
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.init(() => {
resp.write("hi");
resp.finish();
}, DELAY_MS, Ci.nsITimer.TYPE_ONE_SHOT);
}

View File

@ -70,8 +70,8 @@ var Appbar = {
},
onDownloadButton: function() {
// TODO: Bug 883962: Toggle the downloads infobar when the
// download button is clicked
let notificationBox = Browser.getNotificationBox();
notificationBox.notificationsHidden = !notificationBox.notificationsHidden;
ContextUI.dismiss();
},

View File

@ -858,15 +858,6 @@
<richlistbox id="menupopup-commands" onclick="if (event.target != this) AutofillMenuUI.selectByIndex(this.selectedIndex);" flex="1"/>
</vbox>
</box>
<!-- alerts for content -->
<hbox id="alerts-container" hidden="true" align="start" bottom="0" onclick="AlertsHelper.click(event);">
<image id="alerts-image"/>
<vbox flex="1">
<label id="alerts-title" value=""/>
<description id="alerts-text" flex="1"/>
</vbox>
</hbox>
</stack>
</window>

View File

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const URI_GENERIC_ICON_DOWNLOAD = "chrome://browser/skin/images/alert-downloads-30.png";
const TOAST_URI_GENERIC_ICON_DOWNLOAD = "ms-appx:///metro/chrome/chrome/skin/images/alert-downloads-30.png"
var Downloads = {
/**
@ -154,29 +155,21 @@ var Downloads = {
BrowserUI.newTab(uri, Browser.selectedTab);
},
showAlert: function dh_showAlert(aName, aMessage, aTitle, aIcon) {
showAlert: function dh_showAlert(aName, aMessage, aTitle, aIcon, aObserver) {
var notifier = Cc["@mozilla.org/alerts-service;1"]
.getService(Ci.nsIAlertsService);
// Callback for tapping on the alert popup
let observer = {
observe: function (aSubject, aTopic, aData) {
if (aTopic == "alertclickcallback") {
// TODO: Bug 783232 turns this alert into a native toast.
}
}
};
if (!aTitle)
aTitle = Strings.browser.GetStringFromName("alertDownloads");
if (!aIcon)
aIcon = URI_GENERIC_ICON_DOWNLOAD;
aIcon = TOAST_URI_GENERIC_ICON_DOWNLOAD;
notifier.showAlertNotification(aIcon, aTitle, aMessage, true, "", observer, aName);
notifier.showAlertNotification(aIcon, aTitle, aMessage, true, "", aObserver, aName);
},
showNotification: function dh_showNotification(title, msg, buttons, priority) {
this._notificationBox.notificationsHidden = false;
return this._notificationBox.appendNotification(msg,
title,
URI_GENERIC_ICON_DOWNLOAD,
@ -257,6 +250,53 @@ var Downloads = {
this._notificationBox.PRIORITY_WARNING_MEDIUM);
},
_showDownloadCompleteToast: function (aDownload) {
let name = "DownloadComplete";
let msg = "";
let title = "";
let observer = null;
if (this._downloadCount > 1) {
title = PluralForm.get(this._downloadCount,
Strings.browser.GetStringFromName("alertMultipleDownloadsComplete"))
.replace("#1", this._downloadCount)
msg = PluralForm.get(2, Strings.browser.GetStringFromName("downloadShowInFiles"));
observer = {
observe: function (aSubject, aTopic, aData) {
switch (aTopic) {
case "alertclickcallback":
let fileURI = aDownload.target;
let file = Downloads._getLocalFile(fileURI);
file.reveal();
let downloadCompleteNotification =
Downloads._notificationBox.getNotificationWithValue("download-complete");
Downloads._notificationBox.removeNotification(downloadCompleteNotification);
break;
}
}
}
} else {
title = Strings.browser.formatStringFromName("alertDownloadsDone",
[aDownload.displayName], 1);
msg = Strings.browser.GetStringFromName("downloadRunNow");
observer = {
observe: function (aSubject, aTopic, aData) {
switch (aTopic) {
case "alertclickcallback":
Downloads.openDownload(aDownload);
let downloadCompleteNotification =
Downloads._notificationBox.getNotificationWithValue("download-complete");
Downloads._notificationBox.removeNotification(downloadCompleteNotification);
break;
}
}
}
}
this.showAlert(name, msg, title, null, observer);
},
_updateCircularProgressMeter: function dv_updateCircularProgressMeter() {
if (!this._progressNotificationInfo) {
return;
@ -391,6 +431,7 @@ var Downloads = {
this._runDownloadBooleanMap.delete(download.targetFile.path);
if (this._downloadsInProgress == 0) {
if (this._downloadCount > 1 || !runAfterDownload) {
this._showDownloadCompleteToast(download);
this._showDownloadCompleteNotification(download);
}
this._progressNotificationInfo.clear();

View File

@ -3,80 +3,23 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var AlertsHelper = {
_timeoutID: -1,
_listener: null,
_cookie: "",
_clickable: false,
get container() {
delete this.container;
let container = document.getElementById("alerts-container");
let self = this;
container.addEventListener("transitionend", function() {
self.alertTransitionOver();
}, true);
return this.container = container;
},
showAlertNotification: function ah_show(aImageURL, aTitle, aText, aTextClickable, aCookie, aListener) {
this._clickable = aTextClickable || false;
this._listener = aListener || null;
this._cookie = aCookie || "";
Services.obs.addObserver(this, "metro_native_toast_clicked", false);
this._listener = aListener;
this._cookie = aCookie;
// Reset the container settings from the last time so layout can happen naturally
let container = this.container;
container.removeAttribute("width");
let alertText = document.getElementById("alerts-text");
alertText.style.whiteSpace = "";
document.getElementById("alerts-image").setAttribute("src", aImageURL);
document.getElementById("alerts-title").value = aTitle;
alertText.textContent = aText;
container.hidden = false;
let bcr = container.getBoundingClientRect();
if (bcr.width > window.innerWidth - 50) {
// If the window isn't wide enough, we need to re-layout
container.setAttribute("width", window.innerWidth - 50); // force a max width
alertText.style.whiteSpace = "pre-wrap"; // wrap text as needed
bcr = container.getBoundingClientRect(); // recalculate the bcr
}
container.setAttribute("width", bcr.width); // redundant but cheap
container.setAttribute("height", bcr.height);
container.classList.add("showing");
let timeout = Services.prefs.getIntPref("alerts.totalOpenTime");
let self = this;
if (this._timeoutID)
clearTimeout(this._timeoutID);
this._timeoutID = setTimeout(function() { self._timeoutAlert(); }, timeout);
MetroUtils.showNativeToast(aTitle, aText, aImageURL);
},
_timeoutAlert: function ah__timeoutAlert() {
this._timeoutID = -1;
this.container.classList.remove("showing");
if (this._listener)
this._listener.observe(null, "alertfinished", this._cookie);
},
alertTransitionOver: function ah_alertTransitionOver() {
let container = this.container;
if (!container.classList.contains("showing")) {
container.height = 0;
container.hidden = true;
}
},
click: function ah_click(aEvent) {
if (this._clickable && this._listener)
this._listener.observe(null, "alertclickcallback", this._cookie);
if (this._timeoutID != -1) {
clearTimeout(this._timeoutID);
this._timeoutAlert();
observe: function(aSubject, aTopic, aData) {
switch (aTopic) {
case "metro_native_toast_clicked":
Services.obs.removeObserver(this, "metro_native_toast_clicked");
this._listener.observe(null, "alertclickcallback", this._cookie);
break;
}
}
};

View File

@ -20,7 +20,28 @@ AlertsService.prototype = {
showAlertNotification: function(aImageUrl, aTitle, aText, aTextClickable, aCookie, aAlertListener, aName) {
let browser = Services.wm.getMostRecentWindow("navigator:browser");
browser.AlertsHelper.showAlertNotification(aImageUrl, aTitle, aText, aTextClickable, aCookie, aAlertListener);
try {
browser.AlertsHelper.showAlertNotification(aImageUrl, aTitle, aText, aTextClickable, aCookie, aAlertListener);
} catch (ex) {
let chromeWin = this._getChromeWindow(browser).wrappedJSObject;
let notificationBox = chromeWin.Browser.getNotificationBox();
notificationBox.appendNotification(aTitle,
aText,
aImageUrl,
notificationBox.PRIORITY_WARNING_MEDIUM,
null);
}
},
_getChromeWindow: function (aWindow) {
let chromeWin = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow)
.QueryInterface(Ci.nsIDOMChromeWindow);
return chromeWin;
}
};

View File

@ -101,6 +101,7 @@ HelperAppLauncherDialog.prototype = {
.replace("#2", downloadSize)
.replace("#3", aLauncher.source.host);
notificationBox.notificationsHidden = false;
let newBar = notificationBox.appendNotification(msg,
"save-download",
URI_GENERIC_ICON_DOWNLOAD,

View File

@ -61,6 +61,7 @@ downloadRun=Run
downloadSave=Save
downloadCancel=Cancel
downloadTryAgain=Try Again
downloadRunNow=Run it now
# LOCALIZATION NOTE (downloadShowInFiles): 'Files' refers to the Windows 8 file explorer
downloadShowInFiles=Show in Files

View File

@ -1245,37 +1245,4 @@ setting[type="radio"] > vbox {
#clear-notification-done {
font-weight: bold;
}
/* Alert Popup ============================================================= */
#alerts-container {
color: white;
background-color: #5e6166;
border: @border_width_small@ solid #767973;
border-radius: @border_radius_normal@;
box-shadow: black 0 @border_radius_tiny@ @border_radius_tiny@;
padding: @padding_normal@; /* core spacing on top/bottom */
margin-bottom: @margin_large@;
transition-property: opacity;
transition-duration: 0.5s;
opacity: 0;
}
#alerts-container.showing {
opacity: 1;
}
#alerts-title {
font-size: @font_small@ !important;
}
#alerts-text {
font-size: @font_xsmall@ !important;
white-space: pre;
}
#alerts-container {
-moz-margin-end: @margin_large@;
}
}

View File

@ -50,6 +50,10 @@
background-position: 0 0;
}
.side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
color: #888;
}
.side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
display: none;
}

View File

@ -52,6 +52,10 @@
background-position: 0 0;
}
.side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
color: #888;
}
.side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
display: none;
}

View File

@ -50,6 +50,10 @@
background-position: 0 0;
}
.side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
color: #888;
}
.side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
display: none;
}

View File

@ -19,8 +19,7 @@ from mozbuild.backend.configenvironment import ConfigEnvironment
from mozbuild.backend.recursivemake import RecursiveMakeBackend
from mozbuild.frontend.emitter import TreeMetadataEmitter
from mozbuild.frontend.reader import BuildReader
from Preprocessor import Preprocessor
from mozbuild.mozinfo import write_mozinfo
log_manager = LoggingManager()
@ -87,6 +86,11 @@ def config_status(topobjdir = '.', topsrcdir = '.',
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
non_global_defines=non_global_defines, substs=substs)
# mozinfo.json only needs written if configure changes and configure always
# passes this environment variable.
if 'WRITE_MOZINFO' in os.environ:
write_mozinfo(os.path.join(topobjdir, 'mozinfo.json'), env, os.environ)
reader = BuildReader(env)
emitter = TreeMetadataEmitter(env)
backend = RecursiveMakeBackend(env)

View File

@ -518,9 +518,18 @@ class Automation(object):
# Only 2 GB RAM or less available? Use custom ASan options to reduce
# the amount of resources required to do the tests. Standard options
# will otherwise lead to OOM conditions on the current test slaves.
#
# If we have more than 2 GB or RAM but still less than 4 GB, we need
# another set of options to prevent OOM in some memory-intensive
# tests.
if totalMemory <= 1024 * 1024 * 2:
self.log.info("INFO | automation.py | ASan running in low-memory configuration")
env["ASAN_OPTIONS"] = "quarantine_size=50331648:redzone=64"
elif totalMemory <= 1024 * 1024 * 4:
self.log.info("INFO | automation.py | ASan running in mid-memory configuration")
env["ASAN_OPTIONS"] = "quarantine_size=100663296:redzone=64"
else:
self.log.info("INFO | automation.py | ASan running in default memory configuration")
except OSError,err:
self.log.info("Failed determine available memory, disabling ASan low-memory configuration: %s", err.strerror)
except:

View File

@ -432,17 +432,17 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
NS_ASSERTION(ssm, "Failed to get security manager service");
if (!ssm)
return JS_FALSE;
return false;
nsresult rv;
nsIPrincipal* subjectPrincipal = ssm->GetSubjectPrincipal(cx, &rv);
NS_ASSERTION(NS_SUCCEEDED(rv), "CSP: Failed to get nsIPrincipal from js context");
if (NS_FAILED(rv))
return JS_FALSE; // Not just absence of principal, but failure.
return false; // Not just absence of principal, but failure.
if (!subjectPrincipal)
return JS_TRUE;
return true;
nsCOMPtr<nsIContentSecurityPolicy> csp;
rv = subjectPrincipal->GetCsp(getter_AddRefs(csp));
@ -450,7 +450,7 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
// don't do anything unless there's a CSP
if (!csp)
return JS_TRUE;
return true;
bool evalOK = true;
bool reportViolation = false;
@ -459,7 +459,7 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
if (NS_FAILED(rv))
{
NS_WARNING("CSP: failed to get allowsEval");
return JS_TRUE; // fail open to not break sites.
return true; // fail open to not break sites.
}
if (reportViolation) {
@ -494,7 +494,7 @@ nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JS::Handle<JSObject*>
NS_WARN_IF_FALSE(ssm, "Failed to get security manager service");
if (!ssm)
return JS_FALSE;
return false;
// Get the object being accessed. We protect these cases:
// 1. The Function.prototype.caller property's value, which might lead
@ -515,9 +515,9 @@ nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JS::Handle<JSObject*>
(int32_t)nsIXPCSecurityManager::ACCESS_GET_PROPERTY);
if (NS_FAILED(rv))
return JS_FALSE; // Security check failed (XXX was an error reported?)
return false; // Security check failed (XXX was an error reported?)
return JS_TRUE;
return true;
}
NS_IMETHODIMP

View File

@ -1,204 +0,0 @@
#!/usr/bin/env python
import unittest
import json, os, sys, time, tempfile
from StringIO import StringIO
import mozunit
from writemozinfo import build_dict, write_json
class TestBuildDict(unittest.TestCase):
def testMissing(self):
"""
Test that missing required values raises.
"""
self.assertRaises(Exception, build_dict, {'OS_TARGET':'foo'})
self.assertRaises(Exception, build_dict, {'TARGET_CPU':'foo'})
self.assertRaises(Exception, build_dict, {'MOZ_WIDGET_TOOLKIT':'foo'})
def testWin(self):
d = build_dict({'OS_TARGET':'WINNT',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'windows'})
self.assertEqual('win', d['os'])
self.assertEqual('x86', d['processor'])
self.assertEqual('windows', d['toolkit'])
self.assertEqual(32, d['bits'])
def testLinux(self):
d = build_dict({'OS_TARGET':'Linux',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'gtk2'})
self.assertEqual('linux', d['os'])
self.assertEqual('x86', d['processor'])
self.assertEqual('gtk2', d['toolkit'])
self.assertEqual(32, d['bits'])
d = build_dict({'OS_TARGET':'Linux',
'TARGET_CPU':'x86_64',
'MOZ_WIDGET_TOOLKIT':'gtk2'})
self.assertEqual('linux', d['os'])
self.assertEqual('x86_64', d['processor'])
self.assertEqual('gtk2', d['toolkit'])
self.assertEqual(64, d['bits'])
def testMac(self):
d = build_dict({'OS_TARGET':'Darwin',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'cocoa'})
self.assertEqual('mac', d['os'])
self.assertEqual('x86', d['processor'])
self.assertEqual('cocoa', d['toolkit'])
self.assertEqual(32, d['bits'])
d = build_dict({'OS_TARGET':'Darwin',
'TARGET_CPU':'x86_64',
'MOZ_WIDGET_TOOLKIT':'cocoa'})
self.assertEqual('mac', d['os'])
self.assertEqual('x86_64', d['processor'])
self.assertEqual('cocoa', d['toolkit'])
self.assertEqual(64, d['bits'])
def testMacUniversal(self):
d = build_dict({'OS_TARGET':'Darwin',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'cocoa',
'UNIVERSAL_BINARY': '1'})
self.assertEqual('mac', d['os'])
self.assertEqual('universal-x86-x86_64', d['processor'])
self.assertEqual('cocoa', d['toolkit'])
self.assertFalse('bits' in d)
d = build_dict({'OS_TARGET':'Darwin',
'TARGET_CPU':'x86_64',
'MOZ_WIDGET_TOOLKIT':'cocoa',
'UNIVERSAL_BINARY': '1'})
self.assertEqual('mac', d['os'])
self.assertEqual('universal-x86-x86_64', d['processor'])
self.assertEqual('cocoa', d['toolkit'])
self.assertFalse('bits' in d)
def testAndroid(self):
d = build_dict({'OS_TARGET':'Android',
'TARGET_CPU':'arm',
'MOZ_WIDGET_TOOLKIT':'android'})
self.assertEqual('android', d['os'])
self.assertEqual('arm', d['processor'])
self.assertEqual('android', d['toolkit'])
self.assertEqual(32, d['bits'])
def testX86(self):
"""
Test that various i?86 values => x86.
"""
d = build_dict({'OS_TARGET':'WINNT',
'TARGET_CPU':'i486',
'MOZ_WIDGET_TOOLKIT':'windows'})
self.assertEqual('x86', d['processor'])
d = build_dict({'OS_TARGET':'WINNT',
'TARGET_CPU':'i686',
'MOZ_WIDGET_TOOLKIT':'windows'})
self.assertEqual('x86', d['processor'])
def testARM(self):
"""
Test that all arm CPU architectures => arm.
"""
d = build_dict({'OS_TARGET':'Linux',
'TARGET_CPU':'arm',
'MOZ_WIDGET_TOOLKIT':'gtk2'})
self.assertEqual('arm', d['processor'])
d = build_dict({'OS_TARGET':'Linux',
'TARGET_CPU':'armv7',
'MOZ_WIDGET_TOOLKIT':'gtk2'})
self.assertEqual('arm', d['processor'])
def testUnknown(self):
"""
Test that unknown values pass through okay.
"""
d = build_dict({'OS_TARGET':'RandOS',
'TARGET_CPU':'cptwo',
'MOZ_WIDGET_TOOLKIT':'foobar'})
self.assertEqual("randos", d["os"])
self.assertEqual("cptwo", d["processor"])
self.assertEqual("foobar", d["toolkit"])
# unknown CPUs should not get a bits value
self.assertFalse("bits" in d)
def testDebug(self):
"""
Test that debug values are properly detected.
"""
d = build_dict({'OS_TARGET':'Linux',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'gtk2'})
self.assertEqual(False, d['debug'])
d = build_dict({'OS_TARGET':'Linux',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'gtk2',
'MOZ_DEBUG':'1'})
self.assertEqual(True, d['debug'])
def testCrashreporter(self):
"""
Test that crashreporter values are properly detected.
"""
d = build_dict({'OS_TARGET':'Linux',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'gtk2'})
self.assertEqual(False, d['crashreporter'])
d = build_dict({'OS_TARGET':'Linux',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'gtk2',
'MOZ_CRASHREPORTER':'1'})
self.assertEqual(True, d['crashreporter'])
class TestWriteJson(unittest.TestCase):
"""
Test the write_json function.
"""
def setUp(self):
fd, self.f = tempfile.mkstemp()
os.close(fd)
def tearDown(self):
os.unlink(self.f)
def testBasic(self):
"""
Test that writing to a file produces correct output.
"""
write_json(self.f, env={'OS_TARGET':'WINNT',
'TARGET_CPU':'i386',
'TOPSRCDIR':'/tmp',
'MOZCONFIG':'foo',
'MOZ_WIDGET_TOOLKIT':'windows'})
with open(self.f) as f:
d = json.load(f)
self.assertEqual('win', d['os'])
self.assertEqual('x86', d['processor'])
self.assertEqual('windows', d['toolkit'])
self.assertEqual('/tmp', d['topsrcdir'])
self.assertEqual(os.path.normpath('/tmp/foo'), d['mozconfig'])
self.assertEqual(32, d['bits'])
def testFileObj(self):
"""
Test that writing to a file-like object produces correct output.
"""
s = StringIO()
write_json(s, env={'OS_TARGET':'WINNT',
'TARGET_CPU':'i386',
'MOZ_WIDGET_TOOLKIT':'windows'})
d = json.loads(s.getvalue())
self.assertEqual('win', d['os'])
self.assertEqual('x86', d['processor'])
self.assertEqual('windows', d['toolkit'])
self.assertEqual(32, d['bits'])
if __name__ == '__main__':
mozunit.main()

View File

@ -9054,7 +9054,9 @@ xpcom/xpcom-private.h
AC_SUBST(STLPORT_LIBS)
export WRITE_MOZINFO=1
AC_OUTPUT([mozilla-config.h])
unset WRITE_MOZINFO
# Hack around an Apple bug that affects the egrep that comes with OS X 10.7.
# "env ARCHPREFERENCE=i386,x86_64 arch egrep" first tries to use the 32-bit
@ -9201,24 +9203,6 @@ dnl so that regeneration via dependencies works correctly
fi
fi
# Generate a JSON config file for unittest harnesses etc to read
# build configuration details from in a standardized way.
OS_TARGET=${OS_TARGET} \
TARGET_CPU=${TARGET_CPU} \
MOZ_DEBUG=${MOZ_DEBUG} \
MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} \
UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
MOZ_CRASHREPORTER=${MOZ_CRASHREPORTER} \
MOZ_APP_NAME=${MOZ_APP_NAME} \
TOPSRCDIR=${_topsrcdir} \
MOZ_ASAN=${MOZ_ASAN} \
$PYTHON ${_topsrcdir}/config/writemozinfo.py ./mozinfo.json.tmp
if cmp -s ./mozinfo.json.tmp ./mozinfo.json; then
rm ./mozinfo.json.tmp
else
mv -f ./mozinfo.json.tmp ./mozinfo.json
fi
# Run jemalloc configure script
if test -z "$MOZ_NATIVE_JEMALLOC" -a "$MOZ_MEMORY" && test -n "$MOZ_JEMALLOC3" -o -n "$MOZ_REPLACE_MALLOC"; then

View File

@ -95,8 +95,12 @@ void SetDirectionFromNewTextNode(nsIContent* aTextNode);
/**
* When a text node is removed from a document, find any ancestors whose
* directionality it determined and redetermine their directionality
*
* @param aTextNode the text node
* @param aNullParent whether the the parent is also being removed
* (passed from UnbindFromTree)
*/
void ResetDirectionSetByTextNode(nsTextNode* aTextNode);
void ResetDirectionSetByTextNode(nsTextNode* aTextNode, bool aNullParent);
/**
* Set the directionality of an element according to the directionality of the

View File

@ -133,6 +133,8 @@ public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ELEMENT_IID)
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
/**
* Method to get the full state of this element. See nsEventStates.h for
* the possible bits that could be set here.

View File

@ -172,12 +172,6 @@ public:
NS_DECL_SIZEOF_EXCLUDING_THIS
/**
* Called during QueryInterface to give the binding manager a chance to
* get an interface for this element.
*/
nsresult PostQueryInterface(REFNSIID aIID, void** aInstancePtr);
// nsINode interface methods
virtual uint32_t GetChildCount() const MOZ_OVERRIDE;
virtual nsIContent *GetChildAt(uint32_t aIndex) const MOZ_OVERRIDE;
@ -402,16 +396,4 @@ protected:
rv = FragmentOrElement::QueryInterface(aIID, aInstancePtr); \
NS_INTERFACE_TABLE_TO_MAP_SEGUE
#define NS_ELEMENT_INTERFACE_MAP_END \
{ \
return PostQueryInterface(aIID, aInstancePtr); \
} \
\
NS_ADDREF(foundInterface); \
\
*aInstancePtr = foundInterface; \
\
return NS_OK; \
}
#endif /* FragmentOrElement_h___ */

View File

@ -80,11 +80,14 @@ class nsCopySupport
* responsible for removing the content during a cut operation if true is
* returned.
*
* aClipboardType specifies which clipboard to use, from nsIClipboard.
*
* If the event is cancelled or an error occurs, false will be returned.
*/
static bool FireClipboardEvent(int32_t aType,
nsIPresShell* aPresShell,
nsISelection* aSelection);
int32_t aClipboardType,
nsIPresShell* aPresShell,
nsISelection* aSelection);
};
#endif

View File

@ -502,7 +502,7 @@ private:
nsINode* oldTextNode = static_cast<Element*>(aData);
Element* rootNode = aEntry->GetKey();
nsINode* newTextNode = nullptr;
if (rootNode->HasDirAuto()) {
if (oldTextNode && rootNode->HasDirAuto()) {
newTextNode = WalkDescendantsSetDirectionFromText(rootNode, true,
oldTextNode);
}
@ -529,6 +529,11 @@ public:
mElements.EnumerateEntries(SetNodeDirection, &aDir);
}
void ClearAutoDirection()
{
mElements.EnumerateEntries(ResetNodeDirection, nullptr);
}
void ResetAutoDirection(nsINode* aTextNode)
{
mElements.EnumerateEntries(ResetNodeDirection, aTextNode);
@ -565,6 +570,13 @@ public:
GetDirectionalityMap(aTextNode)->UpdateAutoDirection(aDir);
}
static void ClearTextNodeDirection(nsINode* aTextNode)
{
MOZ_ASSERT(aTextNode->HasTextNodeDirectionalityMap(),
"Map missing in ResetTextNodeDirection");
GetDirectionalityMap(aTextNode)->ClearAutoDirection();
}
static void ResetTextNodeDirection(nsINode* aTextNode)
{
MOZ_ASSERT(aTextNode->HasTextNodeDirectionalityMap(),
@ -871,7 +883,7 @@ SetDirectionFromNewTextNode(nsIContent* aTextNode)
}
void
ResetDirectionSetByTextNode(nsTextNode* aTextNode)
ResetDirectionSetByTextNode(nsTextNode* aTextNode, bool aNullParent)
{
if (!NodeAffectsDirAutoAncestor(aTextNode)) {
nsTextNodeDirectionalityMap::EnsureMapIsClearFor(aTextNode);
@ -880,7 +892,11 @@ ResetDirectionSetByTextNode(nsTextNode* aTextNode)
Directionality dir = GetDirectionFromText(aTextNode->GetText());
if (dir != eDir_NotSet && aTextNode->HasTextNodeDirectionalityMap()) {
nsTextNodeDirectionalityMap::ResetTextNodeDirection(aTextNode);
if (aNullParent) {
nsTextNodeDirectionalityMap::ClearTextNodeDirection(aTextNode);
} else {
nsTextNodeDirectionalityMap::ResetTextNodeDirection(aTextNode);
}
}
}

View File

@ -127,11 +127,27 @@
#include "nsXBLService.h"
#include "nsContentCID.h"
#include "nsITextControlElement.h"
#include "nsISupportsImpl.h"
#include "mozilla/dom/DocumentFragment.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMETHODIMP
Element::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
NS_ASSERTION(aInstancePtr,
"QueryInterface requires a non-NULL destination!");
nsresult rv = FragmentOrElement::QueryInterface(aIID, aInstancePtr);
if (NS_SUCCEEDED(rv)) {
return NS_OK;
}
// Give the binding manager a chance to get an interface for this element.
return OwnerDoc()->BindingManager()->GetBindingImplementation(this, aIID,
aInstancePtr);
}
nsEventStates
Element::IntrinsicState() const
{

View File

@ -106,7 +106,6 @@
#include "nsIXULDocument.h"
#endif /* MOZ_XUL */
#include "nsCycleCollectionParticipant.h"
#include "nsCCUncollectableMarker.h"
#include "mozAutoDocUpdate.h"
@ -1750,13 +1749,6 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(FragmentOrElement)
NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(FragmentOrElement,
nsNodeUtils::LastRelease(this))
nsresult
FragmentOrElement::PostQueryInterface(REFNSIID aIID, void** aInstancePtr)
{
return OwnerDoc()->BindingManager()->GetBindingImplementation(this, aIID,
aInstancePtr);
}
//----------------------------------------------------------------------
nsresult

View File

@ -52,6 +52,9 @@
#include "imgIRequest.h"
#include "nsDOMDataTransfer.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLAreaElement.h"
using mozilla::dom::HTMLAreaElement;
class MOZ_STACK_CLASS DragDataProducer
{
@ -505,10 +508,11 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
if (area) {
// use the alt text (or, if missing, the href) as the title
area->GetAttribute(NS_LITERAL_STRING("alt"), mTitleString);
HTMLAreaElement* areaElem = static_cast<HTMLAreaElement*>(area.get());
areaElem->GetAttribute(NS_LITERAL_STRING("alt"), mTitleString);
if (mTitleString.IsEmpty()) {
// this can be a relative link
area->GetAttribute(NS_LITERAL_STRING("href"), mTitleString);
areaElem->GetAttribute(NS_LITERAL_STRING("href"), mTitleString);
}
// we'll generate HTML like <a href="absurl">alt text</a>

View File

@ -4960,7 +4960,7 @@ nsContentUtils::SetDataTransferInEvent(nsDragEvent* aDragEvent)
// means, for instance calling the drag service directly, or a drag
// from another application. In either case, a new dataTransfer should
// be created that reflects the data.
initialDataTransfer = new nsDOMDataTransfer(aDragEvent->message, true);
initialDataTransfer = new nsDOMDataTransfer(aDragEvent->message, true, -1);
NS_ENSURE_TRUE(initialDataTransfer, NS_ERROR_OUT_OF_MEMORY);

View File

@ -573,7 +573,7 @@ nsCopySupport::CanCopy(nsIDocument* aDocument)
}
bool
nsCopySupport::FireClipboardEvent(int32_t aType, nsIPresShell* aPresShell, nsISelection* aSelection)
nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPresShell* aPresShell, nsISelection* aSelection)
{
NS_ASSERTION(aType == NS_CUT || aType == NS_COPY || aType == NS_PASTE,
"Invalid clipboard event type");
@ -633,7 +633,7 @@ nsCopySupport::FireClipboardEvent(int32_t aType, nsIPresShell* aPresShell, nsISe
bool doDefault = true;
nsRefPtr<nsDOMDataTransfer> clipboardData;
if (Preferences::GetBool("dom.event.clipboardevents.enabled", true)) {
clipboardData = new nsDOMDataTransfer(aType, aType == NS_PASTE);
clipboardData = new nsDOMDataTransfer(aType, aType == NS_PASTE, aClipboardType);
nsEventStatus status = nsEventStatus_eIgnore;
nsClipboardEvent evt(true, aType);
@ -675,7 +675,7 @@ nsCopySupport::FireClipboardEvent(int32_t aType, nsIPresShell* aPresShell, nsISe
return false;
}
// call the copy code
rv = HTMLCopy(sel, doc, nsIClipboard::kGlobalClipboard);
rv = HTMLCopy(sel, doc, aClipboardType);
if (NS_FAILED(rv)) {
return false;
}
@ -692,7 +692,7 @@ nsCopySupport::FireClipboardEvent(int32_t aType, nsIPresShell* aPresShell, nsISe
NS_ENSURE_TRUE(transferable, false);
// put the transferable on the clipboard
rv = clipboard->SetData(transferable, nullptr, nsIClipboard::kGlobalClipboard);
rv = clipboard->SetData(transferable, nullptr, aClipboardType);
if (NS_FAILED(rv)) {
return false;
}

View File

@ -112,7 +112,6 @@
#include "nsHTMLDocument.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIRequest.h"
#include "nsILink.h"
#include "nsHostObjectProtocolHandler.h"
#include "nsCharsetAlias.h"
@ -149,6 +148,7 @@
#include "nsObjectLoadingContent.h"
#include "nsHtml5TreeOpExecutor.h"
#include "nsIDOMElementReplaceEvent.h"
#include "mozilla/dom/HTMLLinkElement.h"
#include "mozilla/dom/HTMLMediaElement.h"
#ifdef MOZ_WEBRTC
#include "IPeerConnection.h"
@ -194,6 +194,7 @@
#include "mozilla/dom/DocumentFragment.h"
#include "mozilla/dom/WebComponentsBinding.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/NodeFilterBinding.h"
#include "mozilla/dom/UndoManager.h"
#include "nsFrame.h"
@ -7590,7 +7591,7 @@ nsDocument::Sanitize()
for (uint32_t i = 0; i < length; ++i) {
NS_ASSERTION(nodes->Item(i), "null item in node list!");
nsCOMPtr<nsIDOMHTMLInputElement> input = do_QueryInterface(nodes->Item(i));
nsRefPtr<HTMLInputElement> input = HTMLInputElement::FromContentOrNull(nodes->Item(i));
if (!input)
continue;
@ -7606,8 +7607,7 @@ nsDocument::Sanitize()
}
if (resetValue) {
nsCOMPtr<nsIFormControl> fc = do_QueryInterface(input);
fc->Reset();
input->Reset();
}
}
@ -7622,7 +7622,8 @@ nsDocument::Sanitize()
if (!form)
continue;
form->GetAttribute(NS_LITERAL_STRING("autocomplete"), value);
nodes->Item(i)->AsElement()->GetAttr(kNameSpaceID_None,
nsGkAtoms::autocomplete, value);
if (value.LowerCaseEqualsLiteral("off"))
form->Reset();
}
@ -8066,15 +8067,12 @@ nsDocument::OnPageShow(bool aPersisted,
if (aPersisted && root) {
// Send out notifications that our <link> elements are attached.
nsRefPtr<nsContentList> links = NS_GetContentList(root,
kNameSpaceID_Unknown,
kNameSpaceID_XHTML,
NS_LITERAL_STRING("link"));
uint32_t linkCount = links->Length(true);
for (uint32_t i = 0; i < linkCount; ++i) {
nsCOMPtr<nsILink> link = do_QueryInterface(links->Item(i, false));
if (link) {
link->LinkAdded();
}
static_cast<HTMLLinkElement*>(links->Item(i, false))->LinkAdded();
}
}
@ -8130,15 +8128,12 @@ nsDocument::OnPageHide(bool aPersisted,
Element* root = GetRootElement();
if (aPersisted && root) {
nsRefPtr<nsContentList> links = NS_GetContentList(root,
kNameSpaceID_Unknown,
kNameSpaceID_XHTML,
NS_LITERAL_STRING("link"));
uint32_t linkCount = links->Length(true);
for (uint32_t i = 0; i < linkCount; ++i) {
nsCOMPtr<nsILink> link = do_QueryInterface(links->Item(i, false));
if (link) {
link->LinkRemoved();
}
static_cast<HTMLLinkElement*>(links->Item(i, false))->LinkRemoved();
}
}

View File

@ -1479,10 +1479,10 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI)
}
if (domapplet || domobject) {
if (domapplet) {
parent = domapplet;
parent = do_QueryInterface(domapplet);
}
else {
parent = domobject;
parent = do_QueryInterface(domobject);
}
nsCOMPtr<nsIDOMNode> mydomNode = do_QueryInterface(mydomElement);
if (parent == mydomNode) {

View File

@ -147,7 +147,7 @@ nsTextNode::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
void nsTextNode::UnbindFromTree(bool aDeep, bool aNullParent)
{
ResetDirectionSetByTextNode(this);
ResetDirectionSetByTextNode(this, aNullParent);
nsGenericDOMDataNode::UnbindFromTree(aDeep, aNullParent);
}

View File

@ -755,6 +755,7 @@ void CanvasRenderingContext2D::Demote()
RefPtr<SourceSurface> snapshot = mTarget->Snapshot();
RefPtr<DrawTarget> oldTarget = mTarget;
mTarget = nullptr;
mResetLayer = true;
mForceSoftware = true;
// Recreate target, now demoted to software only
@ -3039,6 +3040,24 @@ CanvasRenderingContext2D::DrawImage(const HTMLImageOrCanvasOrVideoElement& image
RedrawUser(gfxRect(dx, dy, dw, dh));
}
#ifdef USE_SKIA_GPU
static bool
IsStandardCompositeOp(CompositionOp op)
{
return (op == OP_SOURCE ||
op == OP_ATOP ||
op == OP_IN ||
op == OP_OUT ||
op == OP_OVER ||
op == OP_DEST_IN ||
op == OP_DEST_OUT ||
op == OP_DEST_OVER ||
op == OP_DEST_ATOP ||
op == OP_ADD ||
op == OP_XOR);
}
#endif
void
CanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& op,
ErrorResult& error)
@ -3078,6 +3097,12 @@ CanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& op,
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
else return;
#ifdef USE_SKIA_GPU
if (!IsStandardCompositeOp(comp_op)) {
Demote();
}
#endif
#undef CANVAS_OP_TO_GFX_OP
CurrentState().op = comp_op;
}
@ -3122,6 +3147,12 @@ CanvasRenderingContext2D::GetGlobalCompositeOperation(nsAString& op,
error.Throw(NS_ERROR_FAILURE);
}
#ifdef USE_SKIA_GPU
if (!IsStandardCompositeOp(comp_op)) {
Demote();
}
#endif
#undef CANVAS_OP_TO_GFX_OP
}

View File

@ -89,9 +89,6 @@ MOCHITEST_FILES = \
test_windingRuleUndefined.html \
$(NULL)
ifneq ($(MOZ_WIDGET_TOOLKIT), android)
ifneq ($(MOZ_WIDGET_TOOLKIT), gonk)
# SkiaGL on Android/Gonk does not implement these composite ops yet
MOCHITEST_FILES += \
@ -123,9 +120,6 @@ MOCHITEST_FILES += \
test_2d.composite.solid.soft-light.html \
$(NULL)
endif
endif
ifneq (1_Linux,$(MOZ_SUITE)_$(OS_ARCH))
# This test fails in Suite on Linux for some reason, disable it there
MOCHITEST_FILES += test_2d.composite.uncovered.image.destination-atop.html

View File

@ -7,6 +7,7 @@
#include "nsContentUtils.h"
#include "nsClientRect.h"
#include "nsDOMDataTransfer.h"
#include "nsIClipboard.h"
nsDOMClipboardEvent::nsDOMClipboardEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
@ -68,7 +69,7 @@ nsDOMClipboardEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
// Always create a clipboardData for the copy event. If this is changed to
// support other types of events, make sure that read/write privileges are
// checked properly within nsDOMDataTransfer.
clipboardData = new nsDOMDataTransfer(NS_COPY, false);
clipboardData = new nsDOMDataTransfer(NS_COPY, false, -1);
clipboardData->SetData(aParam.mDataType, aParam.mData);
}
}
@ -93,10 +94,10 @@ nsDOMClipboardEvent::GetClipboardData()
if (!event->clipboardData) {
if (mEventIsInternal) {
event->clipboardData = new nsDOMDataTransfer(NS_COPY, false);
event->clipboardData = new nsDOMDataTransfer(NS_COPY, false, -1);
} else {
event->clipboardData =
new nsDOMDataTransfer(event->message, event->message == NS_PASTE);
new nsDOMDataTransfer(event->message, event->message == NS_PASTE, nsIClipboard::kGlobalClipboard);
}
}

View File

@ -63,7 +63,7 @@ const char nsDOMDataTransfer::sEffects[8][9] = {
"none", "copy", "move", "copyMove", "link", "copyLink", "linkMove", "all"
};
nsDOMDataTransfer::nsDOMDataTransfer(uint32_t aEventType, bool aIsExternal)
nsDOMDataTransfer::nsDOMDataTransfer(uint32_t aEventType, bool aIsExternal, int32_t aClipboardType)
: mEventType(aEventType),
mDropEffect(nsIDragService::DRAGDROP_ACTION_NONE),
mEffectAllowed(nsIDragService::DRAGDROP_ACTION_UNINITIALIZED),
@ -72,6 +72,7 @@ nsDOMDataTransfer::nsDOMDataTransfer(uint32_t aEventType, bool aIsExternal)
mIsExternal(aIsExternal),
mUserCancelled(false),
mIsCrossDomainSubFrameDrop(false),
mClipboardType(aClipboardType),
mDragImageX(0),
mDragImageY(0)
{
@ -98,6 +99,7 @@ nsDOMDataTransfer::nsDOMDataTransfer(uint32_t aEventType,
bool aIsExternal,
bool aUserCancelled,
bool aIsCrossDomainSubFrameDrop,
int32_t aClipboardType,
nsTArray<nsTArray<TransferItem> >& aItems,
nsIDOMElement* aDragImage,
uint32_t aDragImageX,
@ -110,6 +112,7 @@ nsDOMDataTransfer::nsDOMDataTransfer(uint32_t aEventType,
mIsExternal(aIsExternal),
mUserCancelled(aUserCancelled),
mIsCrossDomainSubFrameDrop(aIsCrossDomainSubFrameDrop),
mClipboardType(aClipboardType),
mItems(aItems),
mDragImage(aDragImage),
mDragImageX(aDragImageX),
@ -653,7 +656,7 @@ nsDOMDataTransfer::Clone(uint32_t aEventType, bool aUserCancelled,
nsDOMDataTransfer* newDataTransfer =
new nsDOMDataTransfer(aEventType, mEffectAllowed, mCursorState,
mIsExternal, aUserCancelled, aIsCrossDomainSubFrameDrop,
mItems, mDragImage, mDragImageX, mDragImageY);
mClipboardType, mItems, mDragImage, mDragImageX, mDragImageY);
NS_ENSURE_TRUE(newDataTransfer, NS_ERROR_OUT_OF_MEMORY);
*aNewDataTransfer = newDataTransfer;
@ -979,7 +982,7 @@ nsDOMDataTransfer::CacheExternalClipboardFormats()
// data will only be retrieved when needed.
nsCOMPtr<nsIClipboard> clipboard = do_GetService("@mozilla.org/widget/clipboard;1");
if (!clipboard) {
if (!clipboard || mClipboardType < 0) {
return;
}
@ -994,8 +997,7 @@ nsDOMDataTransfer::CacheExternalClipboardFormats()
for (uint32_t f = 0; f < mozilla::ArrayLength(formats); ++f) {
// check each format one at a time
bool supported;
clipboard->HasDataMatchingFlavors(&(formats[f]), 1,
nsIClipboard::kGlobalClipboard, &supported);
clipboard->HasDataMatchingFlavors(&(formats[f]), 1, mClipboardType, &supported);
// if the format is supported, add an item to the array with null as
// the data. When retrieved, GetRealData will read the data.
if (supported) {
@ -1036,11 +1038,11 @@ nsDOMDataTransfer::FillInExternalData(TransferItem& aItem, uint32_t aIndex)
MOZ_ASSERT(aIndex == 0, "index in clipboard must be 0");
nsCOMPtr<nsIClipboard> clipboard = do_GetService("@mozilla.org/widget/clipboard;1");
if (!clipboard) {
if (!clipboard || mClipboardType < 0) {
return;
}
clipboard->GetData(trans, nsIClipboard::kGlobalClipboard);
clipboard->GetData(trans, mClipboardType);
} else {
nsCOMPtr<nsIDragSession> dragSession = nsContentUtils::GetDragSession();
if (!dragSession) {

View File

@ -58,6 +58,7 @@ protected:
bool aIsExternal,
bool aUserCancelled,
bool aIsCrossDomainSubFrameDrop,
int32_t aClipboardType,
nsTArray<nsTArray<TransferItem> >& aItems,
nsIDOMElement* aDragImage,
uint32_t aDragImageX,
@ -82,8 +83,10 @@ public:
// paste or a drag that was started without using a data transfer. The
// latter will occur when an external drag occurs, that is, a drag where the
// source is another application, or a drag is started by calling the drag
// service directly.
nsDOMDataTransfer(uint32_t aEventType, bool aIsExternal);
// service directly. For clipboard operations, aClipboardType indicates
// which clipboard to use, from nsIClipboard, or -1 for non-clipboard operations,
// or if access to the system clipboard should not be allowed.
nsDOMDataTransfer(uint32_t aEventType, bool aIsExternal, int32_t aClipboardType);
void GetDragTarget(nsIDOMElement** aDragTarget)
{
@ -178,6 +181,10 @@ protected:
// data should be prevented
bool mIsCrossDomainSubFrameDrop;
// Indicates which clipboard type to use for clipboard operations. Ignored for
// drag and drop.
int32_t mClipboardType;
// array of items, each containing an array of format->data pairs
nsTArray<nsTArray<TransferItem> > mItems;

View File

@ -54,61 +54,27 @@ class nsEventTargetChainItem
private:
nsEventTargetChainItem(EventTarget* aTarget,
nsEventTargetChainItem* aChild = nullptr);
// This is the ETCI recycle pool, which is used to avoid some malloc/free
// churn. It's implemented as a linked list.
static nsEventTargetChainItem* sEtciRecyclePool;
static uint32_t sNumRecycledEtcis;
static const uint32_t kMaxNumRecycledEtcis = 128;
public:
static nsEventTargetChainItem* Create(EventTarget* aTarget,
nsEventTargetChainItem()
: mChild(nullptr), mParent(nullptr), mFlags(0), mItemFlags(0)
{
}
static nsEventTargetChainItem* Create(nsTArray<nsEventTargetChainItem>& aPool,
EventTarget* aTarget,
nsEventTargetChainItem* aChild = nullptr)
{
// Allocate from the ETCI recycle pool if possible.
void* place = nullptr;
if (sNumRecycledEtcis > 0) {
MOZ_ASSERT(sEtciRecyclePool);
place = sEtciRecyclePool;
sEtciRecyclePool = sEtciRecyclePool->mNext;
--sNumRecycledEtcis;
} else {
place = malloc(sizeof(nsEventTargetChainItem));
}
return place
? ::new (place) nsEventTargetChainItem(aTarget, aChild)
: nullptr;
return new (aPool.AppendElement()) nsEventTargetChainItem(aTarget, aChild);
}
static void Destroy(nsEventTargetChainItem* aItem)
{
// ::Destroy deletes ancestor chain.
nsEventTargetChainItem* item = aItem;
if (item->mChild) {
item->mChild->mParent = nullptr;
item->mChild = nullptr;
}
// Put destroyed ETCIs into the recycle pool if it's not already full.
while (item) {
nsEventTargetChainItem* parent = item->mParent;
item->~nsEventTargetChainItem();
if (sNumRecycledEtcis < kMaxNumRecycledEtcis) {
item->mNext = sEtciRecyclePool;
sEtciRecyclePool = item;
++sNumRecycledEtcis;
} else {
free(item);
}
item = parent;
}
}
static void ShutdownRecyclePool()
{
while (sEtciRecyclePool) {
nsEventTargetChainItem* tmp = sEtciRecyclePool;
sEtciRecyclePool = sEtciRecyclePool->mNext;
free(tmp);
// nsEventTargetChainItem objects are deleted when the pool goes out of
// the scope.
if (aItem->mChild) {
aItem->mChild->mParent = nullptr;
aItem->mChild = nullptr;
}
}
@ -233,21 +199,9 @@ public:
nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor,
nsCxPusher* aPusher);
static uint32_t MaxEtciCount() { return sMaxEtciCount; }
static void ResetMaxEtciCount()
{
MOZ_ASSERT(!sCurrentEtciCount, "Wrong time to call ResetMaxEtciCount()!");
sMaxEtciCount = 0;
}
nsCOMPtr<EventTarget> mTarget;
nsEventTargetChainItem* mChild;
union {
nsEventTargetChainItem* mParent;
// This is used only when recycling ETCIs.
nsEventTargetChainItem* mNext;
};
nsEventTargetChainItem* mParent;
uint16_t mFlags;
uint16_t mItemFlags;
nsCOMPtr<nsISupports> mItemData;
@ -255,14 +209,8 @@ public:
nsCOMPtr<EventTarget> mNewTarget;
// Cache mTarget's event listener manager.
nsRefPtr<nsEventListenerManager> mManager;
static uint32_t sMaxEtciCount;
static uint32_t sCurrentEtciCount;
};
nsEventTargetChainItem* nsEventTargetChainItem::sEtciRecyclePool = nullptr;
uint32_t nsEventTargetChainItem::sNumRecycledEtcis = 0;
nsEventTargetChainItem::nsEventTargetChainItem(EventTarget* aTarget,
nsEventTargetChainItem* aChild)
: mTarget(aTarget), mChild(aChild), mParent(nullptr), mFlags(0), mItemFlags(0)
@ -405,13 +353,9 @@ nsEventTargetChainItem::HandleEventTargetChain(
return NS_OK;
}
void NS_ShutdownEventTargetChainItemRecyclePool()
{
nsEventTargetChainItem::ShutdownRecyclePool();
}
nsEventTargetChainItem*
EventTargetChainItemForChromeTarget(nsINode* aNode,
EventTargetChainItemForChromeTarget(nsTArray<nsEventTargetChainItem>& aPool,
nsINode* aNode,
nsEventTargetChainItem* aChild = nullptr)
{
if (!aNode->IsInDoc()) {
@ -422,9 +366,9 @@ EventTargetChainItemForChromeTarget(nsINode* aNode,
NS_ENSURE_TRUE(piTarget, nullptr);
nsEventTargetChainItem* etci =
nsEventTargetChainItem::Create(piTarget->GetTargetForEventTargetChain(),
nsEventTargetChainItem::Create(aPool,
piTarget->GetTargetForEventTargetChain(),
aChild);
NS_ENSURE_TRUE(etci, nullptr);
if (!etci->IsValid()) {
nsEventTargetChainItem::Destroy(etci);
return nullptr;
@ -522,10 +466,12 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
// event dispatching is finished.
nsRefPtr<nsPresContext> kungFuDeathGrip(aPresContext);
// Try to limit malloc/free churn by using an array as a pool.
nsTArray<nsEventTargetChainItem> pool(128);
// Create the event target chain item for the event target.
nsEventTargetChainItem* targetEtci =
nsEventTargetChainItem::Create(target->GetTargetForEventTargetChain());
NS_ENSURE_TRUE(targetEtci, NS_ERROR_OUT_OF_MEMORY);
nsEventTargetChainItem::Create(pool, target->GetTargetForEventTargetChain());
if (!targetEtci->IsValid()) {
nsEventTargetChainItem::Destroy(targetEtci);
return NS_ERROR_FAILURE;
@ -571,7 +517,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
if (!preVisitor.mCanHandle && preVisitor.mAutomaticChromeDispatch && content) {
// Event target couldn't handle the event. Try to propagate to chrome.
nsEventTargetChainItem::Destroy(targetEtci);
targetEtci = EventTargetChainItemForChromeTarget(content);
targetEtci = EventTargetChainItemForChromeTarget(pool, content);
NS_ENSURE_STATE(targetEtci);
targetEtci->PreHandleEvent(preVisitor);
}
@ -584,11 +530,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
while (preVisitor.mParentTarget) {
EventTarget* parentTarget = preVisitor.mParentTarget;
nsEventTargetChainItem* parentEtci =
nsEventTargetChainItem::Create(preVisitor.mParentTarget, topEtci);
if (!parentEtci) {
rv = NS_ERROR_OUT_OF_MEMORY;
break;
}
nsEventTargetChainItem::Create(pool, preVisitor.mParentTarget, topEtci);
if (!parentEtci->IsValid()) {
rv = NS_ERROR_FAILURE;
break;
@ -613,7 +555,8 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
// propagate to chrome.
nsCOMPtr<nsINode> disabledTarget = do_QueryInterface(parentTarget);
if (disabledTarget) {
parentEtci = EventTargetChainItemForChromeTarget(disabledTarget,
parentEtci = EventTargetChainItemForChromeTarget(pool,
disabledTarget,
topEtci);
if (parentEtci) {
parentEtci->PreHandleEvent(preVisitor);

View File

@ -1585,6 +1585,7 @@ CrossProcessSafeEvent(const nsEvent& aEvent)
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_MOVE:
case NS_CONTEXTMENU:
return true;
default:
return false;
@ -2027,7 +2028,7 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
}
nsRefPtr<nsDOMDataTransfer> dataTransfer =
new nsDOMDataTransfer(NS_DRAGDROP_START, false);
new nsDOMDataTransfer(NS_DRAGDROP_START, false, -1);
if (!dataTransfer)
return;

View File

@ -29,15 +29,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLMediaElement
using HTMLMediaElement::GetPaused;
NS_FORWARD_NSIDOMHTMLMEDIAELEMENT(HTMLMediaElement::)

View File

@ -54,15 +54,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLCanvasElement
NS_DECL_NSIDOMHTMLCANVASELEMENT
@ -224,8 +215,6 @@ public:
nsresult GetContext(const nsAString& aContextId, nsISupports** aContext);
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
protected:
virtual JSObject* WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;

View File

@ -28,15 +28,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLMediaElement
using HTMLMediaElement::GetPaused;
NS_FORWARD_NSIDOMHTMLMEDIAELEMENT(HTMLMediaElement::)
@ -62,8 +53,6 @@ public:
virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel);
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
// WebIDL
uint32_t Width() const

View File

@ -22,7 +22,6 @@ EXPORTS += [
'nsIFormControl.h',
'nsIFormProcessor.h',
'nsIHTMLCollection.h',
'nsILink.h',
'nsIRadioGroupContainer.h',
'nsIRadioVisitor.h',
'nsITextControlElement.h',

View File

@ -1,52 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsILink_h___
#define nsILink_h___
#include "nsISupports.h"
#include "nsILinkHandler.h" // definition of nsLinkState
class nsIURI;
// IID for the nsILink interface
#define NS_ILINK_IID \
{ 0x6f374a11, 0x212d, 0x47d6, \
{ 0x94, 0xd1, 0xe6, 0x7c, 0x23, 0x4d, 0x34, 0x99 } }
/**
* This interface allows SelectorMatches to get the canonical
* URL pointed to by an element representing a link and allows
* it to store the visited state of a link element in the link.
* It is needed for performance reasons (to prevent copying of
* strings and excessive calls to history).
*/
class nsILink : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILINK_IID)
/**
* SetLinkState/GetHrefURI were moved to nsIContent.
* @see nsIContent
*/
/**
* Dispatch a LinkAdded event to the chrome event handler for this document.
* This is used to notify the chrome listeners when restoring a page
* presentation. Currently, this only applies to HTML <link> elements.
*/
NS_IMETHOD LinkAdded() = 0;
/**
* Dispatch a LinkRemoved event to the chrome event handler for this
* document. This is used to notify the chrome listeners when saving a page
* presentation (since the document is not torn down). Currently, this only
* applies to HTML <link> elements.
*/
NS_IMETHOD LinkRemoved() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsILink, NS_ILINK_IID)
#endif /* nsILink_h___ */

View File

@ -40,19 +40,8 @@ HTMLAnchorElement::~HTMLAnchorElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLAnchorElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLAnchorElement, Element)
// QueryInterface implementation for HTMLAnchorElement
NS_INTERFACE_TABLE_HEAD(HTMLAnchorElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED3(HTMLAnchorElement,
nsIDOMHTMLAnchorElement,
nsILink,
Link)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED2(HTMLAnchorElement, nsGenericHTMLElement,
nsIDOMHTMLAnchorElement, Link)
NS_IMPL_ELEMENT_CLONE(HTMLAnchorElement)

View File

@ -11,14 +11,12 @@
#include "mozilla/dom/Link.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsILink.h"
namespace mozilla {
namespace dom {
class HTMLAnchorElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLAnchorElement,
public nsILink,
public Link
{
public:
@ -35,15 +33,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
virtual bool Draggable() const MOZ_OVERRIDE;
@ -53,10 +42,6 @@ public:
// DOM memory reporter participant
NS_DECL_SIZEOF_EXCLUDING_THIS
// nsILink
NS_IMETHOD LinkAdded() MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD LinkRemoved() MOZ_OVERRIDE { return NS_OK; }
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers) MOZ_OVERRIDE;
@ -89,8 +74,6 @@ public:
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
virtual void OnDNSPrefetchDeferred();
virtual void OnDNSPrefetchRequested();
virtual bool HasDeferredDNSPrefetchRequest();

View File

@ -25,19 +25,8 @@ HTMLAreaElement::~HTMLAreaElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLAreaElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLAreaElement, Element)
// QueryInterface implementation for HTMLAreaElement
NS_INTERFACE_TABLE_HEAD(HTMLAreaElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED3(HTMLAreaElement,
nsIDOMHTMLAreaElement,
nsILink,
Link)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED2(HTMLAreaElement, nsGenericHTMLElement,
nsIDOMHTMLAreaElement, Link)
NS_IMPL_ELEMENT_CLONE(HTMLAreaElement)

View File

@ -12,7 +12,6 @@
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsILink.h"
#include "nsIURL.h"
class nsIDocument;
@ -22,7 +21,6 @@ namespace dom {
class HTMLAreaElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLAreaElement,
public nsILink,
public Link
{
public:
@ -35,24 +33,11 @@ public:
// DOM memory reporter participant
NS_DECL_SIZEOF_EXCLUDING_THIS
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
// nsIDOMHTMLAreaElement
NS_DECL_NSIDOMHTMLAREAELEMENT
// nsILink
NS_IMETHOD LinkAdded() MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD LinkRemoved() MOZ_OVERRIDE { return NS_OK; }
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE;
virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;
@ -79,8 +64,6 @@ public:
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
// WebIDL
// The XPCOM GetAlt is OK for us

View File

@ -30,16 +30,9 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Audio)
namespace mozilla {
namespace dom {
NS_IMPL_ADDREF_INHERITED(HTMLAudioElement, HTMLMediaElement)
NS_IMPL_RELEASE_INHERITED(HTMLAudioElement, HTMLMediaElement)
NS_INTERFACE_TABLE_HEAD(HTMLAudioElement)
NS_HTML_CONTENT_INTERFACES(HTMLMediaElement)
NS_INTERFACE_TABLE_INHERITED4(HTMLAudioElement, nsIDOMHTMLMediaElement,
nsIDOMHTMLAudioElement, nsITimerCallback,
nsIAudioChannelAgentCallback)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED4(HTMLAudioElement, HTMLMediaElement,
nsIDOMHTMLMediaElement, nsIDOMHTMLAudioElement,
nsITimerCallback, nsIAudioChannelAgentCallback)
NS_IMPL_ELEMENT_CLONE(HTMLAudioElement)

View File

@ -27,17 +27,8 @@ HTMLBRElement::~HTMLBRElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLBRElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLBRElement, Element)
// QueryInterface implementation for HTMLBRElement
NS_INTERFACE_TABLE_HEAD(HTMLBRElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLBRElement, nsIDOMHTMLBRElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLBRElement, nsGenericHTMLElement,
nsIDOMHTMLBRElement)
NS_IMPL_ELEMENT_CLONE(HTMLBRElement)

View File

@ -24,15 +24,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLBRElement
NS_DECL_NSIDOMHTMLBRELEMENT
@ -43,7 +34,6 @@ public:
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
bool Clear()
{

View File

@ -199,15 +199,8 @@ HTMLBodyElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aScope)
return HTMLBodyElementBinding::Wrap(aCx, aScope, this);
}
NS_IMPL_ADDREF_INHERITED(HTMLBodyElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLBodyElement, Element)
// QueryInterface implementation for HTMLBodyElement
NS_INTERFACE_TABLE_HEAD(HTMLBodyElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLBodyElement, nsIDOMHTMLBodyElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLBodyElement, nsGenericHTMLElement,
nsIDOMHTMLBodyElement)
NS_IMPL_ELEMENT_CLONE(HTMLBodyElement)

View File

@ -49,15 +49,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLBodyElement
NS_DECL_NSIDOMHTMLBODYELEMENT
@ -141,7 +132,6 @@ public:
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
virtual already_AddRefed<nsIEditor> GetAssociatedEditor() MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;

View File

@ -83,12 +83,10 @@ NS_IMPL_RELEASE_INHERITED(HTMLButtonElement, Element)
// QueryInterface implementation for HTMLButtonElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLButtonElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElementWithState)
NS_INTERFACE_TABLE_INHERITED2(HTMLButtonElement,
nsIDOMHTMLButtonElement,
nsIConstraintValidation)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLFormElementWithState)
// nsIConstraintValidation
NS_IMPL_NSICONSTRAINTVALIDATION(HTMLButtonElement)

View File

@ -31,17 +31,10 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLButtonElement, button)
// nsIDOMHTMLButtonElement
NS_DECL_NSIDOMHTMLBUTTONELEMENT
@ -59,7 +52,6 @@ public:
// nsINode
virtual nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
virtual JSObject* WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;

View File

@ -164,12 +164,10 @@ NS_IMPL_ADDREF_INHERITED(HTMLCanvasElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLCanvasElement, Element)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLCanvasElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED2(HTMLCanvasElement,
nsIDOMHTMLCanvasElement,
nsICanvasElementExternal)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLCanvasElement)

View File

@ -21,13 +21,6 @@ HTMLDataElement::~HTMLDataElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLDataElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLDataElement, Element)
NS_INTERFACE_MAP_BEGIN(HTMLDataElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLDataElement)
JSObject*

View File

@ -14,25 +14,12 @@
namespace mozilla {
namespace dom {
class HTMLDataElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
class HTMLDataElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLDataElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~HTMLDataElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// HTMLDataElement WebIDL
void GetValue(nsAString& aValue)
{
@ -47,7 +34,6 @@ public:
virtual void GetItemValueText(nsAString& text) MOZ_OVERRIDE;
virtual void SetItemValueText(const nsAString& text) MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
protected:
virtual JSObject* WrapNode(JSContext* aCx,

View File

@ -28,8 +28,7 @@ NS_IMPL_ADDREF_INHERITED(HTMLDataListElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLDataListElement, Element)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLDataListElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_ELEMENT_INTERFACE_MAP_END
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLDataListElement)

View File

@ -12,8 +12,7 @@
namespace mozilla {
namespace dom {
class HTMLDataListElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
class HTMLDataListElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLDataListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -25,15 +24,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
nsContentList* Options()
{
if (!mOptions) {
@ -52,8 +42,6 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLDataListElement,
nsGenericHTMLElement)
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
protected:
virtual JSObject* WrapNode(JSContext *aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;

View File

@ -20,15 +20,8 @@ HTMLDivElement::~HTMLDivElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLDivElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLDivElement, Element)
// QueryInterface implementation for HTMLDivElement
NS_INTERFACE_TABLE_HEAD(HTMLDivElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLDivElement, nsIDOMHTMLDivElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLDivElement, nsGenericHTMLElement,
nsIDOMHTMLDivElement)
NS_IMPL_ELEMENT_CLONE(HTMLDivElement)

View File

@ -25,15 +25,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLDivElement
NS_IMETHOD GetAlign(nsAString& aAlign) MOZ_OVERRIDE
{
@ -66,8 +57,6 @@ public:
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
protected:
virtual JSObject* WrapNode(JSContext *aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;

View File

@ -10,33 +10,19 @@
namespace mozilla {
namespace dom {
class HTMLElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
class HTMLElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~HTMLElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
using nsGenericHTMLElement::GetInnerHTML;
virtual void GetInnerHTML(nsAString& aInnerHTML,
mozilla::ErrorResult& aError) MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo* aNodeInfo,
nsINode** aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
virtual JSObject* WrapNode(JSContext *aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
@ -51,13 +37,6 @@ HTMLElement::~HTMLElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLElement, Element)
NS_INTERFACE_MAP_BEGIN(HTMLElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLElement)
void

View File

@ -43,12 +43,10 @@ NS_IMPL_RELEASE_INHERITED(HTMLFieldSetElement, Element)
// QueryInterface implementation for HTMLFieldSetElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLFieldSetElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
NS_INTERFACE_TABLE_INHERITED2(HTMLFieldSetElement,
nsIDOMHTMLFieldSetElement,
nsIConstraintValidation)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLFormElement)
NS_IMPL_ELEMENT_CLONE(HTMLFieldSetElement)

View File

@ -34,15 +34,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLFieldSetElement
NS_DECL_NSIDOMHTMLFIELDSETELEMENT
@ -61,7 +52,6 @@ public:
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) MOZ_OVERRIDE;
virtual bool IsDisabledForEvents(uint32_t aMessage) MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
const nsIContent* GetFirstLegend() const { return mFirstLegend; }

View File

@ -27,15 +27,6 @@ HTMLFontElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aScope)
return HTMLFontElementBinding::Wrap(aCx, aScope, this);
}
NS_IMPL_ADDREF_INHERITED(HTMLFontElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLFontElement, Element)
// QueryInterface implementation for HTMLFontElement
NS_INTERFACE_MAP_BEGIN(HTMLFontElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLFontElement)
bool

View File

@ -11,8 +11,7 @@
namespace mozilla {
namespace dom {
class HTMLFontElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
class HTMLFontElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -21,18 +20,6 @@ public:
}
virtual ~HTMLFontElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
void GetColor(nsString& aColor)
{
GetHTMLAttr(nsGkAtoms::color, aColor);
@ -65,7 +52,6 @@ public:
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
protected:
virtual JSObject* WrapNode(JSContext *aCx,

View File

@ -328,14 +328,12 @@ NS_IMPL_RELEASE_INHERITED(HTMLFormElement, Element)
// QueryInterface implementation for HTMLFormElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLFormElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED4(HTMLFormElement,
nsIDOMHTMLFormElement,
nsIForm,
nsIWebProgressListener,
nsIRadioGroupContainer)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
// nsIDOMHTMLFormElement
@ -1860,12 +1858,11 @@ HTMLFormElement::CheckFormValidity(nsIMutableArray* aInvalidElements) const
// Hold a reference to the elements so they can't be deleted while calling
// the invalid events.
for (uint32_t i = 0; i < len; ++i) {
static_cast<nsGenericHTMLElement*>(sortedControls[i])->AddRef();
sortedControls[i]->AddRef();
}
for (uint32_t i = 0; i < len; ++i) {
nsCOMPtr<nsIConstraintValidation> cvElmt =
do_QueryInterface((nsGenericHTMLElement*)sortedControls[i]);
nsCOMPtr<nsIConstraintValidation> cvElmt = do_QueryObject(sortedControls[i]);
if (cvElmt && cvElmt->IsCandidateForConstraintValidation() &&
!cvElmt->IsValid()) {
ret = false;
@ -1878,7 +1875,7 @@ HTMLFormElement::CheckFormValidity(nsIMutableArray* aInvalidElements) const
// Add all unhandled invalid controls to aInvalidElements if the caller
// requested them.
if (defaultAction && aInvalidElements) {
aInvalidElements->AppendElement((nsGenericHTMLElement*)sortedControls[i],
aInvalidElements->AppendElement(ToSupports(sortedControls[i]),
false);
}
}

View File

@ -52,15 +52,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLFormElement
NS_DECL_NSIDOMHTMLFORMELEMENT
@ -282,8 +273,6 @@ public:
*/
bool CheckValidFormSubmission();
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
/**
* Walk over the form elements and call SubmitNamesValues() on them to get
* their data pumped into the FormSubmitter.

View File

@ -25,17 +25,8 @@ HTMLFrameElement::~HTMLFrameElement()
}
NS_IMPL_ADDREF_INHERITED(HTMLFrameElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLFrameElement, Element)
// QueryInterface implementation for HTMLFrameElement
NS_INTERFACE_TABLE_HEAD(HTMLFrameElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFrameElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLFrameElement, nsIDOMHTMLFrameElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLFrameElement, nsGenericHTMLFrameElement,
nsIDOMHTMLFrameElement)
NS_IMPL_ELEMENT_CLONE(HTMLFrameElement)

View File

@ -29,15 +29,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLFrameElement
NS_DECL_NSIDOMHTMLFRAMEELEMENT
@ -49,7 +40,6 @@ public:
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
// WebIDL API
// The XPCOM GetFrameBorder is OK for us

View File

@ -23,17 +23,8 @@ HTMLFrameSetElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aScope)
return HTMLFrameSetElementBinding::Wrap(aCx, aScope, this);
}
NS_IMPL_ADDREF_INHERITED(HTMLFrameSetElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLFrameSetElement, Element)
// QueryInterface implementation for HTMLFrameSetElement
NS_INTERFACE_TABLE_HEAD(HTMLFrameSetElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLFrameSetElement,
nsIDOMHTMLFrameSetElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLFrameSetElement, nsGenericHTMLElement,
nsIDOMHTMLFrameSetElement)
NS_IMPL_ELEMENT_CLONE(HTMLFrameSetElement)

View File

@ -60,15 +60,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLFrameSetElement
NS_DECL_NSIDOMHTMLFRAMESETELEMENT
@ -148,7 +139,6 @@ public:
int32_t aModType) const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
protected:
virtual JSObject* WrapNode(JSContext *aCx,

View File

@ -20,17 +20,8 @@ HTMLHRElement::~HTMLHRElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLHRElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLHRElement, Element)
// QueryInterface implementation for HTMLHRElement
NS_INTERFACE_TABLE_HEAD(HTMLHRElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLHRElement,
nsIDOMHTMLHRElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLHRElement, nsGenericHTMLElement,
nsIDOMHTMLHRElement)
NS_IMPL_ELEMENT_CLONE(HTMLHRElement)

View File

@ -26,15 +26,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLHRElement
NS_DECL_NSIDOMHTMLHRELEMENT
@ -45,7 +36,6 @@ public:
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
// WebIDL API
void SetAlign(const nsAString& aAlign, ErrorResult& aError)

View File

@ -22,17 +22,8 @@ HTMLHeadingElement::~HTMLHeadingElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLHeadingElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLHeadingElement, Element)
// QueryInterface implementation for HTMLHeadingElement
NS_INTERFACE_TABLE_HEAD(HTMLHeadingElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLHeadingElement,
nsIDOMHTMLHeadingElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLHeadingElement, nsGenericHTMLElement,
nsIDOMHTMLHeadingElement)
NS_IMPL_ELEMENT_CLONE(HTMLHeadingElement)

View File

@ -26,15 +26,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLHeadingElement
NS_DECL_NSIDOMHTMLHEADINGELEMENT
@ -45,7 +36,6 @@ public:
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
// The XPCOM versions of GetAlign and SetAlign are fine for us for
// use from WebIDL.

View File

@ -29,16 +29,8 @@ HTMLIFrameElement::~HTMLIFrameElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLIFrameElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLIFrameElement, Element)
// QueryInterface implementation for HTMLIFrameElement
NS_INTERFACE_TABLE_HEAD(HTMLIFrameElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFrameElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLIFrameElement,
nsIDOMHTMLIFrameElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLIFrameElement, nsGenericHTMLFrameElement,
nsIDOMHTMLIFrameElement)
NS_IMPL_ELEMENT_CLONE(HTMLIFrameElement)

View File

@ -26,15 +26,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLIFrameElement
NS_DECL_NSIDOMHTMLIFRAMEELEMENT
@ -47,7 +38,6 @@ public:
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, bool aNotify)

View File

@ -66,14 +66,12 @@ NS_IMPL_RELEASE_INHERITED(HTMLImageElement, Element)
// QueryInterface implementation for HTMLImageElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLImageElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED4(HTMLImageElement,
nsIDOMHTMLImageElement,
nsIImageLoadingContent,
imgIOnloadBlocker,
imgINotificationObserver)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLImageElement)

View File

@ -31,15 +31,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
virtual bool Draggable() const MOZ_OVERRIDE;
// nsIDOMHTMLImageElement
@ -86,7 +77,6 @@ public:
nsresult CopyInnerTo(Element* aDest);
void MaybeLoadImage();
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
bool IsMap()
{

View File

@ -854,7 +854,6 @@ NS_IMPL_RELEASE_INHERITED(HTMLInputElement, Element)
// QueryInterface implementation for HTMLInputElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLInputElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElementWithState)
NS_INTERFACE_TABLE_INHERITED8(HTMLInputElement,
nsIDOMHTMLInputElement,
nsITextControlElement,
@ -864,8 +863,7 @@ NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLInputElement)
imgIOnloadBlocker,
nsIDOMNSEditableElement,
nsIConstraintValidation)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLFormElementWithState)
// nsIConstraintValidation
NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(HTMLInputElement)
@ -3119,7 +3117,8 @@ HTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
nsCOMPtr<nsIContent> radioContent =
do_QueryInterface(selectedRadioButton);
if (radioContent) {
rv = selectedRadioButton->Focus();
nsCOMPtr<nsIDOMHTMLElement> elem = do_QueryInterface(selectedRadioButton);
rv = elem->Focus();
if (NS_SUCCEEDED(rv)) {
nsEventStatus status = nsEventStatus_eIgnore;
nsMouseEvent event(aVisitor.mEvent->mFlags.mIsTrusted,

View File

@ -101,15 +101,8 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
using nsGenericHTMLElement::Focus;
virtual void Focus(ErrorResult& aError) MOZ_OVERRIDE;
// nsIDOMHTMLInputElement
@ -233,8 +226,6 @@ public:
void MaybeLoadImage();
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
// nsIConstraintValidation
bool IsTooLong();
bool IsValueMissing() const;

View File

@ -21,16 +21,8 @@ HTMLLIElement::~HTMLLIElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLLIElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLLIElement, Element)
// QueryInterface implementation for nsHTMLLIElement
NS_INTERFACE_TABLE_HEAD(HTMLLIElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLLIElement, nsIDOMHTMLLIElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLLIElement, nsGenericHTMLElement,
nsIDOMHTMLLIElement)
NS_IMPL_ELEMENT_CLONE(HTMLLIElement)

View File

@ -27,15 +27,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLLIElement
NS_DECL_NSIDOMHTMLLIELEMENT
@ -46,7 +37,6 @@ public:
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const MOZ_OVERRIDE;
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
// WebIDL API
void GetType(nsString& aType)

View File

@ -30,18 +30,8 @@ HTMLLabelElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aScope)
// nsISupports
NS_IMPL_ADDREF_INHERITED(HTMLLabelElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLLabelElement, Element)
// QueryInterface implementation for HTMLLabelElement
NS_INTERFACE_TABLE_HEAD(HTMLLabelElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLLabelElement,
nsIDOMHTMLLabelElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS_INHERITED1(HTMLLabelElement, nsGenericHTMLFormElement,
nsIDOMHTMLLabelElement)
// nsIDOMHTMLLabelElement
@ -56,7 +46,7 @@ HTMLLabelElement::GetForm(nsIDOMHTMLFormElement** aForm)
NS_IMETHODIMP
HTMLLabelElement::GetControl(nsIDOMHTMLElement** aElement)
{
nsCOMPtr<nsIDOMHTMLElement> element = do_QueryInterface(GetLabeledElement());
nsCOMPtr<nsIDOMHTMLElement> element = do_QueryObject(GetLabeledElement());
element.forget(aElement);
return NS_OK;
}
@ -84,7 +74,7 @@ HTMLLabelElement::Focus(ErrorResult& aError)
// retarget the focus method at the for content
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(GetLabeledElement());
nsCOMPtr<nsIDOMElement> elem = do_QueryObject(GetLabeledElement());
if (elem)
fm->SetFocus(elem, 0);
}

View File

@ -32,18 +32,9 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLLabelElement
NS_DECL_NSIDOMHTMLLABELELEMENT
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
using nsGenericHTMLFormElement::GetForm;
void GetHtmlFor(nsString& aHtmlFor)
{
@ -58,6 +49,7 @@ public:
return GetLabeledElement();
}
using nsGenericHTMLElement::Focus;
virtual void Focus(mozilla::ErrorResult& aError) MOZ_OVERRIDE;
// nsIFormControl
@ -73,8 +65,6 @@ public:
bool aIsTrustedEvent) MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
nsGenericHTMLElement* GetLabeledElement() const;
protected:
virtual JSObject* WrapNode(JSContext *aCx,

View File

@ -19,17 +19,6 @@ HTMLLegendElement::~HTMLLegendElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLLegendElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLLegendElement, Element)
// QueryInterface implementation for HTMLLegendElement
NS_INTERFACE_MAP_BEGIN(HTMLLegendElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLLegendElement)
// this contains center, because IE4 does

View File

@ -13,8 +13,7 @@
namespace mozilla {
namespace dom {
class HTMLLegendElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
class HTMLLegendElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -25,18 +24,7 @@ public:
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLLegendElement, legend)
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
using nsGenericHTMLElement::Focus;
virtual void Focus(ErrorResult& aError) MOZ_OVERRIDE;
virtual void PerformAccesskey(bool aKeyCausesActivation,
@ -74,8 +62,6 @@ public:
return fieldsetControl ? fieldsetControl->GetFormElement() : nullptr;
}
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
/**
* WebIDL Interface
*/

View File

@ -15,7 +15,6 @@
#include "nsIDocument.h"
#include "nsIDOMEvent.h"
#include "nsIDOMStyleSheet.h"
#include "nsILink.h"
#include "nsIStyleSheet.h"
#include "nsIStyleSheetLinkingElement.h"
#include "nsIURL.h"
@ -58,15 +57,12 @@ NS_IMPL_RELEASE_INHERITED(HTMLLinkElement, Element)
// QueryInterface implementation for HTMLLinkElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLLinkElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED5(HTMLLinkElement,
NS_INTERFACE_TABLE_INHERITED4(HTMLLinkElement,
nsIDOMHTMLLinkElement,
nsIDOMLinkStyle,
nsILink,
nsIStyleSheetLinkingElement,
Link)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLLinkElement)
@ -149,18 +145,16 @@ HTMLLinkElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
return rv;
}
NS_IMETHODIMP
void
HTMLLinkElement::LinkAdded()
{
CreateAndDispatchEvent(OwnerDoc(), NS_LITERAL_STRING("DOMLinkAdded"));
return NS_OK;
}
NS_IMETHODIMP
void
HTMLLinkElement::LinkRemoved()
{
CreateAndDispatchEvent(OwnerDoc(), NS_LITERAL_STRING("DOMLinkRemoved"));
return NS_OK;
}
void

View File

@ -10,7 +10,6 @@
#include "mozilla/dom/Link.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLLinkElement.h"
#include "nsILink.h"
#include "nsStyleLinkElement.h"
namespace mozilla {
@ -18,7 +17,6 @@ namespace dom {
class HTMLLinkElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLLinkElement,
public nsILink,
public nsStyleLinkElement,
public Link
{
@ -33,24 +31,14 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLLinkElement,
nsGenericHTMLElement)
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLLinkElement
NS_DECL_NSIDOMHTMLLINKELEMENT
// DOM memory reporter participant
NS_DECL_SIZEOF_EXCLUDING_THIS
// nsILink
NS_IMETHOD LinkAdded() MOZ_OVERRIDE;
NS_IMETHOD LinkRemoved() MOZ_OVERRIDE;
void LinkAdded();
void LinkRemoved();
// nsIDOMEventTarget
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
@ -58,7 +46,6 @@ public:
// nsINode
virtual nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
virtual JSObject* WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;

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