This commit is contained in:
Wes Kocher 2014-11-06 18:24:57 -08:00
Родитель c3d79ec1df 108eafa20f
Коммит 1b52a64540
101 изменённых файлов: 720 добавлений и 450 удалений

Просмотреть файл

@ -1809,6 +1809,10 @@ pref("browser.polaris.enabled", false);
pref("privacy.trackingprotection.ui.enabled", false);
#endif
#ifdef NIGHTLY_BUILD
pref("browser.tabs.remote.autostart.1", true);
#endif
// Temporary pref to allow printing in e10s windows on some platforms.
#ifdef UNIX_BUT_NOT_MAC
pref("print.enable_e10s_testing", false);

Просмотреть файл

@ -2411,7 +2411,7 @@ let DefaultBrowserCheck = {
let E10SUINotification = {
// Increase this number each time we want to roll out an
// e10s testing period to Nightly users.
CURRENT_NOTICE_COUNT: 1,
CURRENT_NOTICE_COUNT: 2,
CURRENT_PROMPT_PREF: "browser.displayedE10SPrompt.1",
PREVIOUS_PROMPT_PREF: "browser.displayedE10SPrompt",
@ -2514,7 +2514,7 @@ let E10SUINotification = {
Services.prefs.setIntPref("browser.displayedE10SNotice", this.CURRENT_NOTICE_COUNT);
let nb = win.document.getElementById("high-priority-global-notificationbox");
let message = "Thanks for helping to test multiprocess Firefox (e10s). Some functions might not work yet."
let message = "You're now helping to test Process Separation (e10s)! Please report problems you find.";
let buttons = [
{
label: "Learn More",

Просмотреть файл

@ -92,9 +92,32 @@ var gMainPane = {
setEventListener("e10sAutoStart", "command",
gMainPane.enableE10SChange);
let e10sCheckbox = document.getElementById("e10sAutoStart");
let e10sPref = document.getElementById("browser.tabs.remote.autostart");
let e10sTempPref = document.getElementById("e10sTempPref");
e10sCheckbox.checked = e10sPref.value || e10sTempPref.value;
e10sCheckbox.checked = Services.appinfo.browserTabsRemoteAutostart;
// If e10s is blocked for some reason unrelated to prefs, we want to disable
// the checkbox.
if (!Services.appinfo.browserTabsRemoteAutostart) {
let e10sBlockedReason = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
let appinfo = Services.appinfo.QueryInterface(Ci.nsIObserver);
appinfo.observe(e10sBlockedReason, "getE10SBlocked", "")
if (e10sBlockedReason.data) {
if (e10sBlockedReason.data == "Safe mode") {
// If the only reason we're disabled is because of safe mode, then
// we want to allow the user to un-toggle the pref.
// We're relying on the nsAppRunner code only specifying "Safe mode"
// as the reason if the pref is otherwise enabled, and there are no
// other reasons to block e10s.
// Update the checkbox to reflect the pref state.
e10sCheckbox.checked = true;
} else {
e10sCheckbox.disabled = true;
e10sCheckbox.label += " (disabled: " + e10sBlockedReason.data + ")";
}
}
}
// If E10S is blocked because of safe mode, we want the checkbox to be
// enabled
#endif
#ifdef MOZ_DEV_EDITION

Просмотреть файл

@ -134,19 +134,19 @@ skip-if = e10s
[browser_dbg_break-on-dom-01.js]
skip-if = e10s
[browser_dbg_break-on-dom-02.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_break-on-dom-03.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_break-on-dom-04.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_break-on-dom-05.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_break-on-dom-06.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_break-on-dom-07.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_break-on-dom-08.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_break-on-dom-event-01.js]
skip-if = e10s || os == "mac" || e10s # Bug 895426
[browser_dbg_break-on-dom-event-02.js]
@ -308,33 +308,33 @@ skip-if = e10s
[browser_dbg_paused-keybindings.js]
skip-if = e10s
[browser_dbg_pretty-print-01.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-02.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-03.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-04.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-05.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-06.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-07.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-08.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-09.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-10.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-11.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-12.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-13.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_pretty-print-on-paused.js]
skip-if = e10s
skip-if = e10s && debug
[browser_dbg_progress-listener-bug.js]
skip-if = e10s
[browser_dbg_reload-preferred-script-01.js]

Просмотреть файл

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
let gDebugger = aPanel.panelWin;
let gView = gDebugger.DebuggerView;
let gEvents = gView.EventListeners;

Просмотреть файл

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
let gDebugger = aPanel.panelWin;
let gView = gDebugger.DebuggerView;
let gEvents = gView.EventListeners;

Просмотреть файл

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
let gDebugger = aPanel.panelWin;
let gView = gDebugger.DebuggerView;
let gController = gDebugger.DebuggerController

Просмотреть файл

@ -10,7 +10,7 @@
const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
let gDebugger = aPanel.panelWin;
let gView = gDebugger.DebuggerView;
let gController = gDebugger.DebuggerController

Просмотреть файл

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
let gDebugger = aPanel.panelWin;
let gView = gDebugger.DebuggerView;
let gController = gDebugger.DebuggerController

Просмотреть файл

@ -6,7 +6,7 @@
*/
function test() {
initDebugger("about:blank").then(([aTab, aDebuggee, aPanel]) => {
initDebugger("about:blank").then(([aTab,, aPanel]) => {
let gDebugger = aPanel.panelWin;
let gView = gDebugger.DebuggerView;
let gEvents = gView.EventListeners;

Просмотреть файл

@ -8,14 +8,15 @@
const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
let gTab = aTab;
let gDebugger = aPanel.panelWin;
let gView = gDebugger.DebuggerView;
let gEvents = gView.EventListeners;
Task.spawn(function() {
yield waitForSourceShown(aPanel, ".html");
aDebuggee.addBodyClickEventListener();
yield callInTab(gTab, "addBodyClickEventListener");
let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);
gView.toggleInstrumentsPane({ visible: true, animated: false }, 1);
@ -33,11 +34,7 @@ function test() {
yield ensureThreadClientState(aPanel, "resumed");
let paused = waitForCaretAndScopes(aPanel, 48);
// Spin the event loop before causing the debuggee to pause, to allow
// this function to yield first.
executeSoon(() => {
EventUtils.sendMouseEvent({ type: "click" }, aDebuggee.document.body, aDebuggee);
});
sendMouseClickToTab(gTab, content.document.body);
yield paused;
yield ensureThreadClientState(aPanel, "paused");

Просмотреть файл

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -76,7 +75,6 @@ function testSourceIsStillPretty() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

Просмотреть файл

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gContextMenu;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -49,7 +48,6 @@ function testSourceIsPretty() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

Просмотреть файл

@ -7,12 +7,11 @@
const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
@ -35,8 +34,7 @@ function test() {
function runCodeAndPause() {
const deferred = promise.defer();
once(gDebugger.gThreadClient, "paused").then(deferred.resolve);
// Have to executeSoon so that we don't pause before this function returns.
executeSoon(gDebuggee.foo);
callInTab(gTab, "foo");
return deferred.promise;
}
@ -46,7 +44,6 @@ function clickPrettyPrintButton() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
});

Просмотреть файл

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gSearchBox;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
@ -65,7 +64,6 @@ function testPrettyPrintedSearch() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSearchBox = null;

Просмотреть файл

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_included-script.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources, gControllerSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -68,7 +67,6 @@ function prepareDebugger(aPanel) {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

Просмотреть файл

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_included-script.html";
const JS_URL = EXAMPLE_URL + "code_location-changes.js";
let gTab, gDebuggee, gPanel, gDebugger, gClient;
let gTab, gPanel, gDebugger, gClient;
let gEditor, gSources, gControllerSources, gPrettyPrinted;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gClient = gDebugger.gClient;
@ -83,7 +82,6 @@ function clickPrettyPrintButton() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gClient = null;

Просмотреть файл

@ -5,14 +5,13 @@
// Test basic pretty printing functionality. Would be an xpcshell test, except
// for bug 921252.
let gTab, gDebuggee, gPanel, gClient, gThreadClient, gSource;
let gTab, gPanel, gClient, gThreadClient, gSource;
const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gClient = gPanel.panelWin.gClient;
gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
@ -52,5 +51,5 @@ function testUgly({ error, source }) {
}
registerCleanupFunction(function() {
gTab = gDebuggee = gPanel = gClient = gThreadClient = gSource = null;
gTab = gPanel = gClient = gThreadClient = gSource = null;
});

Просмотреть файл

@ -4,19 +4,17 @@
// Test stepping through pretty printed sources.
let gTab, gDebuggee, gPanel, gClient, gThreadClient, gSource;
let gTab, gPanel, gClient, gThreadClient, gSource;
const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gClient = gPanel.panelWin.gClient;
gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
gDebuggee.noop = x => x;
findSource();
});
}
@ -47,7 +45,7 @@ function prettyPrintSource(source) {
function runCode({ error }) {
ok(!error);
gClient.addOneTimeListener("paused", testDbgStatement);
gDebuggee.main3();
callInTab(gTab, "main3");
}
function testDbgStatement(event, { why, frame }) {
@ -90,5 +88,5 @@ function testHitBreakpoint() {
}
registerCleanupFunction(function() {
gTab = gDebuggee = gPanel = gClient = gThreadClient = gSource = null;
gTab = gPanel = gClient = gThreadClient = gSource = null;
});

Просмотреть файл

@ -4,19 +4,17 @@
// Test pretty printing source mapped sources.
var gDebuggee;
var gClient;
var gThreadClient;
var gSource;
let gTab, gDebuggee, gPanel, gClient, gThreadClient, gSource;
let gTab, gPanel, gClient, gThreadClient, gSource;
const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gClient = gPanel.panelWin.gClient;
gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
@ -50,7 +48,7 @@ function prettyPrint() {
function runCode({ error }) {
ok(!error);
gClient.addOneTimeListener("paused", testDbgStatement);
gDebuggee.a();
callInTab(gTab, "a");
}
function testDbgStatement(event, { frame, why }) {
@ -85,5 +83,5 @@ function testFrame({ frames: [frame] }) {
}
registerCleanupFunction(function() {
gTab = gDebuggee = gPanel = gClient = gThreadClient = null;
gTab = gPanel = gClient = gThreadClient = null;
});

Просмотреть файл

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -55,7 +54,6 @@ function testSourceIsStillUgly() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

Просмотреть файл

@ -7,13 +7,12 @@
const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -52,7 +51,6 @@ function testSourceIsPretty() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

Просмотреть файл

@ -8,13 +8,12 @@
const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -46,7 +45,6 @@ function testButtonIsntChecked() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

Просмотреть файл

@ -9,13 +9,12 @@
const TAB_URL = EXAMPLE_URL + "doc_pretty-print-3.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gTab, gPanel, gDebugger;
let gEditor, gSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gEditor = gDebugger.DebuggerView.editor;
@ -79,7 +78,6 @@ function testSourceIsStillPretty() {
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gEditor = null;

Просмотреть файл

@ -8,14 +8,13 @@
const TAB_URL = EXAMPLE_URL + "doc_pretty-print-on-paused.html";
let gTab, gDebuggee, gPanel, gDebugger, gThreadClient, gSources;
let gTab, gPanel, gDebugger, gThreadClient, gSources;
const SECOND_SOURCE_VALUE = EXAMPLE_URL + "code_ugly-2.js";
function test(){
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gThreadClient = gDebugger.gThreadClient;
@ -33,9 +32,7 @@ function test(){
yield doResume(gPanel);
const bpHit = waitForCaretAndScopes(gPanel, 6);
// Get the debuggee call off this tick so that we aren't accidentally
// blocking the yielding of bpHit which causes a deadlock.
executeSoon(() => gDebuggee.secondCall());
callInTab(gTab, "secondCall");
yield bpHit;
info("Switch to the second source.");
@ -59,7 +56,6 @@ function test(){
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gThreadClient = null;

Просмотреть файл

@ -1,9 +1,25 @@
"use strict";
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const { loadSubScript } = Cc['@mozilla.org/moz/jssubscript-loader;1'].
getService(Ci.mozIJSSubScriptLoader);
const EventUtils = {};
loadSubScript("chrome://marionette/content/EventUtils.js", EventUtils);
dump("Frame script loaded.\n");
addMessageListener("test:call", function (message) {
dump("Calling function with name " + message.data + ".\n");
XPCNativeWrapper.unwrap(content)[message.data]();
sendAsyncMessage("test:call");
});
addMessageListener("test:click", function (message) {
dump("Sending mouse click.\n");
let target = message.objects.target;
EventUtils.synthesizeMouseAtCenter(target, {},
target.ownerDocument.defaultView);
});

Просмотреть файл

@ -8,3 +8,8 @@
<script src="code_ugly-2.js"></script>
<script src="code_ugly-3.js"></script>
<script src="code_ugly-4.js"></script>
<script>
function noop(x) {
return x;
}
</script>

Просмотреть файл

@ -964,4 +964,13 @@ function callInTab(tab, name) {
info("Calling function with name " + name + " in tab.");
sendMessageToTab(tab, "test:call", name);
waitForMessageFromTab(tab, "test:call");
}
function sendMouseClickToTab(tab, target) {
info("Sending mouse click to tab.");
sendMessageToTab(tab, "test:click", undefined, {
target: target
});
}

Просмотреть файл

@ -333,11 +333,6 @@ protected:
nsresult ScrollToAnchor(nsACString & curHash, nsACString & newHash,
uint32_t aLoadType);
// Tries to serialize a given variant using structured clone. This only
// works if the variant is backed by a JSVal.
nsresult SerializeJSValVariant(JSContext *aCx, nsIVariant *aData,
nsAString &aResult);
// Returns true if would have called FireOnLocationChange,
// but did not because aFireOnLocationChange was false on entry.
// In this case it is the caller's responsibility to ensure

Просмотреть файл

@ -149,6 +149,7 @@ ImportLoader::Updater::UpdateMainReferrer(uint32_t aNewIdx)
// Our import parent is changed, let's block the new one and later unblock
// the old one.
newMainReferrer->OwnerDoc()->ScriptLoader()->AddExecuteBlocker();
newMainReferrer->OwnerDoc()->BlockDOMContentLoaded();
}
if (mLoader->mDocument) {
@ -168,6 +169,7 @@ ImportLoader::Updater::UpdateMainReferrer(uint32_t aNewIdx)
if (mLoader->IsBlocking()) {
mLoader->mImportParent->ScriptLoader()->RemoveExecuteBlocker();
mLoader->mImportParent->UnblockDOMContentLoaded();
}
// Finally update mMainReferrer to point to the newly added link.
@ -300,6 +302,7 @@ ImportLoader::BlockScripts()
{
MOZ_ASSERT(!mBlockingScripts);
mImportParent->ScriptLoader()->AddExecuteBlocker();
mImportParent->BlockDOMContentLoaded();
mBlockingScripts = true;
}
@ -308,6 +311,7 @@ ImportLoader::UnblockScripts()
{
MOZ_ASSERT(mBlockingScripts);
mImportParent->ScriptLoader()->RemoveExecuteBlocker();
mImportParent->UnblockDOMContentLoaded();
for (uint32_t i = 0; i < mBlockedScriptLoaders.Length(); i++) {
mBlockedScriptLoaders[i]->RemoveExecuteBlocker();
}

Просмотреть файл

@ -2307,7 +2307,12 @@ nsDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
}
mInUnlinkOrDeletion = oldVal;
mRegistry = nullptr;
if (!mMasterDocument) {
// "When creating an import, use the registry of the master document."
// Note: at this point the mMasterDocument is already set for imports
// (and only for imports)
mRegistry = nullptr;
}
// Reset our stylesheets
ResetStylesheetsToURI(aURI);

Просмотреть файл

@ -1304,7 +1304,9 @@ public:
virtual void SetMasterDocument(nsIDocument* master)
{
MOZ_ASSERT(master);
mMasterDocument = master;
UseRegistryFromDocument(mMasterDocument);
}
virtual bool IsMasterDocument()

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<script>
order.push("AS0");
</script>
<link rel="import" href="file_blocking_DOMContentLoaded_B.html" onload="loaded()" onerror="failed()"></link>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<script>
order.push("BS0");
</script>
<link rel="import" href="file_blocking_DOMContentLoaded_C.html" onload="loaded()" onerror="failed()"></link>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<script>
order.push("CS0");
</script>
<link rel="import" href="file_blocking_DOMContentLoaded_D.html" onload="loaded()" onerror="failed()"></link>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<script>
order.push("DS0");
</script>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
</head>
<body>
<x-foo></x-foo>
<script>
var prototype = Object.create(HTMLElement.prototype);
prototype.createdCallback = function() {
createdCallbackCalled = true;
}
document.registerElement('x-foo', {prototype: prototype});
</script>
</body>
</html>

Просмотреть файл

@ -33,6 +33,12 @@ support-files =
file_cycle_4_E.html
file_encoding.html
file_simple_import.html
file_blocking_DOMContentLoaded_A.html
file_blocking_DOMContentLoaded_B.html
file_blocking_DOMContentLoaded_C.html
file_blocking_DOMContentLoaded_D.html
file_element_upgrade.html
[test_cycle_1.html]
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
@ -42,5 +48,8 @@ skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
[test_cycle_4.html]
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
[test_blocking_DOMContentLoaded.html]
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
[test_encoding.html]
[test_defaultView.html]
[test_element_upgrade.html]

Просмотреть файл

@ -0,0 +1,36 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1093028
-->
<head>
<title>Test for Bug 1093028</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1093028">Mozilla Bug 1093028</a>
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
var counter = 0;
var fcounter = 0;
var order = [];
function loaded() {
counter++;
}
function failed() {
fcounter++;
}
</script>
<link rel="import" href="file_blocking_DOMContentLoaded_A.html" onload="loaded()" onerror="failed()"></link>
<script type="text/javascript">
is(counter, 4, "Imports are loaded");
is(fcounter, 0, "No error in imports");
var expected = ["AS0","BS0","CS0","DS0"];
for (i in expected)
is(order[i], expected[i], "import " + i + " should be " + expected[i]);
SimpleTest.finish();
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1081107
-->
<head>
<title>Test for Bug 1081107</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1081107">Mozilla Bug 1081107</a>
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
var counter = 0;
var fcounter = 0;
var createdCallbackCalled = false;
function loaded() {
counter++;
}
function failed() {
fcounter++;
}
</script>
<link rel="import" href="file_element_upgrade.html" onload="loaded()" onerror="failed()"></link>
<script type="text/javascript">
is(counter, 1, "Imports are loaded");
is(fcounter, 0, "No error in imports");
ok(createdCallbackCalled, "custom element in import has been upgraded");
SimpleTest.finish();
</script>
</body>
</html>

Просмотреть файл

@ -127,6 +127,10 @@ public:
// Called from HTMLMediaElement when owner document activity changes
virtual void SetElementVisibility(bool aIsVisible) {}
// Called by some MediaDecoderReader to determine if we can rely
// on the resource length to limit reads.
virtual bool HasInitializationData() { return false; }
// Stack based class to assist in notifying the frame statistics of
// parsed and decoded frames. Use inside video demux & decode functions
// to ensure all parsed and decoded frames are reported on all return paths.

Просмотреть файл

@ -63,21 +63,10 @@ static const unsigned int MAX_SOURCE_BUFFERS = 16;
namespace mozilla {
static const char* const gMediaSourceTypes[6] = {
// XXX: Disabled other temporarily on desktop to allow WebM testing. For now,
// set the developer-only media.mediasource.ignore_codecs pref to true to test
// other codecs, and expect things to be broken.
//
// Disabled WebM in favour of MP4 on Firefox OS.
#ifdef MOZ_GONK_MEDIACODEC
"video/mp4",
"audio/mp4",
#else
"video/webm",
"audio/webm",
#endif
#if 0
"audio/mpeg",
#endif
nullptr
};
@ -87,10 +76,6 @@ IsTypeSupported(const nsAString& aType)
if (aType.IsEmpty()) {
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
}
if (Preferences::GetBool("media.mediasource.ignore_codecs", false)) {
return NS_OK;
}
// TODO: Further restrict this to formats in the spec.
nsContentTypeParser parser(aType);
nsAutoString mimeType;
nsresult rv = parser.GetType(mimeType);
@ -100,6 +85,16 @@ IsTypeSupported(const nsAString& aType)
bool found = false;
for (uint32_t i = 0; gMediaSourceTypes[i]; ++i) {
if (mimeType.EqualsASCII(gMediaSourceTypes[i])) {
if ((mimeType.EqualsASCII("video/mp4") ||
mimeType.EqualsASCII("audio/mp4")) &&
!Preferences::GetBool("media.mediasource.mp4.enabled", false)) {
break;
}
if ((mimeType.EqualsASCII("video/webm") ||
mimeType.EqualsASCII("audio/webm")) &&
!Preferences::GetBool("media.mediasource.webm.enabled", false)) {
break;
}
found = true;
break;
}

Просмотреть файл

@ -119,6 +119,12 @@ SourceBufferDecoder::UpdatePlaybackPosition(int64_t aTime)
MSE_DEBUG("SourceBufferDecoder(%p)::UpdatePlaybackPosition UNIMPLEMENTED", this);
}
bool
SourceBufferDecoder::HasInitializationData()
{
return true;
}
void
SourceBufferDecoder::OnReadMetadataCompleted()
{

Просмотреть файл

@ -60,6 +60,7 @@ public:
virtual void SetMediaSeekable(bool aMediaSeekable) MOZ_FINAL MOZ_OVERRIDE;
virtual void UpdateEstimatedMediaDuration(int64_t aDuration) MOZ_FINAL MOZ_OVERRIDE;
virtual void UpdatePlaybackPosition(int64_t aTime) MOZ_FINAL MOZ_OVERRIDE;
virtual bool HasInitializationData() MOZ_FINAL MOZ_OVERRIDE;
// SourceBufferResource specific interface below.

Просмотреть файл

@ -68,6 +68,35 @@ private:
nsRefPtr<SourceBufferDecoder> mDecoder;
};
MOZ_STACK_CLASS class DecodersToInitialize MOZ_FINAL {
public:
explicit DecodersToInitialize(TrackBuffer* aOwner)
: mOwner(aOwner)
{
}
~DecodersToInitialize()
{
for (size_t i = 0; i < mDecoders.Length(); i++) {
mOwner->QueueInitializeDecoder(mDecoders[i]);
}
}
bool NewDecoder()
{
nsRefPtr<SourceBufferDecoder> decoder = mOwner->NewDecoder();
if (!decoder) {
return false;
}
mDecoders.AppendElement(decoder);
return true;
}
private:
TrackBuffer* mOwner;
nsAutoTArray<nsRefPtr<SourceBufferDecoder>,2> mDecoders;
};
void
TrackBuffer::Shutdown()
{
@ -90,10 +119,11 @@ bool
TrackBuffer::AppendData(const uint8_t* aData, uint32_t aLength)
{
MOZ_ASSERT(NS_IsMainThread());
DecodersToInitialize decoders(this);
// TODO: Run more of the buffer append algorithm asynchronously.
if (mParser->IsInitSegmentPresent(aData, aLength)) {
MSE_DEBUG("TrackBuffer(%p)::AppendData: New initialization segment.", this);
if (!NewDecoder()) {
if (!decoders.NewDecoder()) {
return false;
}
} else if (!mParser->HasInitData()) {
@ -110,7 +140,7 @@ TrackBuffer::AppendData(const uint8_t* aData, uint32_t aLength)
// This data is earlier in the timeline than data we have already
// processed, so we must create a new decoder to handle the decoding.
if (!NewDecoder()) {
if (!decoders.NewDecoder()) {
return false;
}
MSE_DEBUG("TrackBuffer(%p)::AppendData: Decoder marked as initialized.", this);
@ -218,7 +248,7 @@ TrackBuffer::Buffered(dom::TimeRanges* aRanges)
return highestEndTime;
}
bool
already_AddRefed<SourceBufferDecoder>
TrackBuffer::NewDecoder()
{
MOZ_ASSERT(NS_IsMainThread());
@ -228,7 +258,7 @@ TrackBuffer::NewDecoder()
nsRefPtr<SourceBufferDecoder> decoder = mParentDecoder->CreateSubDecoder(mType);
if (!decoder) {
return false;
return nullptr;
}
ReentrantMonitorAutoEnter mon(mParentDecoder->GetReentrantMonitor());
mCurrentDecoder = decoder;
@ -238,7 +268,7 @@ TrackBuffer::NewDecoder()
mLastEndTimestamp = 0;
decoder->SetTaskQueue(mTaskQueue);
return QueueInitializeDecoder(decoder);
return decoder.forget();
}
bool

Просмотреть файл

@ -82,12 +82,15 @@ public:
#endif
private:
friend class DecodersToInitialize;
~TrackBuffer();
// Create a new decoder, set mCurrentDecoder to the new decoder, and queue
// the decoder for initialization. The decoder is not considered
// initialized until it is added to mDecoders.
bool NewDecoder();
// Create a new decoder, set mCurrentDecoder to the new decoder and
// returns it. The new decoder must be queued using QueueInitializeDecoder
// for initialization.
// The decoder is not considered initialized until it is added to
// mInitializedDecoders.
already_AddRefed<SourceBufferDecoder> NewDecoder();
// Helper for AppendData, ensures NotifyDataArrived is called whenever
// data is appended to the current decoder's SourceBufferResource.

Просмотреть файл

@ -49,7 +49,7 @@ function beginTest() {
var prefs = [
[ "media.mediasource.enabled", true ],
[ "media.mediasource.ignore_codecs", true ],
[ "media.mediasource.mp4.enabled", true ],
];
if (/Linux/.test(navigator.userAgent) ||

Просмотреть файл

@ -110,7 +110,7 @@ function beginTest() {
var prefs = [
[ "media.mediasource.enabled", true ],
[ "media.mediasource.ignore_codecs", true ],
[ "media.mediasource.mp4.enabled", true ],
];
if (/Linux/.test(navigator.userAgent) ||

Просмотреть файл

@ -84,7 +84,7 @@ function beginTest() {
var prefs = [
[ "media.mediasource.enabled", true ],
[ "media.mediasource.ignore_codecs", true ],
[ "media.mediasource.mp4.enabled", true ],
];
if (/Linux/.test(navigator.userAgent) ||

Просмотреть файл

@ -287,7 +287,8 @@ nsresult WebMReader::ReadMetadata(MediaInfo* aInfo,
io.seek = webm_seek;
io.tell = webm_tell;
io.userdata = mDecoder;
int64_t maxOffset = -1;
int64_t maxOffset = mDecoder->HasInitializationData() ?
mDecoder->GetResource()->GetLength() : -1;
int r = nestegg_init(&mContext, io, &webm_log, maxOffset);
if (r == -1) {
return NS_ERROR_FAILURE;

Просмотреть файл

@ -5,7 +5,7 @@
#include "mozilla/dom/SVGSwitchElement.h"
#include "nsSVGEffects.h"
#include "nsLayoutUtils.h"
#include "nsSVGUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/SVGSwitchElementBinding.h"
@ -62,7 +62,9 @@ SVGSwitchElement::MaybeInvalidate()
nsIFrame *frame = GetPrimaryFrame();
if (frame) {
nsSVGEffects::InvalidateRenderingObservers(frame);
nsLayoutUtils::PostRestyleEvent(
this, nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(frame);
}

Просмотреть файл

@ -10,7 +10,8 @@
* liability, trademark and document use rules apply.
*/
[Constructor(DOMString name, optional DOMString message = "")]
[Constructor(DOMString name, optional DOMString message = ""),
Exposed=(Window,System)]
interface DOMError {
[Constant]
readonly attribute DOMString name;

Просмотреть файл

@ -11,7 +11,7 @@
*/
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
Exposed=(Window,Worker)]
Exposed=(Window,Worker,System)]
interface TextDecoder {
[Constant]
readonly attribute DOMString encoding;

Просмотреть файл

@ -11,7 +11,7 @@
*/
[Constructor(optional DOMString utfLabel = "utf-8"),
Exposed=(Window,Worker)]
Exposed=(Window,Worker,System)]
interface TextEncoder {
[Constant]
readonly attribute DOMString encoding;

Просмотреть файл

@ -181,16 +181,6 @@ bool gRuntimeServiceDuringInit = false;
bool gTestPBackground = false;
#endif // ENABLE_TESTS
enum {
ID_Worker = 0,
ID_ChromeWorker,
ID_Event,
ID_MessageEvent,
ID_ErrorEvent,
ID_COUNT
};
class LiteralRebindingCString : public nsDependentCString
{
public:

Просмотреть файл

@ -67,6 +67,26 @@ AppendToString(std::stringstream& aStream, const gfxRGBA& c,
aStream << sfx;
}
void
AppendToString(std::stringstream& aStream, const nsPoint& p,
const char* pfx, const char* sfx)
{
aStream << pfx;
aStream << nsPrintfCString("(x=%d, y=%d)", p.x, p.y).get();
aStream << sfx;
}
void
AppendToString(std::stringstream& aStream, const nsRect& r,
const char* pfx, const char* sfx)
{
aStream << pfx;
aStream << nsPrintfCString(
"(x=%d, y=%d, w=%d, h=%d)",
r.x, r.y, r.width, r.height).get();
aStream << sfx;
}
void
AppendToString(std::stringstream& aStream, const nsIntPoint& p,
const char* pfx, const char* sfx)

Просмотреть файл

@ -45,6 +45,14 @@ void
AppendToString(std::stringstream& aStream, const gfxRGBA& c,
const char* pfx="", const char* sfx="");
void
AppendToString(std::stringstream& aStream, const nsPoint& p,
const char* pfx="", const char* sfx="");
void
AppendToString(std::stringstream& aStream, const nsRect& r,
const char* pfx="", const char* sfx="");
void
AppendToString(std::stringstream& aStream, const nsIntPoint& p,
const char* pfx="", const char* sfx="");

Просмотреть файл

@ -569,7 +569,7 @@ class Type
MOZ_ASSERT(isSimd());
switch (which_) {
case Int32x4:
return Int;
return Signed;
case Float32x4:
return Float;
// Scalar types
@ -4320,7 +4320,7 @@ CheckDotAccess(FunctionCompiler &f, ParseNode *elem, MDefinition **def, Type *ty
JSAtomState &names = m.cx()->names();
if (field == names.signMask) {
*type = Type::Int;
*type = Type::Signed;
*def = f.extractSignMask(baseDef);
return true;
}

Просмотреть файл

@ -3062,6 +3062,9 @@ frontend::EmitFunctionScript(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNo
if (bce->sc->asFunctionBox()->isStarGenerator() && !EmitFinishIteratorResult(cx, bce, true))
return false;
if (Emit1(cx, bce, JSOP_SETRVAL) < 0)
return false;
ScopeCoordinate sc;
// We know that .generator is on the top scope chain node, as we are
// at the function end.
@ -3071,7 +3074,7 @@ frontend::EmitFunctionScript(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNo
return false;
// No need to check for finally blocks, etc as in EmitReturn.
if (Emit1(cx, bce, JSOP_FINALYIELD) < 0)
if (Emit1(cx, bce, JSOP_FINALYIELDRVAL) < 0)
return false;
}
@ -5598,6 +5601,9 @@ EmitYield(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
if (Emit1(cx, bce, pn->getOp()) < 0)
return false;
if (pn->getOp() == JSOP_INITIALYIELD && Emit1(cx, bce, JSOP_POP) < 0)
return false;
return true;
}

Просмотреть файл

@ -36,33 +36,16 @@ function assertEqX4(real, expected, assertFunc) {
function CheckI4(header, code, expected) {
// code needs to contain a local called x
header = USE_ASM + I32 + header;
var lanes = ['x', 'y', 'z', 'w'];
for (var i = 0; i < 4; ++i) {
var lane = lanes[i];
assertEq(asmLink(asmCompile('glob', header + ';function f() {' + code + ';return x.' + lane + '|0} return f'), this)(), expected[i]);
}
header = USE_ASM + I32 + F32 + header;
var observed = asmLink(asmCompile('glob', header + ';function f() {' + code + ';return i4(x)} return f'), this)();
assertEqX4(observed, expected);
}
function CheckF4(header, code, expected) {
// code needs to contain a local called x
var lanes = ['x', 'y', 'z', 'w'];
header = USE_ASM + F32 + header;
for (var i = 0; i < 4; ++i) {
var lane = lanes[i];
assertEq(asmLink(asmCompile('glob', header + ';function f() {' + code + ';return +x.' + lane + '} return f'), this)(), Math.fround(expected[i]));
}
}
function CheckF4Comp(header, code, expected) {
// code needs to contain a local called x containing the result of the
// comparison
var lanes = ['x', 'y', 'z', 'w'];
header = USE_ASM + F32 + I32 + header;
for (var i = 0; i < 4; ++i) {
var lane = lanes[i];
assertEq(asmLink(asmCompile('glob', header + ';function f() {' + code + ';return x.' + lane + '|0} return f'), this)(), expected[i]);
}
var observed = asmLink(asmCompile('glob', header + ';function f() {' + code + ';return f4(x)} return f'), this)();
assertEqX4(observed, expected.map(Math.fround));
}
try {
@ -165,21 +148,34 @@ assertAsmTypeFail('glob', USE_ASM + "var f32=glob.Math.fround;" + I32 + "functio
assertAsmTypeFail('glob', USE_ASM + I32 + "function f() {var x=i4(1,2,3,4); return x.length|0;} return f");
assertAsmTypeFail('glob', USE_ASM + I32 + "function f() {var x=i4(1,2,3,4).y; return x|0;} return f");
assertAsmTypeFail('glob', USE_ASM + I32 + "function f() {var x=i4(1,2,3,4); return (x.x > (1>>>0)) | 0;} return f");
CheckI4('', 'var x=i4(0,0,0,0)', [0,0,0,0]);
CheckI4('', 'var x=i4(1,2,3,4)', [1,2,3,4]);
CheckI4('', 'var x=i4(' + INT32_MIN + ',2,3,' + INT32_MAX + ')', [INT32_MIN,2,3,INT32_MAX]);
CheckI4('', 'var x=i4(1,2,3,4); var y=i4(5,6,7,8)', [1,2,3,4]);
CheckI4('', 'var a=1; var b=i4(9,8,7,6); var c=13.37; var x=i4(1,2,3,4); var y=i4(5,6,7,8)', [1,2,3,4]);
CheckI4('', 'var y=i4(5,6,7,8); var x=i4(1,2,3,4)', [1,2,3,4]);
function CheckSignMask(innerBody, coerceBefore, coerceAfter, expected) {
var lanes = ['x', 'y', 'z', 'w'];
for (var i = 0; i < lanes.length; i++) {
var lane = lanes[i];
var laneCheckCode = `"use asm"; var i4=glob.SIMD.int32x4; var f4=glob.SIMD.float32x4; function f() {${innerBody}; return ${coerceBefore}x.${lane}${coerceAfter} } return f;`;
assertEq(asmLink(asmCompile('glob', laneCheckCode), this)(), expected[i]);
}
}
function CheckSignMaskI4(innerBody, expected) { return CheckSignMask(innerBody, '', '|0', expected); }
function CheckSignMaskF4(innerBody, expected) { return CheckSignMask(innerBody, '+', '', expected.map(Math.fround)); }
CheckF4('', 'var x=f4(' + INT32_MAX + ', 2, 3, ' + INT32_MIN + ')', [INT32_MAX, 2, 3, INT32_MIN]);
CheckF4('', 'var x=f4(' + (INT32_MAX + 1) + ', 2, 3, 4)', [INT32_MAX + 1, 2, 3, 4]);
CheckF4('', 'var x=f4(1.3, 2.4, 3.5, 98.76)', [1.3, 2.4, 3.5, 98.76]);
CheckF4('', 'var x=f4(13.37, 2., 3., -0)', [13.37, 2, 3, -0]);
CheckSignMaskI4('var x=i4(0,0,0,0);', [0,0,0,0]);
CheckSignMaskI4('var x=i4(1,2,3,4);', [1,2,3,4]);
CheckSignMaskI4('var x=i4(' + INT32_MIN + ',2,3,' + INT32_MAX + ')', [INT32_MIN,2,3,INT32_MAX]);
CheckSignMaskI4('var x=i4(1,2,3,4); var y=i4(5,6,7,8)', [1,2,3,4]);
CheckSignMaskI4('var a=1; var b=i4(9,8,7,6); var c=13.37; var x=i4(1,2,3,4); var y=i4(5,6,7,8)', [1,2,3,4]);
CheckSignMaskI4('var y=i4(5,6,7,8); var x=i4(1,2,3,4)', [1,2,3,4]);
CheckSignMaskF4('var x=f4(' + INT32_MAX + ', 2, 3, ' + INT32_MIN + ')', [INT32_MAX, 2, 3, INT32_MIN]);
CheckSignMaskF4('var x=f4(' + (INT32_MAX + 1) + ', 2, 3, 4)', [INT32_MAX + 1, 2, 3, 4]);
CheckSignMaskF4('var x=f4(1.3, 2.4, 3.5, 98.76)', [1.3, 2.4, 3.5, 98.76]);
CheckSignMaskF4('var x=f4(13.37, 2., 3., -0)', [13.37, 2, 3, -0]);
// signMask
assertAsmTypeFail('glob', USE_ASM + I32 + "function f() {var x=i4(1,2,3,4); var y=0.0; y=x.signMask;} return f");
assertAsmTypeFail('glob', USE_ASM + I32 + "function f() {var x=i4(1,2,3,4); return (x.signMask > (1>>>0)) | 0;} return f");
assertAsmTypeFail('glob', USE_ASM + I32 + FROUND + "function f() {var x=i4(1,2,3,4); var y=f32(0.0); y=x.signMask;} return f");
assertAsmTypeFail('glob', USE_ASM + "function f() {var x=42; return x.signMask;} return f");
@ -606,35 +602,35 @@ const NEF32 = 'var ne=f4.notEqual;';
assertAsmTypeFail('glob', USE_ASM + F32 + "var lt=f4.lessThan; function f() {var x=f4(1,2,3,4); var y=f4(5,6,7,8); x=lt(x,y);} return f");
CheckF4Comp(LTF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=lt(y,z)', [F, F, F, F]);
CheckF4Comp(LTF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=lt(y,z)', [T, T, T, T]);
CheckF4Comp(LTF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=lt(y,z)', [F, T, T, F]);
CheckF4Comp(LTF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=lt(y,z);', [F, F, F, F]);
CheckI4(LTF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=lt(y,z)', [F, F, F, F]);
CheckI4(LTF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=lt(y,z)', [T, T, T, T]);
CheckI4(LTF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=lt(y,z)', [F, T, T, F]);
CheckI4(LTF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=lt(y,z);', [F, F, F, F]);
CheckF4Comp(LEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=le(y,z)', [F, F, F, F]);
CheckF4Comp(LEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=le(y,z)', [T, T, T, T]);
CheckF4Comp(LEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=le(y,z)', [T, T, T, F]);
CheckF4Comp(LEF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=le(y,z);', [T, T, F, F]);
CheckI4(LEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=le(y,z)', [F, F, F, F]);
CheckI4(LEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=le(y,z)', [T, T, T, T]);
CheckI4(LEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=le(y,z)', [T, T, T, F]);
CheckI4(LEF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=le(y,z);', [T, T, F, F]);
CheckF4Comp(EQF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=eq(y,z)', [F, F, F, F]);
CheckF4Comp(EQF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=eq(y,z)', [F, F, F, F]);
CheckF4Comp(EQF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=eq(y,z)', [T, F, F, F]);
CheckF4Comp(EQF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=eq(y,z);', [T, T, F, F]);
CheckI4(EQF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=eq(y,z)', [F, F, F, F]);
CheckI4(EQF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=eq(y,z)', [F, F, F, F]);
CheckI4(EQF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=eq(y,z)', [T, F, F, F]);
CheckI4(EQF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=eq(y,z);', [T, T, F, F]);
CheckF4Comp(NEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=ne(y,z)', [T, T, T, T]);
CheckF4Comp(NEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=ne(y,z)', [T, T, T, T]);
CheckF4Comp(NEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=ne(y,z)', [F, T, T, T]);
CheckF4Comp(NEF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=ne(y,z);', [F, F, T, T]);
CheckI4(NEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=ne(y,z)', [T, T, T, T]);
CheckI4(NEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=ne(y,z)', [T, T, T, T]);
CheckI4(NEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=ne(y,z)', [F, T, T, T]);
CheckI4(NEF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=ne(y,z);', [F, F, T, T]);
CheckF4Comp(GTF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=gt(y,z)', [T, T, T, T]);
CheckF4Comp(GTF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=gt(y,z)', [F, F, F, F]);
CheckF4Comp(GTF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=gt(y,z)', [F, F, F, T]);
CheckF4Comp(GTF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=gt(y,z);', [F, F, F, F]);
CheckI4(GTF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=gt(y,z)', [T, T, T, T]);
CheckI4(GTF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=gt(y,z)', [F, F, F, F]);
CheckI4(GTF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=gt(y,z)', [F, F, F, T]);
CheckI4(GTF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=gt(y,z);', [F, F, F, F]);
CheckF4Comp(GEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=ge(y,z)', [T, T, T, T]);
CheckF4Comp(GEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=ge(y,z)', [F, F, F, F]);
CheckF4Comp(GEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=ge(y,z)', [T, F, F, T]);
CheckF4Comp(GEF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=ge(y,z);', [T, T, F, F]);
CheckI4(GEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=ge(y,z)', [T, T, T, T]);
CheckI4(GEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=ge(y,z)', [F, F, F, F]);
CheckI4(GEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=ge(y,z)', [T, F, F, T]);
CheckI4(GEF32 + 'const nan = glob.NaN; const fround=glob.Math.fround', 'var y=f4(0,0,0,0); var z=f4(0,0,0,0); var x=i4(0,0,0,0); y=f4(fround(0.0),fround(-0.0),fround(0.0),fround(nan)); z=f4(fround(-0.0),fround(0.0),fround(nan),fround(0.0)); x=ge(y,z);', [T, T, F, F]);
// Conversions operators
const CVTIF = 'var cvt=f4.fromInt32x4;';

Просмотреть файл

@ -356,9 +356,6 @@ class BaselineFrame
bool isDebuggerFrame() const {
return false;
}
bool isGeneratorFrame() const {
return false;
}
IonJSFrameLayout *framePrefix() const {
uint8_t *fp = (uint8_t *)this + Size() + FramePointerOffset;

Просмотреть файл

@ -60,7 +60,7 @@ static const unsigned BASELINE_MAX_ARGS_LENGTH = 20000;
static bool
CheckFrame(InterpreterFrame *fp)
{
if (fp->isGeneratorFrame()) {
if (fp->script()->isGenerator()) {
JitSpew(JitSpew_BaselineAbort, "generator frame");
return false;
}

Просмотреть файл

@ -2136,7 +2136,7 @@ IonCompile(JSContext *cx, JSScript *script,
static bool
CheckFrame(BaselineFrame *frame)
{
MOZ_ASSERT(!frame->isGeneratorFrame());
MOZ_ASSERT(!frame->script()->isGenerator());
MOZ_ASSERT(!frame->isDebuggerFrame());
// This check is to not overrun the stack.
@ -2166,6 +2166,11 @@ CheckScript(JSContext *cx, JSScript *script, bool osr)
return false;
}
if (script->isGenerator()) {
JitSpew(JitSpew_IonAbort, "generator script");
return false;
}
if (!script->compileAndGo() && !script->functionNonDelazifying()) {
// Support non-CNG functions but not other scripts. For global scripts,
// IonBuilder currently uses the global object as scope chain, this is

Просмотреть файл

@ -535,6 +535,22 @@ jit::EliminateDeadResumePointOperands(MIRGenerator *mir, MIRGraph &graph)
return true;
}
// Test whether |def| would be needed if it had no uses.
bool
js::jit::DeadIfUnused(const MDefinition *def)
{
return !def->isEffectful() && !def->isGuard() && !def->isControlInstruction() &&
(!def->isInstruction() || !def->toInstruction()->resumePoint());
}
// Test whether |def| may be safely discarded, due to being dead or due to being
// located in a basic block which has itself been marked for discarding.
bool
js::jit::IsDiscardable(const MDefinition *def)
{
return !def->hasUses() && (DeadIfUnused(def) || def->block()->isMarked());
}
// Instructions are useless if they are unused and have no side effects.
// This pass eliminates useless instructions.
// The graph itself is unchanged.
@ -550,9 +566,7 @@ jit::EliminateDeadCode(MIRGenerator *mir, MIRGraph &graph)
// Remove unused instructions.
for (MInstructionReverseIterator iter = block->rbegin(); iter != block->rend(); ) {
MInstruction *inst = *iter++;
if (!inst->isEffectful() && !inst->resumePoint() &&
!inst->hasUses() && !inst->isGuard() &&
!inst->isControlInstruction())
if (js::jit::IsDiscardable(inst))
{
block->discard(inst);
} else if (!inst->isRecoveredOnBailout() && !inst->isGuard() &&

Просмотреть файл

@ -168,6 +168,12 @@ AnalyzeNewScriptDefiniteProperties(JSContext *cx, JSFunction *fun,
bool
AnalyzeArgumentsUsage(JSContext *cx, JSScript *script);
bool
DeadIfUnused(const MDefinition *def);
bool
IsDiscardable(const MDefinition *def);
} // namespace jit
} // namespace js

Просмотреть файл

@ -137,22 +137,6 @@ ValueNumberer::VisibleValues::has(const MDefinition *def) const
}
#endif
// Test whether |def| would be needed if it had no uses.
static bool
DeadIfUnused(const MDefinition *def)
{
return !def->isEffectful() && !def->isGuard() && !def->isControlInstruction() &&
(!def->isInstruction() || !def->toInstruction()->resumePoint());
}
// Test whether |def| may be safely discarded, due to being dead or due to being
// located in a basic block which has itself been marked for discarding.
static bool
IsDiscardable(const MDefinition *def)
{
return !def->hasUses() && (DeadIfUnused(def) || def->block()->isMarked());
}
// Call MDefinition::justReplaceAllUsesWith, and add some GVN-specific asserts.
static void
ReplaceAllUsesWith(MDefinition *from, MDefinition *to)

Просмотреть файл

@ -4130,8 +4130,6 @@ js_DumpInterpreterFrame(JSContext *cx, InterpreterFrame *start)
fprintf(stderr, " debugger");
if (i.isEvalFrame())
fprintf(stderr, " eval");
if (!i.isJit() && i.interpFrame()->isGeneratorFrame())
fprintf(stderr, " generator");
fputc('\n', stderr);
fprintf(stderr, " scopeChain: (JSObject *) %p\n", (void *) i.scopeChain());

Просмотреть файл

@ -288,7 +288,6 @@ BytecodeFallsThrough(JSOp op)
case JSOP_DEFAULT:
case JSOP_RETURN:
case JSOP_RETRVAL:
case JSOP_FINALYIELD:
case JSOP_FINALYIELDRVAL:
case JSOP_THROW:
case JSOP_TABLESWITCH:
@ -597,7 +596,6 @@ FlowsIntoNext(JSOp op)
case JSOP_THROW:
case JSOP_GOTO:
case JSOP_RETSUB:
case JSOP_FINALYIELD:
case JSOP_FINALYIELDRVAL:
return false;
default:

Просмотреть файл

@ -4745,7 +4745,7 @@ static bool
DebuggerFrame_getGenerator(JSContext *cx, unsigned argc, Value *vp)
{
THIS_FRAME(cx, argc, vp, "get generator", args, thisobj, frame);
args.rval().setBoolean(frame.isGeneratorFrame());
args.rval().setBoolean(frame.script()->isGenerator());
return true;
}

Просмотреть файл

@ -16,19 +16,16 @@ using namespace js;
using namespace js::types;
JSObject *
GeneratorObject::create(JSContext *cx, const InterpreterRegs &regs)
GeneratorObject::create(JSContext *cx, AbstractFramePtr frame)
{
MOZ_ASSERT(regs.stackDepth() == 0);
InterpreterFrame *fp = regs.fp();
MOZ_ASSERT(frame.script()->isGenerator());
MOZ_ASSERT(frame.script()->nfixed() == 0);
MOZ_ASSERT(fp->script()->isGenerator());
MOZ_ASSERT(fp->script()->nfixed() == 0);
Rooted<GlobalObject*> global(cx, &fp->global());
Rooted<GlobalObject*> global(cx, cx->global());
RootedNativeObject obj(cx);
if (fp->script()->isStarGenerator()) {
if (frame.script()->isStarGenerator()) {
RootedValue pval(cx);
RootedObject fun(cx, fp->fun());
RootedObject fun(cx, frame.fun());
// FIXME: This would be faster if we could avoid doing a lookup to get
// the prototype for the instance. Bug 906600.
if (!JSObject::getProperty(cx, fun, fun, cx->names().prototype, &pval))
@ -41,7 +38,7 @@ GeneratorObject::create(JSContext *cx, const InterpreterRegs &regs)
}
obj = NewNativeObjectWithGivenProto(cx, &StarGeneratorObject::class_, proto, global);
} else {
MOZ_ASSERT(fp->script()->isLegacyGenerator());
MOZ_ASSERT(frame.script()->isLegacyGenerator());
JSObject *proto = GlobalObject::getOrCreateLegacyGeneratorObjectPrototype(cx, global);
if (!proto)
return nullptr;
@ -50,20 +47,19 @@ GeneratorObject::create(JSContext *cx, const InterpreterRegs &regs)
if (!obj)
return nullptr;
Rooted<GeneratorObject *> genObj(cx, &obj->as<GeneratorObject>());
genObj->setCallee(fp->callee());
genObj->setThisValue(fp->thisValue());
genObj->setScopeChain(*fp->scopeChain());
if (fp->script()->needsArgsObj())
genObj->setArgsObj(fp->argsObj());
GeneratorObject *genObj = &obj->as<GeneratorObject>();
genObj->setCallee(*frame.callee());
genObj->setThisValue(frame.thisValue());
genObj->setScopeChain(*frame.scopeChain());
if (frame.script()->needsArgsObj())
genObj->setArgsObj(frame.argsObj());
genObj->clearExpressionStack();
return obj;
}
bool
GeneratorObject::suspend(JSContext *cx, HandleObject obj, InterpreterFrame *fp, jsbytecode *pc,
GeneratorObject::suspend(JSContext *cx, HandleObject obj, AbstractFramePtr frame, jsbytecode *pc,
Value *vp, unsigned nvalues, GeneratorObject::SuspendKind suspendKind)
{
Rooted<GeneratorObject*> genObj(cx, &obj->as<GeneratorObject>());
@ -71,13 +67,13 @@ GeneratorObject::suspend(JSContext *cx, HandleObject obj, InterpreterFrame *fp,
if (suspendKind == NORMAL && genObj->isClosing()) {
MOZ_ASSERT(genObj->is<LegacyGeneratorObject>());
RootedValue val(cx, ObjectValue(fp->callee()));
js_ReportValueError(cx, JSMSG_BAD_GENERATOR_YIELD, JSDVG_SEARCH_STACK, val, js::NullPtr());
RootedValue val(cx, ObjectValue(*frame.callee()));
js_ReportValueError(cx, JSMSG_BAD_GENERATOR_YIELD, JSDVG_SEARCH_STACK, val, NullPtr());
return false;
}
genObj->setSuspendedBytecodeOffset(pc - fp->script()->code(), suspendKind == INITIAL);
genObj->setScopeChain(*fp->scopeChain());
genObj->setSuspendedBytecodeOffset(pc - frame.script()->code(), suspendKind == INITIAL);
genObj->setScopeChain(*frame.scopeChain());
if (nvalues) {
ArrayObject *stack = NewDenseCopiedArray(cx, nvalues, vp);
@ -132,15 +128,12 @@ GeneratorObject::resume(JSContext *cx, InterpreterActivation &activation,
activation.regs().pc = callee->nonLazyScript()->code() + genObj->suspendedBytecodeOffset();
// If we are resuming a JSOP_YIELD, always push on a value, even if we are
// raising an exception. In the exception case, the stack needs to have
// something on it so that exception handling doesn't skip the catch
// blocks. See TryNoteIter::settle.
if (!genObj->isNewborn()) {
activation.regs().sp++;
MOZ_ASSERT(activation.regs().spForStackDepth(activation.regs().stackDepth()));
activation.regs().sp[-1] = arg;
}
// Always push on a value, even if we are raising an exception. In the
// exception case, the stack needs to have something on it so that exception
// handling doesn't skip the catch blocks. See TryNoteIter::settle.
activation.regs().sp++;
MOZ_ASSERT(activation.regs().spForStackDepth(activation.regs().stackDepth()));
activation.regs().sp[-1] = arg;
switch (resumeKind) {
case NEXT:

Просмотреть файл

@ -50,21 +50,21 @@ class GeneratorObject : public NativeObject
return CLOSE;
}
static JSObject *create(JSContext *cx, const InterpreterRegs &regs);
static JSObject *create(JSContext *cx, AbstractFramePtr frame);
static bool suspend(JSContext *cx, HandleObject obj, InterpreterFrame *fp, jsbytecode *pc,
static bool suspend(JSContext *cx, HandleObject obj, AbstractFramePtr frame, jsbytecode *pc,
Value *vp, unsigned nvalues, SuspendKind kind);
static bool resume(JSContext *cx, InterpreterActivation &activation,
HandleObject obj, HandleValue arg, ResumeKind resumeKind);
static bool initialSuspend(JSContext *cx, HandleObject obj, InterpreterFrame *fp, jsbytecode *pc) {
return suspend(cx, obj, fp, pc, nullptr, 0, INITIAL);
static bool initialSuspend(JSContext *cx, HandleObject obj, AbstractFramePtr frame, jsbytecode *pc) {
return suspend(cx, obj, frame, pc, nullptr, 0, INITIAL);
}
static bool normalSuspend(JSContext *cx, HandleObject obj, InterpreterFrame *fp, jsbytecode *pc,
static bool normalSuspend(JSContext *cx, HandleObject obj, AbstractFramePtr frame, jsbytecode *pc,
Value *vp, unsigned nvalues) {
return suspend(cx, obj, fp, pc, vp, nvalues, NORMAL);
return suspend(cx, obj, frame, pc, vp, nvalues, NORMAL);
}
static bool finalSuspend(JSContext *cx, HandleObject obj);
@ -166,6 +166,25 @@ class GeneratorObject : public NativeObject
setFixedSlot(EXPRESSION_STACK_SLOT, NullValue());
setFixedSlot(BYTECODE_OFFSET_SLOT, NullValue());
}
static size_t offsetOfCalleeSlot() {
return getFixedSlotOffset(CALLEE_SLOT);
}
static size_t offsetOfThisSlot() {
return getFixedSlotOffset(THIS_SLOT);
}
static size_t offsetOfScopeChainSlot() {
return getFixedSlotOffset(SCOPE_CHAIN_SLOT);
}
static size_t offsetOfArgsObjSlot() {
return getFixedSlotOffset(ARGS_OBJ_SLOT);
}
static size_t offsetOfBytecodeOffsetSlot() {
return getFixedSlotOffset(BYTECODE_OFFSET_SLOT);
}
static size_t offsetOfExpressionStackSlot() {
return getFixedSlotOffset(EXPRESSION_STACK_SLOT);
}
};
class LegacyGeneratorObject : public GeneratorObject

Просмотреть файл

@ -1478,33 +1478,11 @@ Interpret(JSContext *cx, RunState &state)
RootedScript rootScript0(cx);
DebugOnly<uint32_t> blockDepth;
if (MOZ_UNLIKELY(REGS.fp()->isGeneratorFrame())) {
MOZ_ASSERT(script->containsPC(REGS.pc));
MOZ_ASSERT(REGS.stackDepth() <= script->nslots());
/*
* To support generator_throw and to catch ignored exceptions,
* fail if cx->isExceptionPending() is true.
*/
if (cx->isExceptionPending()) {
probes::EnterScript(cx, script, script->functionNonDelazifying(), REGS.fp());
goto error;
}
}
/* State communicated between non-local jumps: */
bool interpReturnOK;
if (!activation.entryFrame()->isGeneratorFrame()) {
if (!activation.entryFrame()->prologue(cx))
goto error;
} else {
if (!probes::EnterScript(cx, script, script->functionNonDelazifying(),
activation.entryFrame()))
{
goto error;
}
}
if (!activation.entryFrame()->prologue(cx))
goto error;
switch (Debugger::onEnterFrame(cx, activation.entryFrame())) {
case JSTRAP_CONTINUE:
@ -1659,6 +1637,7 @@ CASE(JSOP_UNUSED190)
CASE(JSOP_UNUSED191)
CASE(JSOP_UNUSED192)
CASE(JSOP_UNUSED196)
CASE(JSOP_UNUSED207)
CASE(JSOP_UNUSED208)
CASE(JSOP_UNUSED209)
CASE(JSOP_UNUSED210)
@ -3367,8 +3346,8 @@ END_CASE(JSOP_DEBUGLEAVEBLOCK)
CASE(JSOP_GENERATOR)
{
MOZ_ASSERT(!cx->isExceptionPending());
REGS.fp()->initGeneratorFrame();
JSObject *obj = GeneratorObject::create(cx, REGS);
MOZ_ASSERT(REGS.stackDepth() == 0);
JSObject *obj = GeneratorObject::create(cx, REGS.fp());
if (!obj)
goto error;
PUSH_OBJECT(*obj);
@ -3424,11 +3403,6 @@ CASE(JSOP_RESUME)
ADVANCE_AND_DISPATCH(0);
}
CASE(JSOP_FINALYIELD)
REGS.fp()->setReturnValue(REGS.sp[-2]);
REGS.sp[-2] = REGS.sp[-1];
REGS.sp--;
/* FALL THROUGH */
CASE(JSOP_FINALYIELDRVAL)
{
RootedObject &gen = rootObject0;

Просмотреть файл

@ -1568,7 +1568,7 @@
* Operands:
* Stack: generator =>
*/ \
macro(JSOP_INITIALYIELD, 202,"initialyield", NULL, 1, 1, 0, JOF_BYTE) \
macro(JSOP_INITIALYIELD, 202,"initialyield", NULL, 1, 1, 1, JOF_BYTE) \
/*
* Pops the generator and the return value 'rval1', stops interpretation and
* returns 'rval1'. Pushes sent value from 'send()' onto the stack.
@ -1578,15 +1578,6 @@
* Stack: rval1, gen => rval2
*/ \
macro(JSOP_YIELD, 203,"yield", NULL, 1, 2, 1, JOF_BYTE) \
/*
* Pops the generator and the value to yield from the stack. Then suspends
* and closes the generator.
* Category: Statements
* Type: Generator
* Operands:
* Stack: gen, val =>
*/ \
macro(JSOP_FINALYIELD, 204,"finalyield", NULL, 1, 2, 0, JOF_BYTE) \
/*
* Pops the generator and suspends and closes it. Yields the value in the
* frame's return value slot.
@ -1595,7 +1586,7 @@
* Operands:
* Stack: gen =>
*/ \
macro(JSOP_FINALYIELDRVAL,205,"finalyieldrval",NULL, 1, 1, 0, JOF_BYTE) \
macro(JSOP_FINALYIELDRVAL,204,"finalyieldrval",NULL, 1, 1, 0, JOF_BYTE) \
/*
* Pops the generator and argument from the stack, pushes a new generator
* frame and resumes execution of it. Pushes the return value after the
@ -1605,7 +1596,7 @@
* Operands: resume kind (GeneratorObject::ResumeKind)
* Stack: gen, val => rval
*/ \
macro(JSOP_RESUME, 206,"resume", NULL, 3, 2, 1, JOF_UINT8|JOF_INVOKE) \
macro(JSOP_RESUME, 205,"resume", NULL, 3, 2, 1, JOF_UINT8|JOF_INVOKE) \
/*
* Pops the top two values on the stack as 'obj' and 'v', pushes 'v' to
* 'obj'.
@ -1616,8 +1607,9 @@
* Operands:
* Stack: v, obj =>
*/ \
macro(JSOP_ARRAYPUSH, 207,"arraypush", NULL, 1, 2, 0, JOF_BYTE) \
macro(JSOP_ARRAYPUSH, 206,"arraypush", NULL, 1, 2, 0, JOF_BYTE) \
\
macro(JSOP_UNUSED207, 207, "unused207", NULL, 1, 0, 0, JOF_BYTE) \
macro(JSOP_UNUSED208, 208, "unused208", NULL, 1, 0, 0, JOF_BYTE) \
macro(JSOP_UNUSED209, 209, "unused209", NULL, 1, 0, 0, JOF_BYTE) \
macro(JSOP_UNUSED210, 210, "unused210", NULL, 1, 0, 0, JOF_BYTE) \

Просмотреть файл

@ -55,7 +55,7 @@ probes::EnterScript(JSContext *cx, JSScript *script, JSFunction *maybeFun,
if (rt->spsProfiler.enabled()) {
if (!rt->spsProfiler.enter(script, maybeFun))
return false;
MOZ_ASSERT_IF(!fp->isGeneratorFrame(), !fp->hasPushedSPSFrame());
MOZ_ASSERT_IF(!fp->script()->isGenerator(), !fp->hasPushedSPSFrame());
fp->setPushedSPSFrame();
}

Просмотреть файл

@ -528,14 +528,6 @@ AbstractFramePtr::useNewType() const
return false;
}
inline bool
AbstractFramePtr::isGeneratorFrame() const
{
if (isInterpreterFrame())
return asInterpreterFrame()->isGeneratorFrame();
return false;
}
inline bool
AbstractFramePtr::isFunctionFrame() const
{

Просмотреть файл

@ -186,7 +186,6 @@ InterpreterFrame::prologue(JSContext *cx)
{
RootedScript script(cx, this->script());
MOZ_ASSERT(!isGeneratorFrame());
MOZ_ASSERT(cx->interpreterRegs().pc == script->code());
if (isEvalFrame()) {
@ -851,22 +850,6 @@ FrameIter::isNonEvalFunctionFrame() const
MOZ_CRASH("Unexpected state");
}
bool
FrameIter::isGeneratorFrame() const
{
switch (data_.state_) {
case DONE:
break;
case INTERP:
return interpFrame()->isGeneratorFrame();
case JIT:
return false;
case ASMJS:
return false;
}
MOZ_CRASH("Unexpected state");
}
JSAtom *
FrameIter::functionDisplayAtom() const
{

Просмотреть файл

@ -181,7 +181,6 @@ class AbstractFramePtr
inline JSCompartment *compartment() const;
inline bool hasCallObj() const;
inline bool isGeneratorFrame() const;
inline bool isFunctionFrame() const;
inline bool isGlobalFrame() const;
inline bool isEvalFrame() const;
@ -243,7 +242,7 @@ class NullFramePtr : public AbstractFramePtr
/* Flags specified for a frame as it is constructed. */
enum InitialFrameFlags {
INITIAL_NONE = 0,
INITIAL_CONSTRUCT = 0x20, /* == InterpreterFrame::CONSTRUCTING, asserted below */
INITIAL_CONSTRUCT = 0x10, /* == InterpreterFrame::CONSTRUCTING, asserted below */
};
enum ExecuteType {
@ -282,10 +281,9 @@ class InterpreterFrame
*/
DEBUGGER = 0x8,
GENERATOR = 0x10, /* frame is associated with a generator */
CONSTRUCTING = 0x20, /* frame is for a constructor invocation */
CONSTRUCTING = 0x10, /* frame is for a constructor invocation */
/* (0x40 and 0x80 are unused) */
/* (0x20, 0x40 and 0x80 are unused) */
/* Function prologue state */
HAS_CALL_OBJ = 0x100, /* CallObject created for heavyweight fun */
@ -758,34 +756,10 @@ class InterpreterFrame
markReturnValue();
}
/*
* A "generator" frame is a function frame associated with a generator.
* Since generators are not executed LIFO, the VM copies a single abstract
* generator frame back and forth between the LIFO VM stack (when the
* generator is active) and a snapshot stored in JSGenerator (when the
* generator is inactive). A generator frame is comprised of an
* InterpreterFrame structure and the values that make up the arguments,
* locals, and expression stack. The layout in the JSGenerator snapshot
* matches the layout on the stack (see the "VM stack layout" comment
* above).
*/
bool isGeneratorFrame() const {
bool ret = flags_ & GENERATOR;
MOZ_ASSERT_IF(ret, isNonEvalFunctionFrame());
return ret;
}
void initGeneratorFrame() const {
MOZ_ASSERT(!isGeneratorFrame());
void resumeGeneratorFrame(JSObject *scopeChain) {
MOZ_ASSERT(script()->isGenerator());
MOZ_ASSERT(isNonEvalFunctionFrame());
flags_ |= GENERATOR;
}
void resumeGeneratorFrame(HandleObject scopeChain) {
MOZ_ASSERT(!isGeneratorFrame());
MOZ_ASSERT(isNonEvalFunctionFrame());
flags_ |= GENERATOR | HAS_CALL_OBJ | HAS_SCOPECHAIN;
flags_ |= HAS_CALL_OBJ | HAS_SCOPECHAIN;
scopeChain_ = scopeChain;
}
@ -1584,7 +1558,6 @@ class FrameIter
bool isGlobalFrame() const;
bool isEvalFrame() const;
bool isNonEvalFunctionFrame() const;
bool isGeneratorFrame() const;
bool hasArgs() const { return isNonEvalFunctionFrame(); }
ScriptSource *scriptSource() const;

Просмотреть файл

@ -34,7 +34,7 @@ namespace js {
* Nightly) and without (all others). FIXME: Bug 1066322 - Enable ES6 symbols
* in all builds.
*/
static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 192;
static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 194;
static_assert(XDR_BYTECODE_VERSION_SUBTRAHEND % 2 == 0, "see the comment above");
static const uint32_t XDR_BYTECODE_VERSION =
uint32_t(0xb973c0de - (XDR_BYTECODE_VERSION_SUBTRAHEND

Просмотреть файл

@ -23,9 +23,6 @@
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/Exceptions.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/TextDecoderBinding.h"
#include "mozilla/dom/TextEncoderBinding.h"
#include "mozilla/dom/DOMErrorBinding.h"
#include "nsDOMMutationObserver.h"
#include "nsICycleCollectorListener.h"
@ -437,17 +434,6 @@ InitGlobalObject(JSContext* aJSContext, JS::Handle<JSObject*> aGlobal, uint32_t
// Stuff coming through this path always ends up as a DOM global.
MOZ_ASSERT(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL);
// Init WebIDL binding constructors wanted on all XPConnect globals.
//
// XXX Please do not add any additional classes here without the approval of
// the XPConnect module owner.
if (!PromiseBinding::GetConstructorObject(aJSContext, aGlobal) ||
!TextDecoderBinding::GetConstructorObject(aJSContext, aGlobal) ||
!TextEncoderBinding::GetConstructorObject(aJSContext, aGlobal) ||
!DOMErrorBinding::GetConstructorObject(aJSContext, aGlobal)) {
return UnexpectedFailure(false);
}
if (!(aFlags & nsIXPConnect::DONT_FIRE_ONNEWGLOBALHOOK))
JS_FireOnNewGlobalObject(aJSContext, aGlobal);

Просмотреть файл

@ -16,6 +16,12 @@
#include "nsDeviceContext.h"
#include "nsIFrame.h"
#include <algorithm>
#include "LayersLogging.h"
// If debugging this code you may wish to enable this logging, and also
// uncomment the DumpFrameTree call near the bottom of the file.
#define PET_LOG(...)
// #define PET_LOG(...) printf_stderr("PET: " __VA_ARGS__);
namespace mozilla {
@ -318,6 +324,7 @@ GetClosest(nsIFrame* aRoot, const nsPoint& aPointRelativeToRootFrame,
nsRegion exposedRegion(aTargetRect);
for (uint32_t i = 0; i < aCandidates.Length(); ++i) {
nsIFrame* f = aCandidates[i];
PET_LOG("Checking candidate %p\n", f);
bool preservesAxisAlignedRectangles = false;
nsRect borderBox = nsLayoutUtils::TransformFrameRectToAncestor(f,
@ -326,6 +333,7 @@ GetClosest(nsIFrame* aRoot, const nsPoint& aPointRelativeToRootFrame,
region.And(exposedRegion, borderBox);
if (region.IsEmpty()) {
PET_LOG(" candidate %p had empty hit region\n", f);
continue;
}
@ -335,15 +343,18 @@ GetClosest(nsIFrame* aRoot, const nsPoint& aPointRelativeToRootFrame,
SubtractFromExposedRegion(&exposedRegion, region);
}
if (!IsElementClickable(f)) {
if (!IsElementClickable(f, nsGkAtoms::body)) {
PET_LOG(" candidate %p was not clickable\n", f);
continue;
}
// If our current closest frame is a descendant of 'f', skip 'f' (prefer
// the nested frame).
if (bestTarget && nsLayoutUtils::IsProperAncestorFrameCrossDoc(f, bestTarget, aRoot)) {
PET_LOG(" candidate %p was ancestor for bestTarget %p\n", f, bestTarget);
continue;
}
if (!nsLayoutUtils::IsAncestorFrameCrossDoc(aRestrictToDescendants, f, aRoot)) {
PET_LOG(" candidate %p was not descendant of restrictroot %p\n", f, aRestrictToDescendants);
continue;
}
@ -356,6 +367,7 @@ GetClosest(nsIFrame* aRoot, const nsPoint& aPointRelativeToRootFrame,
distance *= aPrefs->mVisitedWeight / 100.0f;
}
if (distance < bestDistance) {
PET_LOG(" candidate %p is the new best\n", f);
bestDistance = distance;
bestTarget = f;
}
@ -373,9 +385,14 @@ FindFrameTargetedByInputEvent(WidgetGUIEvent* aEvent,
nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0;
nsIFrame* target =
nsLayoutUtils::GetFrameForPoint(aRootFrame, aPointRelativeToRootFrame, flags);
PET_LOG("Found initial target %p for event class %s point %s relative to root frame %p\n",
target, (aEvent->mClass == eMouseEventClass ? "mouse" :
(aEvent->mClass == eTouchEventClass ? "touch" : "other")),
mozilla::layers::Stringify(aPointRelativeToRootFrame).c_str(), aRootFrame);
const EventRadiusPrefs* prefs = GetPrefsFor(aEvent->mClass);
if (!prefs || !prefs->mEnabled || (target && IsElementClickable(target, nsGkAtoms::body))) {
PET_LOG("Retargeting disabled or target %p is clickable\n", target);
return target;
}
@ -385,6 +402,7 @@ FindFrameTargetedByInputEvent(WidgetGUIEvent* aEvent,
prefs->mTouchOnly &&
aEvent->AsMouseEvent()->inputSource !=
nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) {
PET_LOG("Mouse input event is not from a touch source\n");
return target;
}
@ -398,6 +416,8 @@ FindFrameTargetedByInputEvent(WidgetGUIEvent* aEvent,
nsRect targetRect = GetTargetRect(aRootFrame, aPointRelativeToRootFrame,
restrictToDescendants, prefs, aFlags);
PET_LOG("Expanded point to target rect %s\n",
mozilla::layers::Stringify(targetRect).c_str());
nsAutoTArray<nsIFrame*,8> candidates;
nsresult rv = nsLayoutUtils::GetFramesForArea(aRootFrame, targetRect, candidates, flags);
if (NS_FAILED(rv)) {
@ -410,6 +430,12 @@ FindFrameTargetedByInputEvent(WidgetGUIEvent* aEvent,
if (closestClickable) {
target = closestClickable;
}
PET_LOG("Final target is %p\n", target);
// Uncomment this to dump the frame tree to help with debugging.
// Note that dumping the frame tree at the top of the function may flood
// logcat on Android devices and cause the PET_LOGs to get dropped.
// aRootFrame->DumpFrameTree();
if (!target || !prefs->mRepositionEventCoords) {
// No repositioning required for this event

Просмотреть файл

@ -1132,7 +1132,7 @@ ScrollFrameHelper::ThumbMoved(nsScrollbarFrame* aScrollbar,
nsPoint current = GetScrollPosition();
nsPoint dest = current;
if (isHorizontal) {
dest.x = aNewPos;
dest.x = IsLTR() ? aNewPos : aNewPos - GetScrollRange().width;
} else {
dest.y = aNewPos;
}

Просмотреть файл

@ -101,7 +101,9 @@ SVGFEContainerFrame::AttributeChanged(int32_t aNameSpaceID,
{
nsSVGFE *element = static_cast<nsSVGFE*>(mContent);
if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
nsSVGEffects::InvalidateRenderingObservers(this);
MOZ_ASSERT(GetParent()->GetType() == nsGkAtoms::svgFilterFrame,
"Observers observe the filter, so that's what we must invalidate");
nsSVGEffects::InvalidateDirectRenderingObservers(GetParent());
}
return SVGFEContainerFrameBase::AttributeChanged(aNameSpaceID,

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Keep in (case-insensitive) order:
#include "nsContainerFrame.h"
#include "nsContentUtils.h"
#include "nsFrame.h"
#include "nsGkAtoms.h"
@ -122,7 +123,9 @@ SVGFEImageFrame::AttributeChanged(int32_t aNameSpaceID,
{
SVGFEImageElement *element = static_cast<SVGFEImageElement*>(mContent);
if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
nsSVGEffects::InvalidateRenderingObservers(this);
MOZ_ASSERT(GetParent()->GetType() == nsGkAtoms::svgFilterFrame,
"Observers observe the filter, so that's what we must invalidate");
nsSVGEffects::InvalidateDirectRenderingObservers(GetParent());
}
if (aNameSpaceID == kNameSpaceID_XLink &&
aAttribute == nsGkAtoms::href) {
@ -140,5 +143,5 @@ SVGFEImageFrame::AttributeChanged(int32_t aNameSpaceID,
}
return SVGFEImageFrameBase::AttributeChanged(aNameSpaceID,
aAttribute, aModType);
aAttribute, aModType);
}

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Keep in (case-insensitive) order:
#include "nsContainerFrame.h"
#include "nsFrame.h"
#include "nsGkAtoms.h"
#include "nsSVGEffects.h"
@ -99,9 +100,11 @@ SVGFELeafFrame::AttributeChanged(int32_t aNameSpaceID,
{
nsSVGFE *element = static_cast<nsSVGFE*>(mContent);
if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
nsSVGEffects::InvalidateRenderingObservers(this);
MOZ_ASSERT(GetParent()->GetType() == nsGkAtoms::svgFilterFrame,
"Observers observe the filter, so that's what we must invalidate");
nsSVGEffects::InvalidateDirectRenderingObservers(GetParent());
}
return SVGFELeafFrameBase::AttributeChanged(aNameSpaceID,
aAttribute, aModType);
aAttribute, aModType);
}

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Keep in (case-insensitive) order:
#include "nsContainerFrame.h"
#include "nsFrame.h"
#include "nsGkAtoms.h"
#include "nsSVGEffects.h"
@ -26,8 +27,8 @@ public:
NS_DECL_FRAMEARENA_HELPERS
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
{
@ -79,7 +80,9 @@ SVGFEUnstyledLeafFrame::AttributeChanged(int32_t aNameSpaceID,
{
SVGFEUnstyledElement *element = static_cast<SVGFEUnstyledElement*>(mContent);
if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
nsSVGEffects::InvalidateRenderingObservers(this);
MOZ_ASSERT(GetParent()->GetParent()->GetType() == nsGkAtoms::svgFilterFrame,
"Observers observe the filter, so that's what we must invalidate");
nsSVGEffects::InvalidateDirectRenderingObservers(GetParent()->GetParent());
}
return SVGFEUnstyledLeafFrameBase::AttributeChanged(aNameSpaceID,

Просмотреть файл

@ -3324,7 +3324,9 @@ SVGTextFrame::ReflowSVGNonDisplayText()
// element is within a <mask>, say, the element referencing the <mask> will
// be updated, which will then cause this SVGTextFrame to be painted and
// in doing so cause the anonymous block frame to be reflowed.
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
// Finally, we need to actually reflow the anonymous block frame and update
// mPositions, in case we are being reflowed immediately after a DOM
@ -5195,7 +5197,9 @@ void
SVGTextFrame::NotifyGlyphMetricsChange()
{
AddStateBits(NS_STATE_SVG_POSITIONING_DIRTY);
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
ScheduleReflowSVG();
}

Просмотреть файл

@ -315,7 +315,7 @@ nsSVGClipPathFrame::AttributeChanged(int32_t aNameSpaceID,
nsISVGChildFrame::TRANSFORM_CHANGED);
}
if (aAttribute == nsGkAtoms::clipPathUnits) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsSVGEffects::InvalidateDirectRenderingObservers(this);
}
}

Просмотреть файл

@ -228,7 +228,9 @@ nsSVGRenderingObserverProperty::DoUpdate()
if (frame && frame->IsFrameOfType(nsIFrame::eSVG)) {
// Changes should propagate out to things that might be observing
// the referencing frame or its ancestors.
nsSVGEffects::InvalidateRenderingObservers(frame);
nsLayoutUtils::PostRestyleEvent(
frame->GetContent()->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
}
}
@ -316,16 +318,16 @@ nsSVGFilterProperty::DoUpdate()
if (!frame)
return;
if (frame && frame->IsFrameOfType(nsIFrame::eSVG)) {
// Changes should propagate out to things that might be observing
// the referencing frame or its ancestors.
nsSVGEffects::InvalidateRenderingObservers(frame);
}
// Repaint asynchronously in case the filter frame is being torn down
nsChangeHint changeHint =
nsChangeHint(nsChangeHint_RepaintFrame);
if (frame && frame->IsFrameOfType(nsIFrame::eSVG)) {
// Changes should propagate out to things that might be observing
// the referencing frame or its ancestors.
NS_UpdateHint(changeHint, nsChangeHint_InvalidateRenderingObservers);
}
// Don't need to request UpdateOverflow if we're being reflowed.
if (!(frame->GetStateBits() & NS_FRAME_IN_REFLOW)) {
NS_UpdateHint(changeHint, nsChangeHint_UpdateOverflow);
@ -351,9 +353,9 @@ nsSVGMarkerProperty::DoUpdate()
// Don't need to request ReflowFrame if we're being reflowed.
if (!(frame->GetStateBits() & NS_FRAME_IN_REFLOW)) {
NS_UpdateHint(changeHint, nsChangeHint_InvalidateRenderingObservers);
// XXXjwatt: We need to unify SVG into standard reflow so we can just use
// nsChangeHint_NeedReflow | nsChangeHint_NeedDirtyReflow here.
nsSVGEffects::InvalidateRenderingObservers(frame);
// XXXSDL KILL THIS!!!
nsSVGUtils::ScheduleReflowSVG(frame);
}
@ -423,7 +425,9 @@ nsSVGPaintingProperty::DoUpdate()
return;
if (frame->GetStateBits() & NS_FRAME_SVG_LAYOUT) {
nsSVGEffects::InvalidateRenderingObservers(frame);
nsLayoutUtils::PostRestyleEvent(
frame->GetContent()->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
frame->InvalidateFrameSubtree();
} else {
InvalidateAllContinuations(frame);

Просмотреть файл

@ -91,7 +91,9 @@ nsSVGForeignObjectFrame::AttributeChanged(int32_t aNameSpaceID,
if (aNameSpaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
// XXXjwatt: why mark intrinsic widths dirty? can't we just use eResize?
RequestReflow(nsIPresShell::eStyleChange);
@ -99,7 +101,9 @@ nsSVGForeignObjectFrame::AttributeChanged(int32_t aNameSpaceID,
aAttribute == nsGkAtoms::y) {
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nullptr;
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
} else if (aAttribute == nsGkAtoms::transform) {
// We don't invalidate for transform changes (the layers code does that).
@ -109,7 +113,9 @@ nsSVGForeignObjectFrame::AttributeChanged(int32_t aNameSpaceID,
mCanvasTM = nullptr;
} else if (aAttribute == nsGkAtoms::viewBox ||
aAttribute == nsGkAtoms::preserveAspectRatio) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
}
}

Просмотреть файл

@ -191,7 +191,9 @@ nsSVGImageFrame::AttributeChanged(int32_t aNameSpaceID,
aAttribute == nsGkAtoms::y ||
aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
return NS_OK;
}
@ -584,14 +586,18 @@ nsSVGImageListener::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect
if (aType == imgINotificationObserver::LOAD_COMPLETE) {
mFrame->InvalidateFrame();
nsSVGEffects::InvalidateRenderingObservers(mFrame);
nsLayoutUtils::PostRestyleEvent(
mFrame->GetContent()->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(mFrame);
}
if (aType == imgINotificationObserver::FRAME_UPDATE) {
// No new dimensions, so we don't need to call
// nsSVGUtils::InvalidateAndScheduleBoundsUpdate.
nsSVGEffects::InvalidateRenderingObservers(mFrame);
nsLayoutUtils::PostRestyleEvent(
mFrame->GetContent()->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
mFrame->InvalidateFrame();
}
@ -599,7 +605,9 @@ nsSVGImageListener::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRect
// Called once the resource's dimensions have been obtained.
aRequest->GetImage(getter_AddRefs(mFrame->mImageContainer));
mFrame->InvalidateFrame();
nsSVGEffects::InvalidateRenderingObservers(mFrame);
nsLayoutUtils::PostRestyleEvent(
mFrame->GetContent()->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(mFrame);
}

Просмотреть файл

@ -12,7 +12,6 @@
#include "nsIFrame.h"
#include "nsISVGChildFrame.h"
#include "nsSVGContainerFrame.h"
#include "nsSVGEffects.h"
#include "nsSVGIntegrationUtils.h"
#include "mozilla/dom/SVGSVGElement.h"
@ -197,7 +196,9 @@ nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
if (aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
if (content->HasViewBoxOrSyntheticViewBox()) {
@ -232,7 +233,9 @@ nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
// and cause DoApplyRenderingChangeToTree to make the SchedulePaint call.
if (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
} else if (aAttribute == nsGkAtoms::viewBox ||
(aAttribute == nsGkAtoms::preserveAspectRatio &&

Просмотреть файл

@ -139,7 +139,9 @@ nsSVGPathGeometryFrame::AttributeChanged(int32_t aNameSpaceID,
if (aNameSpaceID == kNameSpaceID_None &&
(static_cast<nsSVGPathGeometryElement*>
(mContent)->AttributeDefinesGeometry(aAttribute))) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
mContent->AsElement(), nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
}
return NS_OK;

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Keep in (case-insensitive) order:
#include "nsContainerFrame.h"
#include "nsFrame.h"
#include "nsGkAtoms.h"
#include "nsStyleContext.h"
@ -97,7 +98,10 @@ nsSVGStopFrame::AttributeChanged(int32_t aNameSpaceID,
{
if (aNameSpaceID == kNameSpaceID_None &&
aAttribute == nsGkAtoms::offset) {
nsSVGEffects::InvalidateRenderingObservers(this);
MOZ_ASSERT(GetParent()->GetType() == nsGkAtoms::svgLinearGradientFrame ||
GetParent()->GetType() == nsGkAtoms::svgRadialGradientFrame,
"Observers observe the gradient, so that's what we must invalidate");
nsSVGEffects::InvalidateDirectRenderingObservers(GetParent());
}
return nsSVGStopFrameBase::AttributeChanged(aNameSpaceID,

Просмотреть файл

@ -124,7 +124,9 @@ nsSVGUseFrame::AttributeChanged(int32_t aNameSpaceID,
aAttribute == nsGkAtoms::y) {
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nullptr;
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
useElement, nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
} else if (aAttribute == nsGkAtoms::width ||
@ -139,14 +141,18 @@ nsSVGUseFrame::AttributeChanged(int32_t aNameSpaceID,
useElement->SyncWidthOrHeight(aAttribute);
}
if (invalidate) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
useElement, nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
}
}
} else if (aNameSpaceID == kNameSpaceID_XLink &&
aAttribute == nsGkAtoms::href) {
// we're changing our nature, clear out the clone information
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
useElement, nsRestyleHint(0),
nsChangeHint_InvalidateRenderingObservers);
nsSVGUtils::ScheduleReflowSVG(this);
useElement->mOriginal = nullptr;
useElement->UnlinkSource();
@ -234,7 +240,8 @@ nsSVGUseFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
SVGUseElement *use = static_cast<SVGUseElement*>(mContent);
nsIContent* clone = use->CreateAnonymousContent();
nsSVGEffects::InvalidateRenderingObservers(this);
nsLayoutUtils::PostRestyleEvent(
use, nsRestyleHint(0), nsChangeHint_InvalidateRenderingObservers);
if (!clone)
return NS_ERROR_FAILURE;
if (!aElements.AppendElement(clone))

Просмотреть файл

@ -41,6 +41,9 @@ public:
virtual void RepeatButtonScroll(nsScrollbarFrame* aScrollbar) = 0;
/**
* aOldPos and aNewPos are scroll positions.
* The scroll positions start with zero at the left edge; implementors that want
* zero at the right edge for RTL content will need to adjust accordingly.
* (See ScrollFrameHelper::ThumbMoved in nsGfxScrollFrame.cpp.)
* @note This method might destroy the frame, pres shell, and other objects.
*/
virtual void ThumbMoved(nsScrollbarFrame* aScrollbar,

Просмотреть файл

@ -420,6 +420,14 @@ pref("media.mediasource.enabled", false);
pref("media.mediasource.enabled", true);
#endif
#ifdef MOZ_WIDGET_GONK
pref("media.mediasource.mp4.enabled", false);
pref("media.mediasource.webm.enabled", false);
#else
pref("media.mediasource.mp4.enabled", false);
pref("media.mediasource.webm.enabled", true);
#endif
#ifdef MOZ_WEBSPEECH
pref("media.webspeech.recognition.enable", false);
pref("media.webspeech.synth.enabled", false);

Просмотреть файл

@ -5,7 +5,7 @@
from setuptools import setup, find_packages
PACKAGE_NAME = 'mozlog'
PACKAGE_VERSION = '2.6'
PACKAGE_VERSION = '2.7'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,

Просмотреть файл

@ -1,17 +1,15 @@
[share-registry-import-document.html]
type: testharness
expected: TIMEOUT
[Registry of the import should share master document registry]
expected: TIMEOUT
[Registry of the master document should be shared with imported document\'s registry]
expected: TIMEOUT
[Registry of the imported document should be shared with master document. Import is asynchronous]
expected: TIMEOUT
[Registry of the master document should be shared with imported document. Import is asynchronous]
expected: FAIL
[Registry of the imported document should be shared with master document. Import is syncronous]
expected: FAIL
[Registry of the master document should be shared with imported document. Import is syncronous]
expected: FAIL
expected: TIMEOUT

Просмотреть файл

@ -615,6 +615,9 @@ bool gSafeMode = false;
* singleton.
*/
class nsXULAppInfo : public nsIXULAppInfo,
#ifdef NIGHTLY_BUILD
public nsIObserver,
#endif
#ifdef XP_WIN
public nsIWinAppHelper,
#endif
@ -630,6 +633,9 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIXULAPPINFO
NS_DECL_NSIXULRUNTIME
#ifdef NIGHTLY_BUILD
NS_DECL_NSIOBSERVER
#endif
#ifdef MOZ_CRASHREPORTER
NS_DECL_NSICRASHREPORTER
NS_DECL_NSIFINISHDUMPINGCALLBACK
@ -642,6 +648,9 @@ public:
NS_INTERFACE_MAP_BEGIN(nsXULAppInfo)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXULRuntime)
NS_INTERFACE_MAP_ENTRY(nsIXULRuntime)
#ifdef NIGHTLY_BUILD
NS_INTERFACE_MAP_ENTRY(nsIObserver)
#endif
#ifdef XP_WIN
NS_INTERFACE_MAP_ENTRY(nsIWinAppHelper)
#endif
@ -842,8 +851,25 @@ nsXULAppInfo::GetProcessID(uint32_t* aResult)
}
static bool gBrowserTabsRemoteAutostart = false;
static nsString gBrowserTabsRemoteDisabledReason;
static bool gBrowserTabsRemoteAutostartInitialized = false;
#ifdef NIGHTLY_BUILD
NS_IMETHODIMP
nsXULAppInfo::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData) {
if (!nsCRT::strcmp(aTopic, "getE10SBlocked")) {
nsCOMPtr<nsISupportsString> ret = do_QueryInterface(aSubject);
if (!ret)
return NS_ERROR_FAILURE;
ret->SetData(gBrowserTabsRemoteDisabledReason);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
#endif
NS_IMETHODIMP
nsXULAppInfo::GetBrowserTabsRemoteAutostart(bool* aResult)
{
@ -4538,8 +4564,10 @@ XRE_GetProcessType()
static void
LogE10sBlockedReason(const char *reason) {
gBrowserTabsRemoteDisabledReason.Assign(NS_ConvertASCIItoUTF16(reason));
nsAutoString msg(NS_LITERAL_STRING("==================\nE10s has been blocked from running because:\n"));
msg.Append(NS_ConvertASCIItoUTF16(reason));
msg.Append(gBrowserTabsRemoteDisabledReason);
msg.AppendLiteral("\n==================\n");
nsCOMPtr<nsIConsoleService> console(do_GetService("@mozilla.org/consoleservice;1"));
if (console) {
@ -4574,11 +4602,11 @@ mozilla::BrowserTabsRemoteAutostart()
if (prefEnabled) {
if (gSafeMode) {
LogE10sBlockedReason("Firefox is in safe mode.");
LogE10sBlockedReason("Safe mode");
} else if (disabledForA11y) {
LogE10sBlockedReason("An accessibility tool is active.");
LogE10sBlockedReason("An accessibility tool is active");
} else if (disabledForIME) {
LogE10sBlockedReason("The keyboard being used has activated IME.");
LogE10sBlockedReason("The keyboard being used has activated IME");
} else {
gBrowserTabsRemoteAutostart = true;
}
@ -4635,7 +4663,7 @@ mozilla::BrowserTabsRemoteAutostart()
if (accelDisabled) {
gBrowserTabsRemoteAutostart = false;
LogE10sBlockedReason("Hardware acceleration is disabled.");
LogE10sBlockedReason("Hardware acceleration is disabled");
}
}
#endif

Просмотреть файл

@ -168,10 +168,18 @@ main(int argc, char **argv)
NSString *newWebRTPath =
[NSString stringWithFormat: @"%@%s%s", firefoxPath, APP_RESOURCES_PATH,
WEBAPPRT_EXECUTABLE];
NSLog(@"### Firefox webapprt path: %@", newWebRTPath);
NSLog(@"### Trying Firefox webapprt path: %@", newWebRTPath);
if (![fileClerk fileExistsAtPath:newWebRTPath]) {
NSString* msg = [NSString stringWithFormat: @"This version of Firefox (%@) cannot run web applications, because it is not recent enough or damaged", firefoxVersion];
@throw MakeException(@"Missing Web Runtime Files", msg);
newWebRTPath =
[NSString stringWithFormat: @"%@%s%s", firefoxPath, APP_MACOS_PATH,
WEBAPPRT_EXECUTABLE];
NSLog(@"### Trying Firefox webapprt path: %@", newWebRTPath);
if (![fileClerk fileExistsAtPath:newWebRTPath]) {
NSString* msg =
[NSString stringWithFormat:
@"This version of Firefox (%@) cannot run web applications, because it is not recent enough or damaged", firefoxVersion];
@throw MakeException(@"Missing Web Runtime Files", msg);
}
}
[fileClerk removeItemAtPath: myWebRTPath error: &errorDesc];

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше