Merge m-c to b2g-inbound.

This commit is contained in:
Ryan VanderMeulen 2014-04-01 16:48:07 -04:00
commit 218c60a780
638 changed files with 9680 additions and 12506 deletions

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 989137 - /experiments needed clobber to build on OSX
Bug 988168 requires a clobber because of the location change for the linked libxul.

View File

@ -11,7 +11,7 @@
#include "xpcAccEvents.h"
#include "States.h"
#include "nsEventStateManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/Selection.h"
using namespace mozilla;
@ -33,7 +33,7 @@ AccEvent::AccEvent(uint32_t aEventType, Accessible* aAccessible,
mEventType(aEventType), mEventRule(aEventRule), mAccessible(aAccessible)
{
if (aIsFromUserInput == eAutoDetect)
mIsFromUserInput = nsEventStateManager::IsHandlingUserInput();
mIsFromUserInput = EventStateManager::IsHandlingUserInput();
else
mIsFromUserInput = aIsFromUserInput == eFromUserInput ? true : false;
}

View File

@ -12,12 +12,12 @@
#include "nsEventShell.h"
#include "Role.h"
#include "nsEventStateManager.h"
#include "nsFocusManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/dom/Element.h"
namespace dom = mozilla::dom;
using namespace mozilla::a11y;
namespace mozilla {
namespace a11y {
FocusManager::FocusManager()
{
@ -394,8 +394,9 @@ FocusManager::FocusedDOMNode() const
// residing in chrome process because it means an element in content process
// keeps the focus.
if (focusedElm) {
if (nsEventStateManager::IsRemoteTarget(focusedElm))
if (EventStateManager::IsRemoteTarget(focusedElm)) {
return nullptr;
}
return focusedElm;
}
@ -410,3 +411,6 @@ FocusManager::FocusedDOMDocument() const
nsINode* focusedNode = FocusedDOMNode();
return focusedNode ? focusedNode->OwnerDoc() : nullptr;
}
} // namespace a11y
} // namespace mozilla

View File

@ -19,11 +19,11 @@
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIScrollableFrame.h"
#include "nsEventStateManager.h"
#include "nsISelectionPrivate.h"
#include "nsISelectionController.h"
#include "mozilla/dom/TouchEvent.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/TouchEvents.h"
#include "nsView.h"
@ -162,7 +162,7 @@ nsCoreUtils::GetAccessKeyFor(nsIContent* aContent)
{
// Accesskeys are registered by @accesskey attribute only. At first check
// whether it is presented on the given element to avoid the slow
// nsEventStateManager::GetRegisteredAccessKey() method.
// EventStateManager::GetRegisteredAccessKey() method.
if (!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey))
return 0;
@ -174,7 +174,7 @@ nsCoreUtils::GetAccessKeyFor(nsIContent* aContent)
if (!presContext)
return 0;
nsEventStateManager *esm = presContext->EventStateManager();
EventStateManager *esm = presContext->EventStateManager();
if (!esm)
return 0;

View File

@ -78,7 +78,7 @@ public:
/**
* Return an accesskey registered on the given element by
* nsEventStateManager or 0 if there is no registered accesskey.
* EventStateManager or 0 if there is no registered accesskey.
*
* @param aContent - the given element.
*/

View File

@ -356,7 +356,7 @@ ARIAGridAccessible::SelectRow(uint32_t aRowIdx)
AccIterator rowIter(this, filters::GetRow);
Accessible* row = nullptr;
for (int32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
for (uint32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
DebugOnly<nsresult> rv = SetARIASelected(row, rowIdx == aRowIdx);
NS_ASSERTION(NS_SUCCEEDED(rv), "SetARIASelected() Shouldn't fail!");
}

View File

@ -28,7 +28,6 @@
#include "nsPIDOMWindow.h"
#include "nsIDOMXULPopupElement.h"
#include "nsIEditingSession.h"
#include "nsEventStateManager.h"
#include "nsIFrame.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsImageFrame.h"

View File

@ -154,7 +154,7 @@ XULMenuitemAccessible::AccessKey() const
static int32_t gMenuAccesskeyModifier = -1; // magic value of -1 indicates unitialized state
// We do not use nsCoreUtils::GetAccesskeyFor() because accesskeys for
// menu are't registered by nsEventStateManager.
// menu are't registered by EventStateManager.
nsAutoString accesskey;
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey,
accesskey);

View File

@ -116,17 +116,13 @@ exports["test nested frames"] = function(assert, done) {
});
};
// ignore about:blank pages and *-document-global-created
// events that are not very consistent.
// ignore http:// requests, as Fennec's `about:home` page
// displays add-ons a user could install
// ignore local `searchplugins` files loaded
// ignore *-document-global-created events that are not very consistent.
// only allow data uris that we create to ignore unwanted events, e.g.,
// about:blank, http:// requests from Fennec's `about:`home page that displays
// add-ons a user could install, local `searchplugins`, other chrome uris
// Calls callback if passes filter
function eventFilter (type, target, callback) {
if (target.URL !== "about:blank" &&
target.URL !== "about:home" &&
!target.URL.match(/^https?:\/\//i) &&
!target.URL.match(/searchplugins/) &&
if (target.URL.startsWith("data:text/html,") &&
type !== "chrome-document-global-created" &&
type !== "content-document-global-created")

View File

@ -265,7 +265,7 @@ pref("ui.highlight", "#b2f2ff");
pref("editor.singleLine.pasteNewlines", 2);
// threshold where a tap becomes a drag, in 1/240" reference pixels
// The names of the preferences are to be in sync with nsEventStateManager.cpp
// The names of the preferences are to be in sync with EventStateManager.cpp
pref("ui.dragThresholdX", 25);
pref("ui.dragThresholdY", 25);

View File

@ -1208,9 +1208,6 @@ pref("devtools.shadereditor.enabled", false);
// Enable the Canvas Debugger.
pref("devtools.canvasdebugger.enabled", false);
// Enable tools for Chrome development.
pref("devtools.chrome.enabled", false);
// Default theme ("dark" or "light")
pref("devtools.theme", "light");

View File

@ -20,7 +20,7 @@ var FullZoom = {
updateBackgroundTabs: undefined,
// One of the possible values for the mousewheel.* preferences.
// From nsEventStateManager.h.
// From EventStateManager.h.
ACTION_ZOOM: 3,
// This maps the browser to monotonically increasing integer
@ -84,7 +84,7 @@ var FullZoom = {
_handleMouseScrolled: function FullZoom__handleMouseScrolled(event) {
// Construct the "mousewheel action" pref key corresponding to this event.
// Based on nsEventStateManager::WheelPrefs::GetBasePrefName().
// Based on EventStateManager::WheelPrefs::GetBasePrefName().
var pref = "mousewheel.";
var pressedModifierCount = event.shiftKey + event.ctrlKey + event.altKey +
@ -119,7 +119,7 @@ var FullZoom = {
// We have to call _applyZoomToPref in a timeout because we handle the
// event before the event state manager has a chance to apply the zoom
// during nsEventStateManager::PostHandleEvent.
// during EventStateManager::PostHandleEvent.
let browser = gBrowser.selectedBrowser;
let token = this._getBrowserToken(browser);
window.setTimeout(function () {

View File

@ -3995,10 +3995,12 @@ var TabsProgressListener = {
// Collect telemetry data about tab load times.
if (aWebProgress.isTopLevel) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START)
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
Services.telemetry.getHistogramById("FX_TOTAL_TOP_VISITS").add(true);
} else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
TelemetryStopwatch.finish("FX_PAGE_LOAD_MS", aBrowser);
}
} else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
aStatus == Cr.NS_BINDING_ABORTED) {
TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS", aBrowser);

View File

@ -207,3 +207,16 @@ input[type=button] {
background-color: #fff;
opacity: 0.01;
}
/* PANEL */
#sponsored-panel {
width: 330px;
}
#sponsored-panel description {
margin: 0;
}
#sponsored-panel .text-link {
margin: 12px 0 0;
}

View File

@ -17,6 +17,14 @@
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&newtab.pageTitle;">
<xul:panel id="sponsored-panel" orient="vertical" type="arrow">
<xul:description>&newtab.panel.message;</xul:description>
<xul:label class="text-link"
href="&newtab.panel.link.url;"
onclick="this.parentNode.hidePopup();"
value="&newtab.panel.link.text;" />
</xul:panel>
<div id="newtab-scrollbox">
<div id="newtab-vertical-margin">

View File

@ -23,6 +23,9 @@ let gPage = {
let button = document.getElementById("newtab-toggle");
button.addEventListener("click", this, false);
// Initialize sponsored panel
this._sponsoredPanel = document.getElementById("sponsored-panel");
// Check if the new tab feature is enabled.
let enabled = gAllPages.enabled;
if (enabled)
@ -80,6 +83,21 @@ let gPage = {
}
},
/**
* Shows sponsored panel
*/
showSponsoredPanel: function Page_showSponsoredPanel(aTarget) {
if (this._sponsoredPanel.state == "closed") {
let self = this;
this._sponsoredPanel.addEventListener("popuphidden", function onPopupHidden(aEvent) {
self._sponsoredPanel.removeEventListener("popuphidden", onPopupHidden, false);
aTarget.removeAttribute("panelShown");
});
}
aTarget.setAttribute("panelShown", "true");
this._sponsoredPanel.openPopup(aTarget);
},
/**
* Internally initializes the page. This runs only when/if the feature
* is/gets enabled.

View File

@ -224,6 +224,8 @@ Site.prototype = {
aEvent.preventDefault();
if (aEvent.target.classList.contains("newtab-control-block"))
this.block();
else if (target.classList.contains("newtab-control-sponsored"))
gPage.showSponsoredPanel(target);
else if (this.isPinned())
this.unpin();
else

View File

@ -1668,7 +1668,7 @@ nsContextMenu.prototype = {
// Formats the 'Search <engine> for "<selection or link text>"' context menu.
formatSearchContextItem: function() {
var menuItem = document.getElementById("context-searchselect");
var selectedText = this.onLink ? this.linkText() : this.textSelected;
var selectedText = this.isTextSelected ? this.textSelected : this.linkText();
// Store searchTerms in context menu item so we know what to search onclick
menuItem.searchTerms = selectedText;

View File

@ -229,6 +229,7 @@ skip-if = true # browser_drag.js is disabled, as it needs to be updated for the
[browser_keywordSearch.js]
[browser_keywordSearch_postData.js]
[browser_lastAccessedTab.js]
skip-if = toolkit == "windows" # Disabled on Windows due to frequent failures (bug 969405)
[browser_locationBarCommand.js]
skip-if = os == "linux" # Intermittent failures, bug 917535
[browser_locationBarExternalLoad.js]

View File

@ -94,6 +94,20 @@ function test() {
shouldBeShown: false,
});
testElement({
id: "partialLink",
isSelected: true,
shouldBeShown: true,
expectedLabelContents: "link selection",
});
testElement({
id: "partialLink",
isSelected: false,
shouldBeShown: true,
expectedLabelContents: "A partial link " + ellipsis,
});
// cleanup
document.popupNode = null;
gBrowser.removeCurrentTab();

View File

@ -10,5 +10,7 @@
<span id="mixedContent">
I'm some text, and <a href="http://mozilla.org">I'm a link!</a>
</span>
<a href="http://mozilla.org">A partial <span id="partialLink">link selection</span></a>
</body>
</html>

View File

@ -21,6 +21,7 @@ skip-if = os == "mac" # Intermittent failures, bug 898317
[browser_newtab_focus.js]
[browser_newtab_perwindow_private_browsing.js]
[browser_newtab_reset.js]
[browser_newtab_sponsored_icon_click.js]
[browser_newtab_tabsync.js]
[browser_newtab_undo.js]
[browser_newtab_unpin.js]

View File

@ -0,0 +1,33 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function runTests() {
yield setLinks("0");
yield addNewTabPageTab();
let site = getCell(0).node.querySelector(".newtab-site");
site.setAttribute("type", "sponsored");
let sponsoredPanel = getContentDocument().getElementById("sponsored-panel");
is(sponsoredPanel.state, "closed", "Sponsored panel must be closed");
function continueOnceOn(event) {
sponsoredPanel.addEventListener(event, function listener() {
sponsoredPanel.removeEventListener(event, listener);
executeSoon(TestRunner.next);
});
}
// test sponsoredPanel appearing upon a click
continueOnceOn("popupshown");
let sponsoredButton = site.querySelector(".newtab-control-sponsored");
yield EventUtils.synthesizeMouseAtCenter(sponsoredButton, {}, getContentWindow());
is(sponsoredPanel.state, "open", "Sponsored panel opens on click");
ok(sponsoredButton.hasAttribute("panelShown"), "Sponsored button has panelShown attribute");
// test sponsoredPanel hiding
continueOnceOn("popuphidden");
yield sponsoredPanel.hidePopup();
is(sponsoredPanel.state, "closed", "Sponsored panel correctly closed/hidden");
ok(!sponsoredButton.hasAttribute("panelShown"), "Sponsored button does not have panelShown attribute");
}

View File

@ -31,10 +31,10 @@
<label value="&options.selectDevToolsTheme.label;"/>
<radiogroup id="devtools-theme-box"
class="options-groupbox"
data-pref="devtools.theme"
orient="horizontal">
<radio checked="true" value="light" label="Metal"/>
<radio checked="false" disabled="true" value="light" label="&options.lightTheme.label;"/>
<radio checked="false" disabled="true" value="dark" label="&options.darkTheme.label;"/>
<radio value="light" label="&options.lightTheme.label;"/>
<radio value="dark" label="&options.darkTheme.label;"/>
</radiogroup>
<label value="&options.commonPrefs.label;"/>
<vbox id="commonprefs-options" class="options-groupbox">

View File

@ -114,6 +114,11 @@
<key id="key_openHelp"
keycode="VK_F1"
command="sp-cmd-documentationLink"/>
<key id="key_gotoLine"
key="&gotoLineCmd.key;"
command="key_gotoLine"
modifiers="accel"/>
</keyset>
<menubar id="sp-menubar">

View File

@ -79,7 +79,7 @@
const StylesheetUtils = devtools.require("sdk/stylesheet/utils");
let theme = Services.prefs.getCharPref("devtools.theme");
switchTheme("light");
switchTheme(theme);
gDevTools.on("pref-changed", handlePrefChange);
window.addEventListener("unload", function() {

View File

@ -15,12 +15,13 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PluralForm.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/devtools/event-emitter.js");
Cu.import("resource:///modules/devtools/gDevTools.jsm");
Cu.import("resource:///modules/devtools/StyleEditorUtil.jsm");
Cu.import("resource:///modules/devtools/SplitView.jsm");
Cu.import("resource:///modules/devtools/StyleSheetEditor.jsm");
const { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
const require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
const { PrefObserver, PREF_ORIG_SOURCES } = require("devtools/styleeditor/utils");
@ -429,60 +430,69 @@ StyleEditorUI.prototype = {
}
}, false);
// autofocus if it's a new user-created stylesheet
if (editor.isNew) {
this._selectEditor(editor);
}
Task.spawn(function* () {
// autofocus if it's a new user-created stylesheet
if (editor.isNew) {
yield this._selectEditor(editor);
}
if (this._styleSheetToSelect
&& this._styleSheetToSelect.href == editor.styleSheet.href) {
this.switchToSelectedSheet();
}
if (this._styleSheetToSelect
&& this._styleSheetToSelect.href == editor.styleSheet.href) {
yield this.switchToSelectedSheet();
}
// If this is the first stylesheet and there is no pending request to
// select a particular style sheet, select this sheet.
if (!this.selectedEditor && !this._styleSheetBoundToSelect
&& editor.styleSheet.styleSheetIndex == 0) {
this._selectEditor(editor);
}
// If this is the first stylesheet and there is no pending request to
// select a particular style sheet, select this sheet.
if (!this.selectedEditor && !this._styleSheetBoundToSelect
&& editor.styleSheet.styleSheetIndex == 0) {
yield this._selectEditor(editor);
}
this.emit("editor-added", editor);
this.emit("editor-added", editor);
}.bind(this)).then(null, Cu.reportError);
}.bind(this),
onShow: function(summary, details, data) {
let editor = data.editor;
this.selectedEditor = editor;
if (!editor.sourceEditor) {
// only initialize source editor when we switch to this view
let inputElement = details.querySelector(".stylesheet-editor-input");
editor.load(inputElement);
}
editor.onShow();
Task.spawn(function* () {
if (!editor.sourceEditor) {
// only initialize source editor when we switch to this view
let inputElement = details.querySelector(".stylesheet-editor-input");
yield editor.load(inputElement);
}
this.emit("editor-selected", editor);
editor.onShow();
this.emit("editor-selected", editor);
}.bind(this)).then(null, Cu.reportError);
}.bind(this)
});
},
/**
* Switch to the editor that has been marked to be selected.
*
* @return {Promise}
* Promise that will resolve when the editor is selected.
*/
switchToSelectedSheet: function() {
let sheet = this._styleSheetToSelect;
for each (let editor in this.editors) {
for (let editor of this.editors) {
if (editor.styleSheet.href == sheet.href) {
// The _styleSheetBoundToSelect will always hold the latest pending
// requested style sheet (with line and column) which is not yet
// selected by the source editor. Only after we select that particular
// editor and go the required line and column, it will become null.
this._styleSheetBoundToSelect = this._styleSheetToSelect;
this._selectEditor(editor, sheet.line, sheet.col);
this._styleSheetToSelect = null;
return;
return this._selectEditor(editor, sheet.line, sheet.col);
}
}
return promise.resolve();
},
/**
@ -494,19 +504,23 @@ StyleEditorUI.prototype = {
* Line number to jump to
* @param {number} col
* Column number to jump to
* @return {Promise}
* Promise that will resolve when the editor is selected.
*/
_selectEditor: function(editor, line, col) {
line = line || 0;
col = col || 0;
editor.getSourceEditor().then(() => {
let editorPromise = editor.getSourceEditor().then(() => {
editor.sourceEditor.setCursor({line: line, ch: col});
this._styleSheetBoundToSelect = null;
});
this.getEditorSummary(editor).then((summary) => {
let summaryPromise = this.getEditorSummary(editor).then((summary) => {
this._view.activeSummary = summary;
})
});
return promise.all([editorPromise, summaryPromise]);
},
getEditorSummary: function(editor) {

View File

@ -13,7 +13,7 @@ const Cu = Components.utils;
const require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
const Editor = require("devtools/sourceeditor/editor");
const promise = require("sdk/core/promise");
const {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
const {CssLogic} = require("devtools/styleinspector/css-logic");
const AutoCompleter = require("devtools/sourceeditor/autocomplete");
@ -246,6 +246,9 @@ StyleSheetEditor.prototype = {
* Create source editor and load state into it.
* @param {DOMElement} inputElement
* Element to load source editor in
*
* @return {Promise}
* Promise that will resolve when the style editor is loaded.
*/
load: function(inputElement) {
this._inputElement = inputElement;
@ -261,7 +264,9 @@ StyleSheetEditor.prototype = {
};
let sourceEditor = new Editor(config);
sourceEditor.appendTo(inputElement).then(() => {
sourceEditor.on("dirty-change", this._onPropertyChange);
return sourceEditor.appendTo(inputElement).then(() => {
if (Services.prefs.getBoolPref(AUTOCOMPLETION_PREF)) {
sourceEditor.extend(AutoCompleter);
sourceEditor.setupAutoCompletion(this.walker);
@ -289,8 +294,6 @@ StyleSheetEditor.prototype = {
this.emit("source-editor-load");
});
sourceEditor.on("dirty-change", this._onPropertyChange);
},
/**

View File

@ -9,7 +9,7 @@ const {Cc, Ci, Cu, Cr} = require("chrome");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
let promise = require("sdk/core/promise");
let {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
let EventEmitter = require("devtools/toolkit/event-emitter");
Cu.import("resource:///modules/devtools/StyleEditorUI.jsm");

View File

@ -88,16 +88,14 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
panel.UI.on("editor-added", testEditorAdded);
});
addTabAndOpenStyleEditors(1, testEditorAdded);
content.location = TESTCASE_URI;
}
function testEditorAdded(aEvent, aEditor) {
function testEditorAdded(panel) {
info("Editor added, getting the source editor and starting tests");
aEditor.getSourceEditor().then(editor => {
panel.UI.editors[0].getSourceEditor().then(editor => {
info("source editor found, starting tests.");
gEditor = editor.sourceEditor;
gPopup = gEditor.getAutocompletionPopup();
@ -184,16 +182,14 @@ function testAutocompletionDisabled() {
info("Starting test to check if autocompletion is disabled correctly.")
Services.prefs.setBoolPref(AUTOCOMPLETION_PREF, false);
addTabAndOpenStyleEditor(function(panel) {
panel.UI.on("editor-added", testEditorAddedDisabled);
});
addTabAndOpenStyleEditors(1, testEditorAddedDisabled);
content.location = TESTCASE_URI;
}
function testEditorAddedDisabled(aEvent, aEditor) {
function testEditorAddedDisabled(panel) {
info("Editor added, getting the source editor and starting tests");
aEditor.getSourceEditor().then(editor => {
panel.UI.editors[0].getSourceEditor().then(editor => {
ok(!editor.sourceEditor.getAutocompletionPopup,
"Autocompletion popup does not exist");
cleanup();

View File

@ -70,21 +70,9 @@ function test()
const EXPECTED_STYLE_SHEET_COUNT = 12;
waitForExplicitFinish();
let styleSheetCount = 0;
addTabAndOpenStyleEditor(function (aPanel) {
aPanel.UI.on("editor-added", function () {
++styleSheetCount;
info(styleSheetCount+" out of "+
EXPECTED_STYLE_SHEET_COUNT+" style sheets loaded");
if (styleSheetCount == EXPECTED_STYLE_SHEET_COUNT) {
ok(true, "all style sheets loaded");
// The right number of events have been received; check that
// they actually show up in the style editor UI.
is(aPanel.UI.editors.length, EXPECTED_STYLE_SHEET_COUNT,
"UI elements present");
finish();
}
});
});
// Wait for events until the right number of editors has been opened.
addTabAndOpenStyleEditors(EXPECTED_STYLE_SHEET_COUNT, () => finish());
content.location = TESTCASE_URI;
}

View File

@ -8,24 +8,16 @@ let gUI;
function test() {
waitForExplicitFinish();
let count = 0;
addTabAndOpenStyleEditor(function(panel) {
gUI = panel.UI;
gUI.on("editor-added", function(event, editor) {
count++;
if (count == 4) {
info("all editors added");
runTests();
}
})
});
addTabAndOpenStyleEditors(4, runTests);
content.location = TESTCASE_URI;
}
let timeoutID;
function runTests() {
function runTests(panel) {
gUI = panel.UI;
gBrowser.tabContainer.addEventListener("TabOpen", onTabAdded, false);
gUI.editors[0].getSourceEditor().then(onEditor0Attach);
gUI.editors[1].getSourceEditor().then(onEditor1Attach);
@ -50,16 +42,19 @@ function onEditor0Attach(aEditor) {
function onEditor1Attach(aEditor) {
info("second editor selected");
ok(aEditor.sourceEditor.hasFocus(),
"left mouse click has given editor 1 focus");
// Wait for the focus to be set.
executeSoon(function () {
ok(aEditor.sourceEditor.hasFocus(),
"left mouse click has given editor 1 focus");
// right mouse click should not open a new tab
EventUtils.synthesizeMouseAtCenter(
getStylesheetNameLinkFor(gUI.editors[2]),
{button: 1},
gPanelWindow);
// right mouse click should not open a new tab
EventUtils.synthesizeMouseAtCenter(
getStylesheetNameLinkFor(gUI.editors[2]),
{button: 1},
gPanelWindow);
setTimeout(finish, 0);
setTimeout(finish, 0);
});
}
function onTabAdded() {

View File

@ -18,7 +18,7 @@ function test()
].join("\n"));
waitForExplicitFinish();
addTabAndOpenStyleEditor(function (aPanel) {
addTabAndOpenStyleEditors(1, function (aPanel) {
let UI = aPanel.UI;
// Spam the _onNewDocument callback multiple times before the

View File

@ -10,16 +10,11 @@ function test()
waitForExplicitFinish();
let count = 0;
addTabAndOpenStyleEditor(function(panel) {
addTabAndOpenStyleEditors(2, function(panel) {
// we test against first stylesheet after all are ready
let UI = panel.UI;
UI.on("editor-added", function(event, editor) {
count++;
if (count == 2) {
// we test against first stylesheet after all are ready
let editor = UI.editors[0];
editor.getSourceEditor().then(runTests.bind(this, UI, editor));
}
})
let editor = UI.editors[0];
editor.getSourceEditor().then(runTests.bind(this, UI, editor));
});
content.location = TESTCASE_URI;

View File

@ -20,15 +20,10 @@ function test()
copy(TESTCASE_URI_HTML, "simple.html", function(htmlFile) {
copy(TESTCASE_URI_CSS, "simple.css", function(cssFile) {
addTabAndOpenStyleEditor(function(panel) {
addTabAndOpenStyleEditors(1, function(panel) {
let UI = panel.UI;
UI.on("editor-added", function(event, editor) {
if (editor.styleSheet.styleSheetIndex != 0) {
return; // we want to test against the first stylesheet
}
let editor = UI.editors[0];
editor.getSourceEditor().then(runTests.bind(this, editor));
})
let editor = UI.editors[0];
editor.getSourceEditor().then(runTests.bind(this, editor));
});
let uri = Services.io.newFileURI(htmlFile);

View File

@ -19,10 +19,7 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
gUI = panel.UI;
gUI.on("editor-added", testEditorAdded);
});
addTabAndCheckOnStyleEditorAdded(panel => gUI = panel.UI, testEditorAdded);
content.location = TESTCASE_URI;
}
@ -53,7 +50,7 @@ function testImport()
}
let gAddedCount = 0;
function testEditorAdded(aEvent, aEditor)
function testEditorAdded(aEditor)
{
if (++gAddedCount == 2) {
// test import after the 2 initial stylesheets have been loaded

View File

@ -11,20 +11,14 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
gUI = panel.UI;
gUI.on("editor-added", onEditorAdded);
});
addTabAndOpenStyleEditors(3, onEditorAdded);
content.location = TESTCASE_URI;
}
let gAddedCount = 0;
function onEditorAdded()
function onEditorAdded(panel)
{
if (++gAddedCount != 3) {
return;
}
gUI = panel.UI;
is(gUI.editors.length, 3,
"there are 3 stylesheets after loading @imports");

View File

@ -10,16 +10,13 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
gUI = panel.UI;
gUI.on("editor-added", testEditorAdded);
});
addTabAndCheckOnStyleEditorAdded(panel => gUI = panel.UI, testEditorAdded);
content.location = TESTCASE_URI;
}
let gEditorAddedCount = 0;
function testEditorAdded(aEvent, aEditor)
function testEditorAdded(aEditor)
{
if (aEditor.styleSheet.styleSheetIndex == 0) {
gEditorAddedCount++;

View File

@ -12,15 +12,14 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
addTabAndOpenStyleEditors(2, function(panel) {
gUI = panel.UI;
// First test that identifiers are correcly generated. If not other tests
// are likely to fail.
testIndentifierGeneration();
waitForEditors(2)
.then(saveFirstInlineStyleSheet)
saveFirstInlineStyleSheet()
.then(testFriendlyNamesAfterSave)
.then(reloadPage)
.then(testFriendlyNamesAfterSave)
@ -93,10 +92,9 @@ function navigateToAnotherPage() {
gUI = null;
addTabAndOpenStyleEditor(function(panel) {
addTabAndOpenStyleEditors(2, function(panel) {
gUI = panel.UI;
waitForEditors(2).then(deferred.resolve);
deferred.resolve();
});
content.location = SECOND_TEST_PAGE;

View File

@ -14,11 +14,9 @@ function test()
// *while* the page is still loading. The Style Editor should not signal that
// it is loaded until the accompanying content page is loaded.
addTabAndOpenStyleEditor(function(panel) {
panel.UI.on("editor-added", testEditorAdded);
addTabAndCheckOnStyleEditorAdded(function(panel) {
content.location = TESTCASE_URI;
});
}, testEditorAdded);
}
function testEditorAdded(event, editor)

View File

@ -13,10 +13,7 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
gUI = panel.UI;
gUI.on("editor-added", testEditorAdded);
});
addTabAndCheckOnStyleEditorAdded(panel => gUI = panel.UI, testEditorAdded);
content.location = TESTCASE_URI;
}
@ -27,10 +24,10 @@ let gOriginalHref;
let checksCompleted = 0;
function testEditorAdded(aEvent, aEditor)
function testEditorAdded(aEditor)
{
gAddedCount++;
if (gAddedCount == 2) {
info("added " + gAddedCount + " editors");
if (++gAddedCount == 2) {
waitForFocus(function () {// create a new style sheet
let newButton = gPanelWindow.document.querySelector(".style-editor-newButton");
ok(newButton, "'new' button exists");

View File

@ -14,11 +14,11 @@ function test()
// *while* the page is still loading. The Style Editor should not signal that
// it is loaded until the accompanying content page is loaded.
addTabAndOpenStyleEditor(function(panel) {
addTabAndCheckOnStyleEditorAdded(function(panel) {
panel.UI.once("stylesheets-reset", testDocumentLoad);
content.location = TESTCASE_URI;
});
}, () => {});
}
function testDocumentLoad(event)

View File

@ -10,12 +10,9 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
gUI = panel.UI;
gUI.on("editor-added", function(event, editor) {
editor.getSourceEditor().then(function() {
testEditor(editor);
});
addTabAndCheckOnStyleEditorAdded(panel => gUI = panel.UI, editor => {
editor.getSourceEditor().then(function() {
testEditor(editor);
});
});

View File

@ -15,18 +15,10 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
addTabAndOpenStyleEditors(2, function(panel) {
gContentWin = gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject;
gUI = panel.UI;
let count = 0;
gUI.on("editor-added", function editorAdded(event, editor) {
if (++count == 2) {
info("all editors added to UI");
gUI.off("editor-added", editorAdded);
gUI.editors[0].getSourceEditor().then(runTests);
}
})
gUI.editors[0].getSourceEditor().then(runTests);
});
content.location = TESTCASE_URI;

View File

@ -15,17 +15,10 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
addTabAndOpenStyleEditors(2, function(panel) {
gContentWin = gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject;
gUI = panel.UI;
let count = 0;
gUI.on("editor-added", function editorAdded(event, editor) {
if (++count == 2) {
gUI.off("editor-added", editorAdded);
gUI.editors[0].getSourceEditor().then(runTests);
}
})
gUI.editors[0].getSourceEditor().then(runTests);
});
content.location = TESTCASE_URI;

View File

@ -71,26 +71,19 @@ function test()
function openEditor(testcaseURI) {
let deferred = promise.defer();
addTabAndOpenStyleEditor((panel) => {
info("style editor panel opened");
addTabAndOpenStyleEditors(3, panel => {
let UI = panel.UI;
let count = 0;
UI.on("editor-added", (event, editor) => {
if (++count == 3) {
// wait for 3 editors - 1 for first style sheet, 1 for the
// generated style sheet, and 1 for original source after it
// loads and replaces the generated style sheet.
let editor = UI.editors[1];
// wait for 3 editors - 1 for first style sheet, 1 for the
// generated style sheet, and 1 for original source after it
// loads and replaces the generated style sheet.
let editor = UI.editors[1];
let link = getStylesheetNameLinkFor(editor);
link.click();
let link = getStylesheetNameLinkFor(editor);
link.click();
editor.getSourceEditor().then(deferred.resolve);
}
});
})
editor.getSourceEditor().then(deferred.resolve);
});
content.location = testcaseURI;
return deferred.promise;

View File

@ -12,18 +12,10 @@ function test()
Services.prefs.setBoolPref(PREF, true);
let count = 0;
addTabAndOpenStyleEditor(function(panel) {
let UI = panel.UI;
UI.on("editor-added", (event, editor) => {
if (++count == 3) {
// wait for 3 editors - 1 for first style sheet, 1 for the
// generated style sheet, and 1 for original source after it
// loads and replaces the generated style sheet.
runTests(UI);
}
})
});
// wait for 3 editors - 1 for first style sheet, 1 for the
// generated style sheet, and 1 for original source after it
// loads and replaces the generated style sheet.
addTabAndOpenStyleEditors(3, panel => runTests(panel.UI));
content.location = TESTCASE_URI;
}

View File

@ -10,20 +10,14 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
gUI = panel.UI;
gUI.on("editor-added", function(event, editor) {
if (editor == gUI.editors[3]) {
runTests();
}
});
});
addTabAndOpenStyleEditors(4, runTests);
content.location = TESTCASE_URI;
}
function runTests()
function runTests(panel)
{
gUI = panel.UI;
gUI.editors[0].getSourceEditor().then(onEditor0Attach);
gUI.editors[2].getSourceEditor().then(onEditor2Attach);
}
@ -70,9 +64,12 @@ function onEditor0Attach(aEditor)
function onEditor2Attach(aEditor)
{
ok(aEditor.sourceEditor.hasFocus(),
"editor 2 has focus");
// Wait for the focus to be set.
executeSoon(function () {
ok(aEditor.sourceEditor.hasFocus(),
"editor 2 has focus");
gUI = null;
finish();
gUI = null;
finish();
});
}

View File

@ -11,15 +11,7 @@ function test()
{
waitForExplicitFinish();
addTabAndOpenStyleEditor(function(panel) {
let UI = panel.UI;
UI.on("editor-added", function(event, editor) {
if (editor == UI.editors[1]) {
// wait until both editors are added
runTests(UI);
}
});
});
addTabAndOpenStyleEditors(2, panel => runTests(panel.UI));
content.location = TESTCASE_URI;
}

View File

@ -36,11 +36,32 @@ function cleanup()
}
}
function addTabAndOpenStyleEditor(callback) {
function addTabAndOpenStyleEditors(count, callback) {
let currentCount = 0;
let panel;
addTabAndCheckOnStyleEditorAdded(p => panel = p, function () {
currentCount++;
info(currentCount + " of " + count + " editors opened");
if (currentCount == count) {
callback(panel);
}
});
}
function addTabAndCheckOnStyleEditorAdded(callbackOnce, callbackOnAdded) {
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
openStyleEditorInWindow(window, callback);
openStyleEditorInWindow(window, function (panel) {
// Execute the individual callback with the panel argument.
callbackOnce(panel);
// Report editors that already opened while loading.
for (let editor of panel.UI.editors) {
callbackOnAdded(editor);
}
// Report new editors added afterwards.
panel.UI.on("editor-added", (event, editor) => callbackOnAdded(editor));
});
}, true);
}

View File

@ -9,7 +9,7 @@ const {Cc, Ci, Cu} = require("chrome");
const ToolDefinitions = require("main").Tools;
const {CssLogic} = require("devtools/styleinspector/css-logic");
const {ELEMENT_STYLE} = require("devtools/server/actors/styles");
const promise = require("sdk/core/promise");
const {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
const {EventEmitter} = require("devtools/toolkit/event-emitter");
const {OutputParser} = require("devtools/output-parser");
const {Tooltip} = require("devtools/shared/widgets/Tooltip");

View File

@ -7,7 +7,7 @@
"use strict";
const {Cc, Ci, Cu} = require("chrome");
const promise = require("sdk/core/promise");
const {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
const {CssLogic} = require("devtools/styleinspector/css-logic");
const {InplaceEditor, editableField, editableItem} = require("devtools/shared/inplace-editor");
const {ELEMENT_STYLE, PSEUDO_ELEMENTS} = require("devtools/server/actors/styles");
@ -129,16 +129,6 @@ function ElementStyle(aElement, aStore, aPageStyle) {
if (!("disabled" in this.store)) {
this.store.disabled = new WeakMap();
}
// To figure out how shorthand properties are interpreted by the
// engine, we will set properties on a dummy element and observe
// how their .style attribute reflects them as computed values.
this.dummyElementPromise = createDummyDocument().then(document => {
this.dummyElement = document.createElementNS(this.element.namespaceURI,
this.element.tagName);
document.documentElement.appendChild(this.dummyElement);
return this.dummyElement;
}).then(null, promiseWarn);
}
// We're exporting _ElementStyle for unit tests.
@ -152,6 +142,19 @@ ElementStyle.prototype = {
// to figure out how shorthand properties will be parsed.
dummyElement: null,
init: function()
{
// To figure out how shorthand properties are interpreted by the
// engine, we will set properties on a dummy element and observe
// how their .style attribute reflects them as computed values.
return this.dummyElementPromise = createDummyDocument().then(document => {
this.dummyElement = document.createElementNS(this.element.namespaceURI,
this.element.tagName);
document.documentElement.appendChild(this.dummyElement);
return this.dummyElement;
}).then(null, promiseWarn);
},
destroy: function() {
this.dummyElement = null;
this.dummyElementPromise.then(dummyElement => {
@ -1383,7 +1386,9 @@ CssRuleView.prototype = {
}
this._elementStyle = new ElementStyle(aElement, this.store, this.pageStyle);
return this._populate().then(() => {
return this._elementStyle.init().then(() => {
return this._populate();
}).then(() => {
// A new node may already be selected, in which this._elementStyle will
// be null.
if (this._elementStyle) {

View File

@ -23,7 +23,7 @@ let {CssHtmlTree} = devtools.require("devtools/styleinspector/computed-view");
let {CssRuleView, _ElementStyle} = devtools.require("devtools/styleinspector/rule-view");
let {CssLogic, CssSelector} = devtools.require("devtools/styleinspector/css-logic");
let promise = devtools.require("sdk/core/promise");
let {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
gDevTools.testing = true;
SimpleTest.registerCleanupFunction(() => {

View File

@ -8,3 +8,6 @@
<!ENTITY newtab.undo.undoButton "Undo.">
<!ENTITY newtab.undo.restoreButton "Restore All.">
<!ENTITY newtab.undo.closeTooltip "Hide">
<!ENTITY newtab.panel.message "This site is being suggested because it has sponsored Mozilla, helping us promote openness, innovation and opportunity on the Web.">
<!ENTITY newtab.panel.link.url "https://support.mozilla.org/kb/how-do-sponsored-tiles-work">
<!ENTITY newtab.panel.link.text "Learn more…">

View File

@ -551,7 +551,7 @@ pref("services.sync.prefs.sync.signon.rememberSignons", true);
#endif
// threshold where a tap becomes a drag, in 1/240" reference pixels
// The names of the preferences are to be in sync with nsEventStateManager.cpp
// The names of the preferences are to be in sync with EventStateManager.cpp
pref("ui.dragThresholdX", 50);
pref("ui.dragThresholdY", 50);

View File

@ -176,7 +176,6 @@ browser.jar:
* skin/classic/browser/devtools/common.css (../shared/devtools/common.css)
* skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
* skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
skin/classic/browser/devtools/metal.jpg (../shared/devtools/images/metal.jpg)
skin/classic/browser/devtools/filters.svg (../shared/devtools/filters.svg)
skin/classic/browser/devtools/controls.png (../shared/devtools/images/controls.png)
skin/classic/browser/devtools/controls@2x.png (../shared/devtools/images/controls@2x.png)

View File

@ -183,3 +183,7 @@
.newtab-control-sponsored:hover {
background-position: -265px -1px;
}
.newtab-control-sponsored[panelShown] {
background-position: -281px -1px;
}

View File

@ -2765,8 +2765,8 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
content: '';
display: block;
-moz-appearance: toolbar;
height: calc(@tabHeight@ + 1px);
margin-bottom: calc(-1px - @tabHeight@);
height: @tabHeight@;
margin-bottom: -@tabHeight@;
visibility: hidden;
}
@ -3901,19 +3901,17 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
/* Lion Fullscreen window styling */
@media (-moz-mac-lion-theme) {
#navigator-toolbox[inFullscreen]:not(:-moz-lwtheme)::before {
height: calc(@tabHeight@ + 11px) !important;
/* Adjust by the full element height of #titlebar, since that element is
* not displayed in native full-screen.
* Also add the height of the tabs, since we're calculating the
* total height of this pseudo-element, not just the top-padding. */
height: calc(@tabHeight@ + @spaceAboveTabbar@) !important;
}
#main-window[inFullscreen][privatebrowsingmode=temporary],
#main-window[inFullscreen]:-moz-lwtheme {
/* This additional padding matches the change in height in the pseudo-element
* above. */
padding-top: 11px;
}
#main-window[inFullscreen]:not([privatebrowsingmode=temporary]):-moz-lwtheme {
/* In combination with the previous rule, forces the top 22px of the
* background image to be hidden, so the image doesn't jump around with
* the loss of the titlebar. */
background-position: right -11px;
/* Adjust by the full element height of #titlebar, since that element is
* not displayed in native full-screen. */
padding-top: @spaceAboveTabbar@;
}
}

View File

@ -297,7 +297,6 @@ browser.jar:
* skin/classic/browser/devtools/common.css (../shared/devtools/common.css)
* skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
* skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
skin/classic/browser/devtools/metal.jpg (../shared/devtools/images/metal.jpg)
skin/classic/browser/devtools/filters.svg (../shared/devtools/filters.svg)
skin/classic/browser/devtools/controls.png (../shared/devtools/images/controls.png)
skin/classic/browser/devtools/controls@2x.png (../shared/devtools/images/controls@2x.png)

View File

@ -194,3 +194,7 @@
.newtab-control-sponsored:hover {
background-position: -265px -1px;
}
.newtab-control-sponsored[panelShown] {
background-position: -281px -1px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

View File

@ -135,7 +135,6 @@
color: #585959;
background-color: #f0f1f2;
border-color: #aaa;
background-image: url("chrome://browser/skin/devtools/metal.jpg");
}
.ruleview-colorswatch,

View File

@ -15,7 +15,6 @@
padding: 4px 3px;
border-bottom-width: 1px;
border-bottom-style: solid;
font: 3mm "comic sans ms", Purisa, message-box !important;
}
.devtools-menulist,
@ -616,13 +615,11 @@
border: 0px solid;
border-bottom-width: 1px;
padding: 0;
font: 3mm "comic sans ms", Purisa, message-box !important;
}
.theme-light .devtools-tabbar {
box-shadow: 0 -2px 0 rgba(170,170,170,.1) inset;
background: #ebeced;
background-image: url("chrome://browser/skin/devtools/metal.jpg");
border-bottom-color: #aaa;
}

View File

@ -161,7 +161,7 @@
.theme-light #breadcrumb-separator-after,
.theme-light #breadcrumb-separator-before:after {
background: url("chrome://browser/skin/devtools/metal.jpg"); /* Toolbars */
background: #f0f1f2; /* Toolbars */
}
/* This chevron arrow cannot be replicated easily in CSS, so we are using

View File

@ -209,7 +209,6 @@ browser.jar:
* skin/classic/browser/devtools/common.css (../shared/devtools/common.css)
* skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
* skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
skin/classic/browser/devtools/metal.jpg (../shared/devtools/images/metal.jpg)
skin/classic/browser/devtools/filters.svg (../shared/devtools/filters.svg)
skin/classic/browser/devtools/controls.png (../shared/devtools/images/controls.png)
skin/classic/browser/devtools/controls@2x.png (../shared/devtools/images/controls@2x.png)
@ -558,7 +557,6 @@ browser.jar:
* skin/classic/aero/browser/devtools/common.css (../shared/devtools/common.css)
* skin/classic/aero/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
* skin/classic/aero/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
skin/classic/aero/browser/devtools/metal.jpg (../shared/devtools/images/metal.jpg)
skin/classic/aero/browser/devtools/filters.svg (../shared/devtools/filters.svg)
skin/classic/aero/browser/devtools/controls.png (../shared/devtools/images/controls.png)
skin/classic/aero/browser/devtools/controls@2x.png (../shared/devtools/images/controls@2x.png)

View File

@ -186,3 +186,7 @@
.newtab-control-sponsored:hover {
background-position: -265px -1px;
}
.newtab-control-sponsored[panelShown] {
background-position: -281px -1px;
}

View File

@ -6,5 +6,6 @@
EXPORTS += [
'nsJSPrincipals.h',
'nsNullPrincipal.h',
]

View File

@ -15,7 +15,6 @@
#include "nsIPrincipal.h"
#include "nsJSPrincipals.h"
#include "nsCOMPtr.h"
#include "nsPrincipal.h"
#include "nsIContentSecurityPolicy.h"
class nsIURI;

View File

@ -21,6 +21,7 @@
#include "nsNetCID.h"
#include "nsError.h"
#include "nsIScriptSecurityManager.h"
#include "nsPrincipal.h"
#include "nsScriptSecurityManager.h"
#include "pratom.h"

View File

@ -5,10 +5,7 @@
LIBFFI_DIRS = (('js/ctypes/libffi', 'libffi'),)
WEBIDLPARSER_DIR = 'dom/bindings/parser'
WEBIDLPARSER_REPO = 'https://hg.mozilla.org/users/khuey_mozilla.com/webidl-parser'
HG_EXCLUSIONS = ['.hg', '.hgignore', '.hgtags']
WEBIDLPARSER_EXCLUSIONS = HG_EXCLUSIONS + ['.gitignore', 'ply']
CVSROOT_LIBFFI = ':pserver:anoncvs@sources.redhat.com:/cvs/libffi'
@ -120,7 +117,7 @@ def update_nspr_or_nss(tag, depfile, destination, hgpath):
tag_file = destination + "/TAG-INFO"
print >>file(tag_file, "w"), tag
o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname | update_webidlparser tagname")
o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname")
o.add_option("--skip-mozilla", dest="skip_mozilla",
action="store_true", default=False,
help="Obsolete")
@ -161,9 +158,6 @@ elif action in ('update_libffi'):
if not options.cvsroot:
options.cvsroot = CVSROOT_LIBFFI
do_cvs_export(LIBFFI_DIRS, tag, options.cvsroot, options.cvs)
elif action in ('update_webidlparser'):
tag, = args[1:]
do_hg_replace(WEBIDLPARSER_DIR, WEBIDLPARSER_REPO, tag, WEBIDLPARSER_EXCLUSIONS, options.hg)
else:
o.print_help()
sys.exit(2)

View File

@ -340,7 +340,7 @@ _ENABLE_PIC=1
# Determine if module being compiled is destined
# to be merged into libxul
ifneq (,$(filter xul,$(FINAL_LIBRARY) $(LIBRARY_NAME)))
ifneq (,$(filter xul xul-%,$(FINAL_LIBRARY) $(LIBRARY_NAME)))
ifdef LIBXUL_LIBRARY
$(error LIBRARY_NAME or FINAL_LIBRARY is "xul", LIBXUL_LIBRARY is implied)
endif
@ -351,7 +351,7 @@ ifdef LIBXUL_LIBRARY
ifdef IS_COMPONENT
$(error IS_COMPONENT is set, but is not compatible with LIBXUL_LIBRARY)
endif
ifneq (xul,$(LIBRARY_NAME))
ifeq (,$(filter xul xul-%,$(LIBRARY_NAME)))
FORCE_STATIC_LIB=1
endif
endif

View File

@ -51,7 +51,6 @@ class ContentUnbinder;
class nsContentList;
class nsDOMTokenList;
struct nsRect;
class nsEventStateManager;
class nsFocusManager;
class nsGlobalWindow;
class nsICSSDeclaration;
@ -106,6 +105,7 @@ class EventChainPostVisitor;
class EventChainPreVisitor;
class EventChainVisitor;
class EventListenerManager;
class EventStateManager;
namespace dom {
@ -374,7 +374,7 @@ protected:
private:
// Need to allow the ESM, nsGlobalWindow, and the focus manager to
// set our state
friend class ::nsEventStateManager;
friend class mozilla::EventStateManager;
friend class ::nsGlobalWindow;
friend class ::nsFocusManager;

View File

@ -1881,7 +1881,7 @@ public:
/**
* Returns the time limit on handling user input before
* nsEventStateManager::IsHandlingUserInput() stops returning true.
* EventStateManager::IsHandlingUserInput() stops returning true.
* This enables us to detect long running user-generated event handlers.
*/
static TimeDuration HandlingUserInputTimeout();

View File

@ -225,7 +225,7 @@ interface nsIFrameLoader : nsISupports
/**
* The default event mode automatically forwards the events
* handled in nsEventStateManager::HandleCrossProcessEvent to
* handled in EventStateManager::HandleCrossProcessEvent to
* the child content process when these events are targeted to
* the remote browser element.
*

View File

@ -1780,7 +1780,7 @@ public:
void SetOn##name_(mozilla::dom::EventHandlerNonNull* listener);
#define TOUCH_EVENT EVENT
#define DOCUMENT_ONLY_EVENT EVENT
#include "nsEventNameList.h"
#include "mozilla/EventNameList.h"
#undef DOCUMENT_ONLY_EVENT
#undef TOUCH_EVENT
#undef EVENT

View File

@ -34,7 +34,6 @@
#include "nsStyleConsts.h"
#include "nsString.h"
#include "nsUnicharUtils.h"
#include "nsEventStateManager.h"
#include "nsIDOMEvent.h"
#include "nsDOMCID.h"
#include "nsIServiceManager.h"
@ -52,6 +51,7 @@
#include "mozilla/ContentEvents.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/TextEvents.h"
@ -2430,7 +2430,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
nsIFocusManager::FLAG_NOSCROLL);
}
nsEventStateManager::SetActiveManager(
EventStateManager::SetActiveManager(
aVisitor.mPresContext->EventStateManager(), this);
}
}

View File

@ -7,6 +7,7 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/dom/EventSourceBinding.h"
#include "mozilla/dom/MessageEvent.h"
@ -33,7 +34,6 @@
#include "xpcpublic.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsWrapperCacheInlines.h"
#include "nsDOMEventTargetHelper.h"
#include "mozilla/Attributes.h"
#include "nsError.h"
@ -56,7 +56,7 @@ namespace dom {
#define MAX_RECONNECTION_TIME_VALUE PR_IntervalToMilliseconds(DELAY_INTERVAL_LIMIT)
EventSource::EventSource(nsPIDOMWindow* aOwnerWindow) :
nsDOMEventTargetHelper(aOwnerWindow),
DOMEventTargetHelper(aOwnerWindow),
mStatus(PARSE_STATE_OFF),
mFrozen(false),
mErrorLoadOnRedirect(false),
@ -105,11 +105,11 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(EventSource)
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(EventSource,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(EventSource,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrc)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotificationCallbacks)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLoadGroup)
@ -119,7 +119,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(EventSource,
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mUnicodeDecoder)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(EventSource, nsDOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(EventSource,
DOMEventTargetHelper)
tmp->Close();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
@ -130,15 +131,15 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(EventSource)
NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(EventSource, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(EventSource, nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(EventSource, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(EventSource, DOMEventTargetHelper)
void
EventSource::DisconnectFromOwner()
{
nsDOMEventTargetHelper::DisconnectFromOwner();
DOMEventTargetHelper::DisconnectFromOwner();
Close();
}

View File

@ -14,7 +14,7 @@
#define mozilla_dom_EventSource_h
#include "mozilla/Attributes.h"
#include "nsDOMEventTargetHelper.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "nsIObserver.h"
#include "nsIStreamListener.h"
#include "nsIChannelEventSink.h"
@ -36,7 +36,7 @@ namespace dom {
class AsyncVerifyRedirectCallbackFwr;
struct EventSourceInit;
class EventSource : public nsDOMEventTargetHelper
class EventSource : public DOMEventTargetHelper
, public nsIObserver
, public nsIStreamListener
, public nsIChannelEventSink
@ -49,8 +49,8 @@ public:
EventSource(nsPIDOMWindow* aOwnerWindow);
virtual ~EventSource();
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(EventSource,
nsDOMEventTargetHelper)
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(
EventSource, DOMEventTargetHelper)
NS_DECL_NSIOBSERVER
NS_DECL_NSISTREAMLISTENER

View File

@ -20,26 +20,26 @@ namespace dom {
const uint64_t kUnknownSize = uint64_t(-1);
NS_IMPL_ADDREF_INHERITED(FileIOObject, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(FileIOObject, nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(FileIOObject, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(FileIOObject, DOMEventTargetHelper)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(FileIOObject)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_CLASS(FileIOObject)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(FileIOObject,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mProgressNotifier)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mError)
// Can't traverse mChannel because it's a multithreaded object.
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(FileIOObject,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mProgressNotifier)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mError)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mChannel)

View File

@ -6,7 +6,7 @@
#ifndef FileIOObject_h__
#define FileIOObject_h__
#include "nsDOMEventTargetHelper.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "nsIChannel.h"
#include "nsIFile.h"
#include "nsIDOMFile.h"
@ -28,7 +28,7 @@ extern const uint64_t kUnknownSize;
// A common base class for FileReader and FileSaver
class FileIOObject : public nsDOMEventTargetHelper,
class FileIOObject : public DOMEventTargetHelper,
public nsIStreamListener,
public nsITimerCallback
{
@ -65,8 +65,7 @@ public:
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileIOObject,
nsDOMEventTargetHelper)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileIOObject, DOMEventTargetHelper)
protected:
// Implemented by the derived class to do whatever it needs to do for abort

View File

@ -40,7 +40,6 @@
#include "nsStyleConsts.h"
#include "nsString.h"
#include "nsUnicharUtils.h"
#include "nsEventStateManager.h"
#include "nsIDOMEvent.h"
#include "nsDOMCID.h"
#include "nsIServiceManager.h"
@ -1766,12 +1765,21 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement)
classes.AppendLiteral("'");
}
nsAutoCString orphan;
if (!tmp->IsInDoc() &&
// Ignore xbl:content, which is never in the document and hence always
// appears to be orphaned.
!tmp->NodeInfo()->Equals(nsGkAtoms::content, kNameSpaceID_XBL)) {
orphan.AppendLiteral(" (orphan)");
}
const char* nsuri = nsid < ArrayLength(kNSURIs) ? kNSURIs[nsid] : "";
PR_snprintf(name, sizeof(name), "FragmentOrElement%s %s%s%s %s",
PR_snprintf(name, sizeof(name), "FragmentOrElement%s %s%s%s%s %s",
nsuri,
localName.get(),
NS_ConvertUTF16toUTF8(id).get(),
NS_ConvertUTF16toUTF8(classes).get(),
orphan.get(),
uri.get());
cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
}

View File

@ -10,6 +10,7 @@
#include "jsapi.h"
#include "jsfriendapi.h"
#include "js/OldDebugAPI.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDOMWindow.h"
#include "nsIDocument.h"
@ -39,7 +40,6 @@
#include "nsContentPolicyUtils.h"
#include "nsDOMFile.h"
#include "nsWrapperCacheInlines.h"
#include "nsDOMEventTargetHelper.h"
#include "nsIObserverService.h"
#include "nsIWebSocketChannel.h"
#include "GeneratedEvents.h"
@ -441,7 +441,7 @@ WebSocket::GetInterface(const nsIID& aIID, void** aResult)
////////////////////////////////////////////////////////////////////////////////
WebSocket::WebSocket(nsPIDOMWindow* aOwnerWindow)
: nsDOMEventTargetHelper(aOwnerWindow),
: DOMEventTargetHelper(aOwnerWindow),
mKeepingAlive(false),
mCheckMustKeepAlive(true),
mOnCloseScheduled(false),
@ -595,18 +595,18 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(WebSocket)
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(WebSocket,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(WebSocket,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPrincipal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mURI)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChannel)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(WebSocket,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
tmp->Disconnect();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mPrincipal)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mURI)
@ -619,15 +619,15 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(WebSocket)
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsIRequest)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(WebSocket, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(WebSocket, nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(WebSocket, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(WebSocket, DOMEventTargetHelper)
void
WebSocket::DisconnectFromOwner()
{
nsDOMEventTargetHelper::DisconnectFromOwner();
DOMEventTargetHelper::DisconnectFromOwner();
CloseConnection(nsIWebSocketChannel::CLOSE_GOING_AWAY);
DontKeepAliveAnyMore();
}

View File

@ -10,11 +10,11 @@
#include "mozilla/Attributes.h"
#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/WebSocketBinding.h" // for BinaryType
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/ErrorResult.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsDOMEventTargetHelper.h"
#include "nsIInterfaceRequestor.h"
#include "nsIObserver.h"
#include "nsIRequest.h"
@ -32,7 +32,7 @@
namespace mozilla {
namespace dom {
class WebSocket : public nsDOMEventTargetHelper,
class WebSocket : public DOMEventTargetHelper,
public nsIInterfaceRequestor,
public nsIWebSocketListener,
public nsIObserver,
@ -52,8 +52,8 @@ public:
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(WebSocket,
nsDOMEventTargetHelper)
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(
WebSocket, DOMEventTargetHelper)
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSIWEBSOCKETLISTENER
NS_DECL_NSIOBSERVER

View File

@ -43,6 +43,7 @@
#include "mozilla/dom/ShadowRoot.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/IMEStateManager.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/Likely.h"
@ -75,7 +76,6 @@
#include "nsDOMJSUtils.h"
#include "nsDOMMutationObserver.h"
#include "nsError.h"
#include "nsEventStateManager.h"
#include "nsFocusManager.h"
#include "nsGenericHTMLElement.h"
#include "nsGenericHTMLFrameElement.h"
@ -574,7 +574,7 @@ nsContentUtils::InitializeEventTable() {
{ nsGkAtoms::on##name_, _id, _type, _struct },
#define WINDOW_ONLY_EVENT EVENT
#define NON_IDL_EVENT EVENT
#include "nsEventNameList.h"
#include "mozilla/EventNameList.h"
#undef WINDOW_ONLY_EVENT
#undef EVENT
{ nullptr }
@ -606,7 +606,7 @@ nsContentUtils::InitializeTouchEventTable()
#define EVENT(name_, _id, _type, _struct)
#define TOUCH_EVENT(name_, _id, _type, _struct) \
{ nsGkAtoms::on##name_, _id, _type, _struct },
#include "nsEventNameList.h"
#include "mozilla/EventNameList.h"
#undef TOUCH_EVENT
#undef EVENT
{ nullptr }
@ -5031,7 +5031,7 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
aDragEvent->message == NS_DRAGDROP_END) {
// For the drop and dragend events, set the drop effect based on the
// last value that the dropEffect had. This will have been set in
// nsEventStateManager::PostHandleEvent for the last dragenter or
// EventStateManager::PostHandleEvent for the last dragenter or
// dragover event.
uint32_t dropEffect;
initialDataTransfer->GetDropEffectInt(&dropEffect);
@ -5844,7 +5844,7 @@ nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent)
// If the subdocument lives in another process, the frame is
// tabbable.
if (nsEventStateManager::IsRemoteTarget(aContent)) {
if (EventStateManager::IsRemoteTarget(aContent)) {
return true;
}
@ -6278,7 +6278,7 @@ bool
nsContentUtils::IsRequestFullScreenAllowed()
{
return !sTrustedFullScreenOnly ||
nsEventStateManager::IsHandlingUserInput() ||
EventStateManager::IsHandlingUserInput() ||
IsCallerChrome();
}
@ -6419,7 +6419,7 @@ nsContentUtils::IsInPointerLockContext(nsIDOMWindow* aWin)
}
nsCOMPtr<nsIDocument> pointerLockedDoc =
do_QueryReferent(nsEventStateManager::sPointerLockedDoc);
do_QueryReferent(EventStateManager::sPointerLockedDoc);
if (!pointerLockedDoc || !pointerLockedDoc->GetWindow()) {
return false;
}

View File

@ -25,7 +25,7 @@ extern PRLogModuleInfo* GetDataChannelLog();
#include "nsIDOMFile.h"
#include "nsIDOMDataChannel.h"
#include "nsIDOMMessageEvent.h"
#include "nsDOMEventTargetHelper.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "nsError.h"
#include "nsAutoPtr.h"
@ -66,24 +66,24 @@ nsDOMDataChannel::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataChannel)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMDataChannel,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMDataChannel,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_ADDREF_INHERITED(nsDOMDataChannel, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsDOMDataChannel, nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(nsDOMDataChannel, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsDOMDataChannel, DOMEventTargetHelper)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDataChannel)
NS_INTERFACE_MAP_ENTRY(nsIDOMDataChannel)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
nsDOMDataChannel::nsDOMDataChannel(already_AddRefed<mozilla::DataChannel>& aDataChannel,
nsPIDOMWindow* aWindow)
: nsDOMEventTargetHelper(aWindow && aWindow->IsOuterWindow() ?
aWindow->GetCurrentInnerWindow() : aWindow)
: DOMEventTargetHelper(aWindow && aWindow->IsOuterWindow() ?
aWindow->GetCurrentInnerWindow() : aWindow)
, mDataChannel(aDataChannel)
, mBinaryType(DC_BINARY_TYPE_BLOB)
{

View File

@ -8,10 +8,10 @@
#define nsDOMDataChannel_h
#include "mozilla/Attributes.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/dom/DataChannelBinding.h"
#include "mozilla/dom/TypedArray.h"
#include "mozilla/net/DataChannelListener.h"
#include "nsDOMEventTargetHelper.h"
#include "nsIDOMDataChannel.h"
#include "nsIInputStream.h"
@ -20,7 +20,7 @@ namespace mozilla {
class DataChannel;
};
class nsDOMDataChannel : public nsDOMEventTargetHelper,
class nsDOMDataChannel : public mozilla::DOMEventTargetHelper,
public nsIDOMDataChannel,
public mozilla::DataChannelListener
{
@ -34,10 +34,10 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMDATACHANNEL
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper)
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(mozilla::DOMEventTargetHelper)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDataChannel,
nsDOMEventTargetHelper)
mozilla::DOMEventTargetHelper)
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
MOZ_OVERRIDE;

View File

@ -35,13 +35,13 @@
#include "nsIScriptObjectPrincipal.h"
#include "nsHostObjectProtocolHandler.h"
#include "mozilla/Base64.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/EncodingUtils.h"
#include "mozilla/dom/FileReaderBinding.h"
#include "xpcpublic.h"
#include "nsIScriptSecurityManager.h"
#include "nsDOMJSUtils.h"
#include "nsDOMEventTargetHelper.h"
#include "jsfriendapi.h"
@ -69,7 +69,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(nsDOMFileReader,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResultArrayBuffer)
NS_IMPL_CYCLE_COLLECTION_TRACE_END

View File

@ -43,7 +43,7 @@ public:
NS_DECL_NSIDOMFILEREADER
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper)
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(mozilla::DOMEventTargetHelper)
// nsIInterfaceRequestor
NS_DECL_NSIINTERFACEREQUESTOR

View File

@ -43,6 +43,7 @@
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStateManager.h"
#include "nsIDOMNodeFilter.h"
#include "nsIDOMStyleSheet.h"
@ -158,7 +159,6 @@
#include "mozilla/dom/EncodingUtils.h"
#include "mozilla/dom/quota/QuotaManager.h"
#include "nsDOMNavigationTiming.h"
#include "nsEventStateManager.h"
#include "nsSMILAnimationController.h"
#include "imgIContainer.h"
@ -10593,7 +10593,7 @@ nsDocument::ExitFullscreen(nsIDocument* aDoc)
{
// Unlock the pointer, if it's locked.
nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
do_QueryReferent(EventStateManager::sPointerLockedElement);
if (pointerLockedElement) {
UnlockPointer();
}
@ -10658,7 +10658,7 @@ nsDocument::RestorePreviousFullScreenState()
// If fullscreen mode is updated the pointer should be unlocked
nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
do_QueryReferent(EventStateManager::sPointerLockedElement);
if (pointerLockedElement) {
UnlockPointer();
}
@ -10857,7 +10857,7 @@ nsDocument::CleanupFullscreenState()
Element* top = FullScreenStackTop();
NS_ASSERTION(top, "Should have a top when full-screen stack isn't empty");
if (top) {
nsEventStateManager::SetFullScreenState(top, false);
EventStateManager::SetFullScreenState(top, false);
}
mFullScreenStack.Clear();
}
@ -10878,9 +10878,9 @@ nsDocument::FullScreenStackPush(Element* aElement)
// We're pushing a new element onto the full-screen stack, so we must
// remove the ancestor and full-screen styles from the former top of the
// stack.
nsEventStateManager::SetFullScreenState(top, false);
EventStateManager::SetFullScreenState(top, false);
}
nsEventStateManager::SetFullScreenState(aElement, true);
EventStateManager::SetFullScreenState(aElement, true);
nsWeakPtr weakElement = do_GetWeakReference(aElement);
mFullScreenStack.AppendElement(weakElement);
NS_ASSERTION(GetFullScreenElement() == aElement, "Should match");
@ -10896,7 +10896,7 @@ nsDocument::FullScreenStackPop()
// Remove styles from existing top element.
Element* top = FullScreenStackTop();
nsEventStateManager::SetFullScreenState(top, false);
EventStateManager::SetFullScreenState(top, false);
// Remove top element. Note the remaining top element in the stack
// will not have full-screen style bits set, so we will need to restore
@ -10917,7 +10917,7 @@ nsDocument::FullScreenStackPop()
} else {
// The top element of the stack is now an in-doc element. Apply the
// full-screen styles and return.
nsEventStateManager::SetFullScreenState(element, true);
EventStateManager::SetFullScreenState(element, true);
break;
}
}
@ -11094,7 +11094,7 @@ nsDocument::RequestFullScreen(Element* aElement,
// If a document is already in fullscreen, then unlock the mouse pointer
// before setting a new document to fullscreen
nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
do_QueryReferent(EventStateManager::sPointerLockedElement);
if (pointerLockedElement) {
UnlockPointer();
}
@ -11488,7 +11488,7 @@ nsPointerLockPermissionRequest::Allow(JS::HandleValue aChoices)
Handled();
nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
do_QueryReferent(EventStateManager::sPointerLockedElement);
if (e == pointerLockedElement) {
DispatchPointerLockChange(d);
return NS_OK;
@ -11507,10 +11507,10 @@ nsPointerLockPermissionRequest::Allow(JS::HandleValue aChoices)
d->mCancelledPointerLockRequests = 0;
e->SetPointerLock();
nsEventStateManager::sPointerLockedElement = do_GetWeakReference(e);
nsEventStateManager::sPointerLockedDoc = do_GetWeakReference(doc);
NS_ASSERTION(nsEventStateManager::sPointerLockedElement &&
nsEventStateManager::sPointerLockedDoc,
EventStateManager::sPointerLockedElement = do_GetWeakReference(e);
EventStateManager::sPointerLockedDoc = do_GetWeakReference(doc);
NS_ASSERTION(EventStateManager::sPointerLockedElement &&
EventStateManager::sPointerLockedDoc,
"aElement and this should support weak references!");
DispatchPointerLockChange(d);
@ -11563,7 +11563,7 @@ nsDocument::RequestPointerLock(Element* aElement)
"Must pass non-null element to nsDocument::RequestPointerLock");
nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
do_QueryReferent(EventStateManager::sPointerLockedElement);
if (aElement == pointerLockedElement) {
DispatchPointerLockChange(this);
return;
@ -11574,7 +11574,7 @@ nsDocument::RequestPointerLock(Element* aElement)
return;
}
bool userInputOrChromeCaller = nsEventStateManager::IsHandlingUserInput() ||
bool userInputOrChromeCaller = EventStateManager::IsHandlingUserInput() ||
nsContentUtils::IsCallerChrome();
gPendingPointerLockRequest =
@ -11694,7 +11694,7 @@ nsDocument::SetPointerLock(Element* aElement, int aCursorStyle)
}
// Hide the cursor and set pointer lock for future mouse events
nsRefPtr<nsEventStateManager> esm = presContext->EventStateManager();
nsRefPtr<EventStateManager> esm = presContext->EventStateManager();
esm->SetCursor(aCursorStyle, nullptr, false,
0.0f, 0.0f, widget, true);
esm->SetPointerLock(widget, aElement);
@ -11705,12 +11705,12 @@ nsDocument::SetPointerLock(Element* aElement, int aCursorStyle)
void
nsDocument::UnlockPointer(nsIDocument* aDoc)
{
if (!nsEventStateManager::sIsPointerLocked) {
if (!EventStateManager::sIsPointerLocked) {
return;
}
nsCOMPtr<nsIDocument> pointerLockedDoc =
do_QueryReferent(nsEventStateManager::sPointerLockedDoc);
do_QueryReferent(EventStateManager::sPointerLockedDoc);
if (!pointerLockedDoc || (aDoc && aDoc != pointerLockedDoc)) {
return;
}
@ -11720,13 +11720,13 @@ nsDocument::UnlockPointer(nsIDocument* aDoc)
}
nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
do_QueryReferent(EventStateManager::sPointerLockedElement);
if (pointerLockedElement) {
pointerLockedElement->ClearPointerLock();
}
nsEventStateManager::sPointerLockedElement = nullptr;
nsEventStateManager::sPointerLockedDoc = nullptr;
EventStateManager::sPointerLockedElement = nullptr;
EventStateManager::sPointerLockedDoc = nullptr;
static_cast<nsDocument*>(pointerLockedDoc.get())->mAllowRelocking = !!aDoc;
gPendingPointerLockRequest = nullptr;
DispatchPointerLockChange(pointerLockedDoc);
@ -11758,14 +11758,14 @@ Element*
nsIDocument::GetMozPointerLockElement()
{
nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
do_QueryReferent(EventStateManager::sPointerLockedElement);
if (!pointerLockedElement) {
return nullptr;
}
// Make sure pointer locked element is in the same document.
nsCOMPtr<nsIDocument> pointerLockedDoc =
do_QueryReferent(nsEventStateManager::sPointerLockedDoc);
do_QueryReferent(EventStateManager::sPointerLockedDoc);
if (pointerLockedDoc != this) {
return nullptr;
}

View File

@ -53,6 +53,7 @@
#include "nsIMozBrowserFrame.h"
#include "nsIPermissionManager.h"
#include "nsISHistory.h"
#include "nsNullPrincipal.h"
#include "nsLayoutUtils.h"
#include "nsView.h"
@ -535,7 +536,17 @@ nsFrameLoader::ReallyStartLoadingInternal()
NS_ENSURE_SUCCESS(rv, rv);
}
loadInfo->SetReferrer(referrer);
// Use referrer as long as it is not an nsNullPrincipalURI.
// We could add a method such as GetReferrerURI to principals to make this
// cleaner, but given that we need to start using Source Browsing Context for
// referrer (see Bug 960639) this may be wasted effort at this stage.
if (referrer) {
bool isNullPrincipalScheme;
rv = referrer->SchemeIs(NS_NULLPRINCIPAL_SCHEME, &isNullPrincipalScheme);
if (NS_SUCCEEDED(rv) && !isNullPrincipalScheme) {
loadInfo->SetReferrer(referrer);
}
}
// Default flags:
int32_t flags = nsIWebNavigation::LOAD_FLAGS_NONE;

View File

@ -1433,7 +1433,7 @@ nsFrameScriptExecutor::LoadFrameScriptInternal(const nsAString& aURL,
ok = JS_CallFunctionValue(cx, global, methodVal,
JS::HandleValueArray::empty(), &rval);
} else if (script) {
ok = JS_ExecuteScript(cx, global, script, nullptr);
ok = JS_ExecuteScript(cx, global, script);
}
if (!ok) {

View File

@ -40,7 +40,6 @@
#include "nsDOMMutationObserver.h"
#include "nsDOMString.h"
#include "nsDOMTokenList.h"
#include "nsEventStateManager.h"
#include "nsFocusManager.h"
#include "nsFrameManager.h"
#include "nsFrameSelection.h"
@ -2260,7 +2259,7 @@ nsINode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
}
#define TOUCH_EVENT EVENT
#define DOCUMENT_ONLY_EVENT EVENT
#include "nsEventNameList.h"
#include "mozilla/EventNameList.h"
#undef DOCUMENT_ONLY_EVENT
#undef TOUCH_EVENT
#undef EVENT

View File

@ -144,7 +144,7 @@ nsInProcessTabChildGlobal::Init()
}
NS_IMPL_CYCLE_COLLECTION_INHERITED_2(nsInProcessTabChildGlobal,
nsDOMEventTargetHelper,
DOMEventTargetHelper,
mMessageManager,
mGlobal)
@ -158,10 +158,10 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsInProcessTabChildGlobal)
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ContentFrameMessageManager)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(nsInProcessTabChildGlobal, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsInProcessTabChildGlobal, nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(nsInProcessTabChildGlobal, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsInProcessTabChildGlobal, DOMEventTargetHelper)
NS_IMETHODIMP
nsInProcessTabChildGlobal::GetContent(nsIDOMWindow** aContent)
@ -217,7 +217,7 @@ nsInProcessTabChildGlobal::DelayedDisconnect()
mOwner = nullptr;
// Fire the "unload" event
nsDOMEventTargetHelper::DispatchTrustedEvent(NS_LITERAL_STRING("unload"));
DOMEventTargetHelper::DispatchTrustedEvent(NS_LITERAL_STRING("unload"));
// Continue with the Disconnect cleanup
nsCOMPtr<nsPIDOMWindow> win = do_GetInterface(mDocShell);

View File

@ -8,10 +8,10 @@
#define nsInProcessTabChildGlobal_h
#include "mozilla/Attributes.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "nsCOMPtr.h"
#include "nsFrameMessageManager.h"
#include "nsIScriptContext.h"
#include "nsDOMEventTargetHelper.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIScriptContext.h"
#include "nsIClassInfo.h"
@ -27,7 +27,7 @@ namespace mozilla {
class EventChainPreVisitor;
} // namespace mozilla
class nsInProcessTabChildGlobal : public nsDOMEventTargetHelper,
class nsInProcessTabChildGlobal : public mozilla::DOMEventTargetHelper,
public nsFrameScriptExecutor,
public nsIInProcessContentFrameMessageManager,
public nsIGlobalObject,
@ -41,7 +41,7 @@ public:
virtual ~nsInProcessTabChildGlobal();
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsInProcessTabChildGlobal,
nsDOMEventTargetHelper)
mozilla::DOMEventTargetHelper)
NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager)
NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager)
NS_IMETHOD SendSyncMessage(const nsAString& aMessageName,
@ -107,20 +107,21 @@ public:
bool aUseCapture)
{
// By default add listeners only for trusted events!
return nsDOMEventTargetHelper::AddEventListener(aType, aListener,
aUseCapture, false, 2);
return mozilla::DOMEventTargetHelper::AddEventListener(aType, aListener,
aUseCapture, false,
2);
}
NS_IMETHOD AddEventListener(const nsAString& aType,
nsIDOMEventListener* aListener,
bool aUseCapture, bool aWantsUntrusted,
uint8_t optional_argc) MOZ_OVERRIDE
{
return nsDOMEventTargetHelper::AddEventListener(aType, aListener,
aUseCapture,
aWantsUntrusted,
optional_argc);
return mozilla::DOMEventTargetHelper::AddEventListener(aType, aListener,
aUseCapture,
aWantsUntrusted,
optional_argc);
}
using nsDOMEventTargetHelper::AddEventListener;
using mozilla::DOMEventTargetHelper::AddEventListener;
virtual JSContext* GetJSContextForEventHandlers() MOZ_OVERRIDE { return nsContentUtils::GetSafeJSContext(); }
virtual nsIPrincipal* GetPrincipal() MOZ_OVERRIDE { return mPrincipal; }

View File

@ -1088,9 +1088,7 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
JS::CompileOptions options(entryScript.cx());
FillCompileOptionsForRequest(aRequest, global, &options);
nsJSUtils::EvaluateOptions evalOptions;
nsresult rv = nsJSUtils::EvaluateString(entryScript.cx(), aScript, global,
options, evalOptions, nullptr,
nsresult rv = nsJSUtils::EvaluateString(entryScript.cx(), aScript, global, options,
aOffThreadToken);
// Put the old script back in case it wants to do anything else.

View File

@ -234,24 +234,24 @@ XMLHttpRequestAuthPrompt::PromptPassword(const char16_t* aDialogTitle,
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXHREventTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXHREventTarget,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXHREventTarget,
nsDOMEventTargetHelper)
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXHREventTarget)
NS_INTERFACE_MAP_ENTRY(nsIXMLHttpRequestEventTarget)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(nsXHREventTarget, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsXHREventTarget, nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(nsXHREventTarget, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsXHREventTarget, DOMEventTargetHelper)
void
nsXHREventTarget::DisconnectFromOwner()
{
nsDOMEventTargetHelper::DisconnectFromOwner();
DOMEventTargetHelper::DisconnectFromOwner();
}
/////////////////////////////////////////////
@ -450,7 +450,7 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsXMLHttpRequest)
return tmp->
IsBlackAndDoesNotNeedTracing(static_cast<nsDOMEventTargetHelper*>(tmp));
IsBlackAndDoesNotNeedTracing(static_cast<DOMEventTargetHelper*>(tmp));
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsXMLHttpRequest)
@ -1410,7 +1410,7 @@ nsXMLHttpRequest::CreateReadystatechangeEvent(nsIDOMEvent** aDOMEvent)
}
void
nsXMLHttpRequest::DispatchProgressEvent(nsDOMEventTargetHelper* aTarget,
nsXMLHttpRequest::DispatchProgressEvent(DOMEventTargetHelper* aTarget,
const nsAString& aType,
bool aLengthComputable,
uint64_t aLoaded, uint64_t aTotal)
@ -2020,7 +2020,7 @@ nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
// principal.
const nsAString& emptyStr = EmptyString();
nsCOMPtr<nsIDOMDocument> responseDoc;
nsIGlobalObject* global = nsDOMEventTargetHelper::GetParentObject();
nsIGlobalObject* global = DOMEventTargetHelper::GetParentObject();
rv = NS_NewDOMDocument(getter_AddRefs(responseDoc),
emptyStr, emptyStr, nullptr, docURI,
baseURI, mPrincipal, true, global,

View File

@ -25,12 +25,12 @@
#include "nsJSUtils.h"
#include "nsTArray.h"
#include "nsITimer.h"
#include "nsDOMEventTargetHelper.h"
#include "nsIPrincipal.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsISizeOfEventTarget.h"
#include "mozilla/Assertions.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/XMLHttpRequestBinding.h"
@ -96,12 +96,12 @@ protected:
} // namespace mozilla
class nsXHREventTarget : public nsDOMEventTargetHelper,
class nsXHREventTarget : public mozilla::DOMEventTargetHelper,
public nsIXMLHttpRequestEventTarget
{
protected:
nsXHREventTarget(nsDOMEventTargetHelper* aOwner)
: nsDOMEventTargetHelper(aOwner)
nsXHREventTarget(mozilla::DOMEventTargetHelper* aOwner)
: mozilla::DOMEventTargetHelper(aOwner)
{
}
@ -118,9 +118,9 @@ public:
virtual ~nsXHREventTarget() {}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXHREventTarget,
nsDOMEventTargetHelper)
mozilla::DOMEventTargetHelper)
NS_DECL_NSIXMLHTTPREQUESTEVENTTARGET
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper)
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(mozilla::DOMEventTargetHelper)
IMPL_EVENT_HANDLER(loadstart)
IMPL_EVENT_HANDLER(progress)
@ -137,7 +137,7 @@ class nsXMLHttpRequestUpload MOZ_FINAL : public nsXHREventTarget,
public nsIXMLHttpRequestUpload
{
public:
nsXMLHttpRequestUpload(nsDOMEventTargetHelper* aOwner)
nsXMLHttpRequestUpload(mozilla::DOMEventTargetHelper* aOwner)
: nsXHREventTarget(aOwner)
{
}
@ -505,7 +505,7 @@ public:
// This creates a trusted readystatechange event, which is not cancelable and
// doesn't bubble.
nsresult CreateReadystatechangeEvent(nsIDOMEvent** aDOMEvent);
void DispatchProgressEvent(nsDOMEventTargetHelper* aTarget,
void DispatchProgressEvent(mozilla::DOMEventTargetHelper* aTarget,
const nsAString& aType,
bool aLengthComputable,
uint64_t aLoaded, uint64_t aTotal);

View File

@ -22,7 +22,7 @@ const Test = routine => () => {
// Returns promise for the observer notification subject for
// the given topic. If `receive("foo")` is called `n` times
// nth promise is resolved on an `nth` "foo" notification.
const receive = (topic, p) => {
const receive = (topic, p, syncCallback) => {
const { promise, resolve, reject } = Promise.defer();
const { queue } = receive;
const timeout = () => {
@ -43,6 +43,10 @@ const receive = (topic, p) => {
removeObserver(observer, topic);
clearTimeout(id, reject);
queue.splice(index, 2);
// Some tests need to be executed synchronously when the event is fired.
if (syncCallback) {
syncCallback(subject);
}
resolve(subject);
}
}
@ -73,7 +77,11 @@ const uri3 = "data:text/html;charset=utf-8,<h1>3</h1>";
const uri4 = "chrome://browser/content/license.html";
const test = Test(function*() {
let documentInteractive = receive("content-document-interactive", isData);
let documentInteractive = receive("content-document-interactive", isData, d => {
// This test is executed synchronously when the event is received.
is(d.readyState, "interactive", "document is interactive");
is(d.URL, uri1, "document.URL matches tab url");
});
let documentLoaded = receive("content-document-loaded", isData);
let pageShown = receive("content-page-shown", isData);
@ -82,8 +90,6 @@ const test = Test(function*() {
const browser1 = gBrowser.getBrowserForTab(tab1);
let interactiveDocument1 = yield documentInteractive;
is(interactiveDocument1.readyState, "interactive", "document is interactive");
is(interactiveDocument1.URL, uri1, "document.URL matches tab url");
let loadedDocument1 = yield documentLoaded;
is(loadedDocument1.readyState, "complete", "document is loaded");
@ -97,7 +103,11 @@ const test = Test(function*() {
info("load uri#2");
documentInteractive = receive("content-document-interactive", isData);
documentInteractive = receive("content-document-interactive", isData, d => {
// This test is executed synchronously when the event is received.
is(d.readyState, "interactive", "document is interactive");
is(d.URL, uri2, "document.URL matches URL loaded");
});
documentLoaded = receive("content-document-loaded", isData);
pageShown = receive("content-page-shown", isData);
let pageHidden = receive("content-page-hidden", isData);
@ -108,8 +118,6 @@ const test = Test(function*() {
is(interactiveDocument1, hiddenPage, "loaded document is hidden");
let interactiveDocument2 = yield documentInteractive;
is(interactiveDocument2.readyState, "interactive", "document is interactive");
is(interactiveDocument2.URL, uri2, "document.URL matches URL loaded");
let loadedDocument2 = yield documentLoaded;
is(loadedDocument2.readyState, "complete", "document is loaded");
@ -121,7 +129,11 @@ const test = Test(function*() {
info("go back to uri#1");
documentInteractive = receive("content-document-interactive", isData);
documentInteractive = receive("content-document-interactive", isData, d => {
// This test is executed synchronously when the event is received.
is(d.readyState, "interactive", "document is interactive");
is(d.URL, uri3, "document.URL matches URL loaded");
});
documentLoaded = receive("content-document-loaded", isData);
pageShown = receive("content-page-shown", isData);
pageHidden = receive("content-page-hidden", isData);
@ -139,8 +151,6 @@ const test = Test(function*() {
pageShown = receive("content-page-shown", isData);
let interactiveDocument3 = yield documentInteractive;
is(interactiveDocument3.readyState, "interactive", "document is interactive");
is(interactiveDocument3.URL, uri3, "document.URL matches URL loaded");
let loadedDocument3 = yield documentLoaded;
is(loadedDocument3.readyState, "complete", "document is loaded");
@ -154,13 +164,15 @@ const test = Test(function*() {
info("load chrome uri");
const tab2 = openTab(uri4);
documentInteractive = receive("chrome-document-interactive");
documentInteractive = receive("chrome-document-interactive", null, d => {
// This test is executed synchronously when the event is received.
is(d.readyState, "interactive", "document is interactive");
is(d.URL, uri4, "document.URL matches URL loaded");
});
documentLoaded = receive("chrome-document-loaded");
pageShown = receive("chrome-page-shown");
const interactiveDocument4 = yield documentInteractive;
is(interactiveDocument4.readyState, "interactive", "document is interactive");
is(interactiveDocument4.URL, uri4, "document.URL matches URL loaded");
let loadedDocument4 = yield documentLoaded;
is(loadedDocument4.readyState, "complete", "document is loaded");

View File

@ -4405,24 +4405,32 @@ CanvasPath::Constructor(const GlobalObject& aGlobal, const nsAString& aPathStrin
void
CanvasPath::ClosePath()
{
EnsurePathBuilder();
mPathBuilder->Close();
}
void
CanvasPath::MoveTo(double x, double y)
{
EnsurePathBuilder();
mPathBuilder->MoveTo(Point(ToFloat(x), ToFloat(y)));
}
void
CanvasPath::LineTo(double x, double y)
{
EnsurePathBuilder();
mPathBuilder->LineTo(Point(ToFloat(x), ToFloat(y)));
}
void
CanvasPath::QuadraticCurveTo(double cpx, double cpy, double x, double y)
{
EnsurePathBuilder();
mPathBuilder->QuadraticBezierTo(gfx::Point(ToFloat(cpx), ToFloat(cpy)),
gfx::Point(ToFloat(x), ToFloat(y)));
}
@ -4527,6 +4535,8 @@ CanvasPath::Arc(double x, double y, double radius,
void
CanvasPath::LineTo(const gfx::Point& aPoint)
{
EnsurePathBuilder();
mPathBuilder->LineTo(aPoint);
}
@ -4535,6 +4545,8 @@ CanvasPath::BezierTo(const gfx::Point& aCP1,
const gfx::Point& aCP2,
const gfx::Point& aCP3)
{
EnsurePathBuilder();
mPathBuilder->BezierTo(aCP1, aCP2, aCP3);
}
@ -4546,23 +4558,46 @@ CanvasPath::GetPath(const CanvasWindingRule& winding, const mozilla::RefPtr<mozi
fillRule = FillRule::FILL_EVEN_ODD;
}
RefPtr<Path> mTempPath = mPathBuilder->Finish();
if (!mTempPath)
return mTempPath;
// retarget our backend if we're used with a different backend
if (mTempPath->GetBackendType() != mTarget->GetType()) {
mPathBuilder = mTarget->CreatePathBuilder(fillRule);
mTempPath->StreamToSink(mPathBuilder);
mTempPath = mPathBuilder->Finish();
} else if (mTempPath->GetFillRule() != fillRule) {
mPathBuilder = mTempPath->CopyToBuilder(fillRule);
mTempPath = mPathBuilder->Finish();
if (mPath &&
(mPath->GetBackendType() == mTarget->GetType()) &&
(mPath->GetFillRule() == fillRule)) {
return mPath;
}
mPathBuilder = mTempPath->CopyToBuilder();
if (!mPath) {
// if there is no path, there must be a pathbuilder
MOZ_ASSERT(mPathBuilder);
mPath = mPathBuilder->Finish();
if (!mPath)
return mPath;
return mTempPath;
mPathBuilder = nullptr;
}
// retarget our backend if we're used with a different backend
if (mPath->GetBackendType() != mTarget->GetType()) {
RefPtr<PathBuilder> tmpPathBuilder = mTarget->CreatePathBuilder(fillRule);
mPath->StreamToSink(tmpPathBuilder);
mPath = tmpPathBuilder->Finish();
} else if (mPath->GetFillRule() != fillRule) {
RefPtr<PathBuilder> tmpPathBuilder = mPath->CopyToBuilder(fillRule);
mPath = tmpPathBuilder->Finish();
}
return mPath;
}
void
CanvasPath::EnsurePathBuilder() const
{
if (mPathBuilder) {
return;
}
// if there is not pathbuilder, there must be a path
MOZ_ASSERT(mPath);
mPathBuilder = mPath->CopyToBuilder();
mPath = nullptr;
}
}

View File

@ -96,7 +96,10 @@ private:
nsCOMPtr<nsISupports> mParent;
static gfx::Float ToFloat(double aValue) { return gfx::Float(aValue); }
mutable RefPtr<gfx::Path> mPath;
mutable RefPtr<gfx::PathBuilder> mPathBuilder;
void EnsurePathBuilder() const;
};
struct CanvasBidiProcessor;

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