From ddc1a655e6ba8914f560ae6b8d4d93419baddfe3 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Thu, 30 May 2013 11:40:14 -0700 Subject: [PATCH 01/85] Bug 876776 - Import latest version of js/examples/jorendb.js. r=NPOTB (yet) --- js/examples/jorendb.js | 820 ++++++++++++++++++++++++----------------- 1 file changed, 473 insertions(+), 347 deletions(-) diff --git a/js/examples/jorendb.js b/js/examples/jorendb.js index d83589f08fc..54fc782596f 100644 --- a/js/examples/jorendb.js +++ b/js/examples/jorendb.js @@ -5,12 +5,13 @@ * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ /* - * jorendb is a simple command-line debugger for shell-js programs. It is - * intended as a demo of the Debugger object (as there are no shell js programs to - * speak of). + * jorendb is a simple command-line debugger for shell-js programs. It is + * intended as a demo of the Debugger object (as there are no shell js programs + * to speak of). * * To run it: $JS -d path/to/this/file/jorendb.js * To run some JS code under it, try: @@ -18,367 +19,492 @@ * Execution will stop at debugger statements and you'll get a jorendb prompt. */ -(function () { - var debuggerSource = "(" + function () { - // Debugger state. - var focusedFrame = null; - var topFrame = null; - var debuggeeValues = [null]; - var lastExc = null; +// Debugger state. +var focusedFrame = null; +var topFrame = null; +var debuggeeValues = {}; +var nextDebuggeeValueIndex = 1; +var lastExc = null; - // Convert a debuggee value v to a string. - function dvToString(v) { - return (typeof v !== 'object' || v === null) ? uneval(v) : "[object " + v.class + "]"; +// Cleanup functions to run when we next re-enter the repl. +var replCleanups = []; + +// Convert a debuggee value v to a string. +function dvToString(v) { + return (typeof v !== 'object' || v === null) ? uneval(v) : "[object " + v.class + "]"; +} + +function showDebuggeeValue(dv) { + var dvrepr = dvToString(dv); + var i = nextDebuggeeValueIndex++; + debuggeeValues["$" + i] = dv; + print("$" + i + " = " + dvrepr); +} + +Object.defineProperty(Debugger.Frame.prototype, "num", { + configurable: true, + enumerable: false, + get: function () { + var i = 0; + for (var f = topFrame; f && f !== this; f = f.older) + i++; + return f === null ? undefined : i; } + }); - function showDebuggeeValue(dv) { - var dvrepr = dvToString(dv); - var i = debuggeeValues.length; - debuggeeValues[i] = dv; - print("$" + i + " = " + dvrepr); - } +Debugger.Frame.prototype.frameDescription = function frameDescription() { + if (this.type == "call") + return ((this.callee.name || '') + + "(" + this.arguments.map(dvToString).join(", ") + ")"); + else + return this.type + " code"; +} - Object.defineProperty(Debugger.Frame.prototype, "num", { - configurable: true, - enumerable: false, - get: function () { - var i = 0; - for (var f = topFrame; f && f !== this; f = f.older) - i++; - return f === null ? undefined : i; - } - }); +Debugger.Frame.prototype.positionDescription = function positionDescription() { + if (this.script) { + var line = this.script.getOffsetLine(this.offset); + if (this.script.url) + return this.script.url + ":" + line; + return "line " + line; + } + return null; +} - function framePosition(f) { - if (!f.script) - return f.type + " code"; - return (f.script.url || f.type + " code") + ":" + f.script.getOffsetLine(f.offset); - } +Debugger.Frame.prototype.fullDescription = function fullDescription() { + var fr = this.frameDescription(); + var pos = this.positionDescription(); + if (pos) + return fr + ", " + pos; + return fr; +} - function callDescription(f) { - return ((f.callee.name || '') + - "(" + f.arguments.map(dvToString).join(", ") + ")"); - } - - function showFrame(f, n) { - if (f === undefined || f === null) { - f = focusedFrame; - if (f === null) { - print("No stack."); - return; - } - } - if (n === undefined) { - n = f.num; - if (n === undefined) - throw new Error("Internal error: frame not on stack"); - } - - var me = '#' + n; - if (f.type === "call") - me += ' ' + callDescription(f); - me += ' ' + framePosition(f); - print(me); - } - - function saveExcursion(fn) { - var tf = topFrame, ff = focusedFrame; - try { - return fn(); - } finally { - topFrame = tf; - focusedFrame = ff; - } - } - - function quitCommand() { - dbg.enabled = false; - quit(0); - } - - function backtraceCommand() { - if (topFrame === null) - print("No stack."); - for (var i = 0, f = topFrame; f; i++, f = f.older) - showFrame(f, i); - } - - function printCommand(rest) { - if (focusedFrame === null) { - // This is super bogus, need a way to create an env wrapping the debuggeeGlobal - // and eval against that. - var nonwrappedValue; - try { - nonwrappedValue = debuggeeGlobal.eval(rest); - } catch (exc) { - print("Exception caught."); - nonwrappedValue = exc; - } - if (typeof nonwrappedValue !== "object" || nonwrappedValue === null) { - // primitive value, no sweat - print(" " + uneval(nonwrappedValue)); - } else { - // junk for now - print(" " + Object.prototype.toString.call(nonwrappedValue)); - } - } else { - // This is the real deal. - var cv = saveExcursion(function () { - return focusedFrame.eval(rest); - }); - if (cv === null) { - if (!dbg.enabled) - return [cv]; - print("Debuggee died."); - } else if ('return' in cv) { - if (!dbg.enabled) - return [undefined]; - showDebuggeeValue(cv.return); - } else { - if (!dbg.enabled) - return [cv]; - print("Exception caught. (To rethrow it, type 'throw'.)"); - lastExc = cv.throw; - showDebuggeeValue(lastExc); - } - } - } - - function detachCommand() { - dbg.enabled = false; - return [undefined]; - } - - function continueCommand() { - if (focusedFrame === null) { - print("No stack."); - return; - } - return [undefined]; - } - - function throwCommand(rest) { - var v; - if (focusedFrame !== topFrame) { - print("To throw, you must select the newest frame (use 'frame 0')."); - return; - } else if (focusedFrame === null) { - print("No stack."); - return; - } else if (rest === '') { - return [{throw: lastExc}]; - } else { - var cv = saveExcursion(function () { return focusedFrame.eval(rest); }); - if (cv === null) { - if (!dbg.enabled) - return [cv]; - print("Debuggee died while determining what to throw. Stopped."); - } else if ('return' in cv) { - return [{throw: cv.return}]; - } else { - if (!dbg.enabled) - return [cv]; - print("Exception determining what to throw. Stopped."); - showDebuggeeValue(cv.throw); - } - return; - } - } - - function frameCommand(rest) { - var n, f; - if (rest.match(/[0-9]+/)) { - n = +rest; - f = topFrame; - if (f === null) { - print("No stack."); - return; - } - for (var i = 0; i < n && f; i++) { - if (!f.older) { - print("There is no frame " + rest + "."); - return; - } - f.older.younger = f; - f = f.older; - } - focusedFrame = f; - showFrame(f, n); - } else if (rest !== '') { - if (topFrame === null) - print("No stack."); - else - showFrame(); - } else { - print("do what now?"); - } - } - - function debugmeCommand() { - var meta = newGlobal("new-compartment"); - meta.debuggeeGlobal = this; - meta.debuggerSource = debuggerSource; - meta.prompt = prompt.replace('(', '(meta-'); - meta.eval(debuggerSource); - } - - function upCommand() { - if (focusedFrame === null) - print("No stack."); - else if (focusedFrame.older === null) - print("Initial frame selected; you cannot go up."); - else { - focusedFrame.older.younger = focusedFrame; - focusedFrame = focusedFrame.older; - showFrame(); - } - } - - function downCommand() { - if (focusedFrame === null) - print("No stack."); - else if (!focusedFrame.younger) - print("Youngest frame selected; you cannot go down."); - else { - focusedFrame = focusedFrame.younger; - showFrame(); - } - } - - function forcereturnCommand(rest) { - var v; - var f = focusedFrame; - if (f !== topFrame) { - print("To forcereturn, you must select the newest frame (use 'frame 0')."); - } else if (f === null) { - print("Nothing on the stack."); - } else if (rest === '') { - return [{return: undefined}]; - } else { - var cv = saveExcursion(function () { return f.eval(rest); }); - if (cv === null) { - if (!dbg.enabled) - return [cv]; - print("Debuggee died while determining what to forcereturn. Stopped."); - } else if ('return' in cv) { - return [{return: cv.return}]; - } else { - if (!dbg.enabled) - return [cv]; - print("Error determining what to forcereturn. Stopped."); - showDebuggeeValue(cv.throw); - } - } - } - - // Build the table of commands. - var commands = {}; - var commandArray = [ - backtraceCommand, "bt", "where", - continueCommand, "c", - detachCommand, - debugmeCommand, - downCommand, "d", - forcereturnCommand, - frameCommand, "f", - printCommand, "p", - quitCommand, "q", - throwCommand, "t", - upCommand, "u" - ]; - var last = null; - for (var i = 0; i < commandArray.length; i++) { - var cmd = commandArray[i]; - if (typeof cmd === "string") - commands[cmd] = last; +Object.defineProperty(Debugger.Frame.prototype, "line", { + configurable: true, + enumerable: false, + get: function() { + if (this.script) + return this.script.getOffsetLine(this.offset); else - last = commands[cmd.name.replace(/Command$/, '')] = cmd; + return null; } + }); - // Break cmd into two parts: its first word and everything else. - function breakcmd(cmd) { - cmd = cmd.trimLeft(); - var m = /\s/.exec(cmd); - if (m === null) - return [cmd, '']; - return [cmd.slice(0, m.index), cmd.slice(m.index).trimLeft()]; +function callDescription(f) { + return ((f.callee.name || '') + + "(" + f.arguments.map(dvToString).join(", ") + ")"); +} + +function showFrame(f, n) { + if (f === undefined || f === null) { + f = focusedFrame; + if (f === null) { + print("No stack."); + return; } + } + if (n === undefined) { + n = f.num; + if (n === undefined) + throw new Error("Internal error: frame not on stack"); + } - function runcmd(cmd) { - var pieces = breakcmd(cmd); - if (pieces[0] === "") - return undefined; + print('#' + n + " " + f.fullDescription()); +} - var first = pieces[0], rest = pieces[1]; - if (!commands.hasOwnProperty(first)) { - print("unrecognized command '" + first + "'"); - return undefined; +function saveExcursion(fn) { + var tf = topFrame, ff = focusedFrame; + try { + return fn(); + } finally { + topFrame = tf; + focusedFrame = ff; + } +} + +// Evaluate an expression in the Debugger global +function evalCommand(expr) { + eval(expr); +} + +function quitCommand() { + dbg.enabled = false; + quit(0); +} + +function backtraceCommand() { + if (topFrame === null) + print("No stack."); + for (var i = 0, f = topFrame; f; i++, f = f.older) + showFrame(f, i); +} + +function printCommand(rest) { + // This is the real deal. + var cv = saveExcursion( + () => focusedFrame == null + ? debuggeeGlobalWrapper.evalInGlobalWithBindings(rest, debuggeeValues) + : focusedFrame.evalWithBindings(rest, debuggeeValues)); + if (cv === null) { + if (!dbg.enabled) + return [cv]; + print("Debuggee died."); + } else if ('return' in cv) { + if (!dbg.enabled) + return [undefined]; + showDebuggeeValue(cv.return); + } else { + if (!dbg.enabled) + return [cv]; + print("Exception caught. (To rethrow it, type 'throw'.)"); + lastExc = cv.throw; + showDebuggeeValue(lastExc); + } +} + +function detachCommand() { + dbg.enabled = false; + return [undefined]; +} + +function continueCommand() { + if (focusedFrame === null) { + print("No stack."); + return; + } + return [undefined]; +} + +function throwCommand(rest) { + var v; + if (focusedFrame !== topFrame) { + print("To throw, you must select the newest frame (use 'frame 0')."); + return; + } else if (focusedFrame === null) { + print("No stack."); + return; + } else if (rest === '') { + return [{throw: lastExc}]; + } else { + var cv = saveExcursion(function () { return focusedFrame.eval(rest); }); + if (cv === null) { + if (!dbg.enabled) + return [cv]; + print("Debuggee died while determining what to throw. Stopped."); + } else if ('return' in cv) { + return [{throw: cv.return}]; + } else { + if (!dbg.enabled) + return [cv]; + print("Exception determining what to throw. Stopped."); + showDebuggeeValue(cv.throw); + } + return; + } +} + +function frameCommand(rest) { + var n, f; + if (rest.match(/[0-9]+/)) { + n = +rest; + f = topFrame; + if (f === null) { + print("No stack."); + return; + } + for (var i = 0; i < n && f; i++) { + if (!f.older) { + print("There is no frame " + rest + "."); + return; } + f.older.younger = f; + f = f.older; + } + focusedFrame = f; + showFrame(f, n); + } else if (rest !== '') { + if (topFrame === null) + print("No stack."); + else + showFrame(); + } else { + print("do what now?"); + } +} - var cmd = commands[first]; - if (cmd.length === 0 && rest !== '') { - print("this command cannot take an argument"); - return undefined; - } +function upCommand() { + if (focusedFrame === null) + print("No stack."); + else if (focusedFrame.older === null) + print("Initial frame selected; you cannot go up."); + else { + focusedFrame.older.younger = focusedFrame; + focusedFrame = focusedFrame.older; + showFrame(); + } +} - return cmd(rest); +function downCommand() { + if (focusedFrame === null) + print("No stack."); + else if (!focusedFrame.younger) + print("Youngest frame selected; you cannot go down."); + else { + focusedFrame = focusedFrame.younger; + showFrame(); + } +} + +function forcereturnCommand(rest) { + var v; + var f = focusedFrame; + if (f !== topFrame) { + print("To forcereturn, you must select the newest frame (use 'frame 0')."); + } else if (f === null) { + print("Nothing on the stack."); + } else if (rest === '') { + return [{return: undefined}]; + } else { + var cv = saveExcursion(function () { return f.eval(rest); }); + if (cv === null) { + if (!dbg.enabled) + return [cv]; + print("Debuggee died while determining what to forcereturn. Stopped."); + } else if ('return' in cv) { + return [{return: cv.return}]; + } else { + if (!dbg.enabled) + return [cv]; + print("Error determining what to forcereturn. Stopped."); + showDebuggeeValue(cv.throw); + } + } +} + +function printPop(f, c) { + var fdesc = f.fullDescription(); + if (c.return) { + print("frame returning (still selected): " + fdesc); + showDebuggeeValue(c.return); + } else if (c.throw) { + print("frame threw exception: " + fdesc); + showDebuggeeValue(c.throw); + print("(To rethrow it, type 'throw'.)"); + lastExc = c.throw; + } else { + print("frame was terminated: " + fdesc); + } +} + +// Set |prop| on |obj| to |value|, but then restore its current value +// when we next enter the repl. +function setUntilRepl(obj, prop, value) { + var saved = obj[prop]; + obj[prop] = value; + replCleanups.push(function () { obj[prop] = saved; }); +} + +function doStepOrNext(kind) { + var startFrame = topFrame; + var startLine = startFrame.line; + print("stepping in: " + startFrame.fullDescription()); + print("starting line: " + uneval(startLine)); + + function stepPopped(completion) { + // Note that we're popping this frame; we need to watch for + // subsequent step events on its caller. + this.reportedPop = true; + printPop(this, completion); + topFrame = focusedFrame = this; + return repl(); + } + + function stepEntered(newFrame) { + print("entered frame: " + newFrame.fullDescription()); + topFrame = focusedFrame = newFrame; + return repl(); + } + + function stepStepped() { + print("stepStepped: " + this.fullDescription()); + // If we've changed frame or line, then report that. + if (this !== startFrame || this.line != startLine) { + topFrame = focusedFrame = this; + if (focusedFrame != startFrame) + print(focusedFrame.fullDescription()); + return repl(); } - function repl() { - var cmd; - for (;;) { - print("\n" + prompt); - cmd = readline(); - if (cmd === null) - break; + // Otherwise, let execution continue. + return undefined; + } - try { - var result = runcmd(cmd); - if (result === undefined) - ; // do nothing - else if (Array.isArray(result)) - return result[0]; - else - throw new Error("Internal error: result of runcmd wasn't array or undefined"); - } catch (exc) { - print("*** Internal error: exception in the debugger code."); - print(" " + exc); - var me = prompt.replace(/^\((.*)\)$/, function (a, b) { return b; }); - print("Debug " + me + "? (y/n)"); - if (readline().match(/^\s*y/i) !== null) - debugMe(); - else - print("ok, ignoring error"); - } - } + if (kind.step) + setUntilRepl(dbg, 'onEnterFrame', stepEntered); + + // If we're stepping after an onPop, watch for steps and pops in the + // next-older frame; this one is done. + var stepFrame = startFrame.reportedPop ? startFrame.older : startFrame; + if (!stepFrame || !stepFrame.script) + stepFrame = null; + if (stepFrame) { + setUntilRepl(stepFrame, 'onStep', stepStepped); + setUntilRepl(stepFrame, 'onPop', stepPopped); + } + + // Let the program continue! + return [undefined]; +} + +function stepCommand() { return doStepOrNext({step:true}); } +function nextCommand() { return doStepOrNext({next:true}); } + +// Build the table of commands. +var commands = {}; +var commandArray = [ + backtraceCommand, "bt", "where", + continueCommand, "c", + detachCommand, + downCommand, "d", + forcereturnCommand, + frameCommand, "f", + nextCommand, "n", + printCommand, "p", + quitCommand, "q", + stepCommand, "s", + throwCommand, "t", + upCommand, "u", + helpCommand, "h", + evalCommand, "!", + ]; +var last = null; +for (var i = 0; i < commandArray.length; i++) { + var cmd = commandArray[i]; + if (typeof cmd === "string") + commands[cmd] = last; + else + last = commands[cmd.name.replace(/Command$/, '')] = cmd; +} + +function helpCommand(rest) { + print("Available commands:"); + var printcmd = function(group) { + print(" " + group.join(", ")); + } + + var group = []; + for (var cmd of commandArray) { + if (typeof cmd === "string") { + group.push(cmd); + } else { + if (group.length) printcmd(group); + group = [ cmd.name.replace(/Command$/, '') ]; } + } + printcmd(group); +} - var dbg = new Debugger(debuggeeGlobal); - dbg.onDebuggerStatement = function (frame) { - return saveExcursion(function () { - topFrame = focusedFrame = frame; - print("'debugger' statement hit."); - showFrame(); - return repl(); - }); - }; - dbg.onThrow = function (frame, exc) { - return saveExcursion(function () { - topFrame = focusedFrame = frame; - print("Unwinding due to exception. (Type 'c' to continue unwinding.)"); - showFrame(); - print("Exception value is:"); - showDebuggeeValue(exc); - return repl(); - }); - }; - repl(); - } + ")();" +// Break cmd into two parts: its first word and everything else. If it begins +// with punctuation, treat that as a separate word. +function breakcmd(cmd) { + cmd = cmd.trimLeft(); + if ("!@#$%^&*_+=/?.,<>:;'\"".indexOf(cmd.substr(0, 1)) != -1) + return [cmd.substr(0, 1), cmd.substr(1).trimLeft()]; + var m = /\s/.exec(cmd); + if (m === null) + return [cmd, '']; + return [cmd.slice(0, m.index), cmd.slice(m.index).trimLeft()]; +} - print("jorendb version -0.0"); - var g = newGlobal("new-compartment"); - g.debuggeeGlobal = this; - g.prompt = '(jorendb)'; - g.debuggerSource = debuggerSource; - g.eval(debuggerSource); -})(); +function runcmd(cmd) { + var pieces = breakcmd(cmd); + if (pieces[0] === "") + return undefined; + + var first = pieces[0], rest = pieces[1]; + if (!commands.hasOwnProperty(first)) { + print("unrecognized command '" + first + "'"); + return undefined; + } + + var cmd = commands[first]; + if (cmd.length === 0 && rest !== '') { + print("this command cannot take an argument"); + return undefined; + } + + return cmd(rest); +} + +function repl() { + while (replCleanups.length > 0) + replCleanups.pop()(); + + var cmd; + for (;;) { + putstr("\n" + prompt); + cmd = readline(); + if (cmd === null) + return null; + + try { + var result = runcmd(cmd); + if (result === undefined) + ; // do nothing + else if (Array.isArray(result)) + return result[0]; + else + throw new Error("Internal error: result of runcmd wasn't array or undefined"); + } catch (exc) { + print("*** Internal error: exception in the debugger code."); + print(" " + exc); + print(exc.stack); + } + } +} + +var dbg = new Debugger(); +dbg.onDebuggerStatement = function (frame) { + return saveExcursion(function () { + topFrame = focusedFrame = frame; + print("'debugger' statement hit."); + showFrame(); + return repl(); + }); +}; +dbg.onThrow = function (frame, exc) { + return saveExcursion(function () { + topFrame = focusedFrame = frame; + print("Unwinding due to exception. (Type 'c' to continue unwinding.)"); + showFrame(); + print("Exception value is:"); + showDebuggeeValue(exc); + return repl(); + }); +}; + +// The depth of jorendb nesting. +var jorendbDepth; +if (typeof jorendbDepth == 'undefined') jorendbDepth = 0; + +var debuggeeGlobal = newGlobal("new-compartment"); +debuggeeGlobal.jorendbDepth = jorendbDepth + 1; +var debuggeeGlobalWrapper = dbg.addDebuggee(debuggeeGlobal); + +print("jorendb version -0.0"); +prompt = '(' + Array(jorendbDepth+1).join('meta-') + 'jorendb) '; + +var args = arguments; +while(args.length > 0) { + var arg = args.shift(); + if (arg == '-f') { + arg = args.shift(); + debuggeeGlobal.evaluate(read(arg), { fileName: arg, lineNumber: 1 }); + } else if (arg == '-e') { + arg = args.shift(); + debuggeeGlobal.eval(arg); + } else { + throw("jorendb does not implement command-line argument '" + arg + "'"); + } +} + +repl(); From 64887849258fb6a5443cc867cbcdf426671df503 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Wed, 22 May 2013 09:50:08 -0700 Subject: [PATCH 02/85] Bug 876776 - Allow using '--' to terminate shell arguments (and pass the rest to the script), r=terrence This makes ./js -f foo.js -- a b c the same as ./js foo.js a b c but also allows things like ./js -e 'print(arguments)' -- a b c which previously wasn't possible. --- js/src/shell/js.cpp | 1 + js/src/shell/jsoptparse.cpp | 51 +++++++++++++++++++++++++------------ js/src/shell/jsoptparse.h | 9 ++++++- 3 files changed, 44 insertions(+), 17 deletions(-) diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 95fa579d4a0..4cb813bdcc7 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -5348,6 +5348,7 @@ main(int argc, char **argv, char **envp) } op.setArgTerminatesOptions("script", true); + op.setArgCapturesRest("scriptArgs"); switch (op.parseArgs(argc, argv)) { case OptionParser::ParseHelp: diff --git a/js/src/shell/jsoptparse.cpp b/js/src/shell/jsoptparse.cpp index 1d7b7a676ce..f8c5f30f293 100644 --- a/js/src/shell/jsoptparse.cpp +++ b/js/src/shell/jsoptparse.cpp @@ -59,6 +59,14 @@ OptionParser::setArgTerminatesOptions(const char *name, bool enabled) findArgument(name)->setTerminatesOptions(enabled); } +void +OptionParser::setArgCapturesRest(const char *name) +{ + MOZ_ASSERT(restArgument == -1, "only one argument may be set to capture the rest"); + restArgument = findArgumentIndex(name); + MOZ_ASSERT(restArgument != -1, "unknown argument name passed to setArgCapturesRest"); +} + OptionParser::Result OptionParser::error(const char *fmt, ...) { @@ -350,10 +358,17 @@ OptionParser::parseArgs(int inputArgc, char **argv) /* Option. */ Option *opt; if (arg[1] == '-') { - /* Long option. */ - opt = findOption(arg + 2); - if (!opt) - return error("Invalid long option: %s", arg); + if (arg[2] == '\0') { + /* End of options */ + optionsAllowed = false; + nextArgument = restArgument; + continue; + } else { + /* Long option. */ + opt = findOption(arg + 2); + if (!opt) + return error("Invalid long option: %s", arg); + } } else { /* Short option */ if (arg[2] != '\0') @@ -369,12 +384,8 @@ OptionParser::parseArgs(int inputArgc, char **argv) r = handleArg(argc, argv, &i, &optionsAllowed); } - switch (r) { - case Okay: - break; - default: + if (r != Okay) return r; - } } return Okay; } @@ -498,21 +509,29 @@ OptionParser::findOption(const char *longflag) const /* Argument accessors */ +ssize_t +OptionParser::findArgumentIndex(const char *name) const +{ + for (Option * const *it = arguments.begin(); it != arguments.end(); ++it) { + const char *target = (*it)->longflag; + if (strcmp(target, name) == 0) + return it - arguments.begin(); + } + return -1; +} + Option * OptionParser::findArgument(const char *name) { - for (Option **it = arguments.begin(), **end = arguments.end(); it != end; ++it) { - const char *target = (*it)->longflag; - if (strcmp(target, name) == 0) - return *it; - } - return NULL; + ssize_t index = findArgumentIndex(name); + return (index == -1) ? NULL : arguments[index]; } const Option * OptionParser::findArgument(const char *name) const { - return const_cast(this)->findArgument(name); + ssize_t index = findArgumentIndex(name); + return (index == -1) ? NULL : arguments[index]; } const char * diff --git a/js/src/shell/jsoptparse.h b/js/src/shell/jsoptparse.h index b4bf5ba477a..4a0e06f705f 100644 --- a/js/src/shell/jsoptparse.h +++ b/js/src/shell/jsoptparse.h @@ -211,12 +211,17 @@ class OptionParser size_t helpWidth; size_t nextArgument; + // If '--' is passed, all remaining arguments should be interpreted as the + // argument at index 'restArgument'. Defaults to the next unassigned argument. + ssize_t restArgument; + static const char prognameMeta[]; Option *findOption(char shortflag); const Option *findOption(char shortflag) const; Option *findOption(const char *longflag); const Option *findOption(const char *longflag) const; + ssize_t findArgumentIndex(const char *name) const; Option *findArgument(const char *name); const Option *findArgument(const char *name) const; @@ -228,7 +233,8 @@ class OptionParser public: explicit OptionParser(const char *usage) : helpOption('h', "help", "Display help information"), - usage(usage), ver(NULL), descr(NULL), descrWidth(80), helpWidth(80), nextArgument(0) + usage(usage), ver(NULL), descr(NULL), descrWidth(80), helpWidth(80), + nextArgument(0), restArgument(-1) {} ~OptionParser(); @@ -244,6 +250,7 @@ class OptionParser void setDescription(const char *description) { descr = description; } void setHelpOption(char shortflag, const char *longflag, const char *help); void setArgTerminatesOptions(const char *name, bool enabled); + void setArgCapturesRest(const char *name); /* Arguments: no further arguments may be added after a variadic argument. */ From 127dde9613981fedd8ac7ca4385cd53a8f343167 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Thu, 30 May 2013 11:40:16 -0700 Subject: [PATCH 03/85] Bug 876776 - Do not crash when dumping a NULL object, r=terrence --- js/src/jsfriendapi.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index 2518542fc87..629b937f209 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -635,6 +635,10 @@ js_DumpChars(const jschar *s, size_t n) JS_FRIEND_API(void) js_DumpObject(JSObject *obj) { + if (!obj) { + fprintf(stderr, "NULL\n"); + return; + } obj->dump(); } From 5858a608250a32a64971f7baca726b2b658cdb5b Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Thu, 30 May 2013 11:40:16 -0700 Subject: [PATCH 04/85] Bug 876776 - Add a -J option to the shell for running under jorendb, r=terrence --- js/src/tests/jstests.py | 12 +++++++++++- js/src/tests/lib/tasks_unix.py | 31 ++++++++++++++++--------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/js/src/tests/jstests.py b/js/src/tests/jstests.py index dee150e891f..9e22e859e80 100755 --- a/js/src/tests/jstests.py +++ b/js/src/tests/jstests.py @@ -89,6 +89,8 @@ def parse_args(): help='Example: --jitflags=m,amd to run each test with -m, -a -m -d [default=%default]') harness_og.add_option('-g', '--debug', action='store_true', help='Run a test in debugger.') harness_og.add_option('--debugger', default='gdb -q --args', help='Debugger command.') + harness_og.add_option('-J', '--jorendb', action='store_true', help='Run under JS debugger.') + harness_og.add_option('--passthrough', action='store_true', help='Run tests with stdin/stdout attached to caller.') harness_og.add_option('--valgrind', action='store_true', help='Run tests in valgrind.') harness_og.add_option('--valgrind-args', default='', help='Extra args to pass to valgrind.') op.add_option_group(harness_og) @@ -153,7 +155,15 @@ def parse_args(): if os.uname()[0] == 'Darwin': prefix.append('--dsymutil=yes') options.show_output = True - TestCase.set_js_cmd_prefix(options.js_shell, options.shell_args.split(), prefix) + + js_cmd_args = options.shell_args.split() + if options.jorendb: + options.passthrough = True + options.hide_progress = True + options.worker_count = 1 + debugger_path = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../../examples/jorendb.js") + js_cmd_args.extend([ '-d', '-f', debugger_path, '--' ]) + TestCase.set_js_cmd_prefix(options.js_shell, js_cmd_args, prefix) # If files with lists of tests to run were specified, add them to the # requested tests set. diff --git a/js/src/tests/lib/tasks_unix.py b/js/src/tests/lib/tasks_unix.py index 73ef257fb5c..f85578c314f 100644 --- a/js/src/tests/lib/tasks_unix.py +++ b/js/src/tests/lib/tasks_unix.py @@ -17,25 +17,26 @@ class Task(object): self.out = [] self.err = [] -def spawn_test(test): +def spawn_test(test, passthrough = False): """Spawn one child, return a task struct.""" - (rout, wout) = os.pipe() - (rerr, werr) = os.pipe() + if not passthrough: + (rout, wout) = os.pipe() + (rerr, werr) = os.pipe() - rv = os.fork() + rv = os.fork() - # Parent. - if rv: - os.close(wout) - os.close(werr) - return Task(test, rv, rout, rerr) + # Parent. + if rv: + os.close(wout) + os.close(werr) + return Task(test, rv, rout, rerr) - # Child. - os.close(rout) - os.close(rerr) + # Child. + os.close(rout) + os.close(rerr) - os.dup2(wout, 1) - os.dup2(werr, 2) + os.dup2(wout, 1) + os.dup2(werr, 2) cmd = test.get_command(test.js_cmd_prefix) os.execvp(cmd[0], cmd) @@ -188,7 +189,7 @@ def run_all_tests(tests, results, options): while len(tests) or len(tasks): while len(tests) and len(tasks) < options.worker_count: - tasks.append(spawn_test(tests.pop())) + tasks.append(spawn_test(tests.pop(), options.passthrough)) timeout = get_max_wait(tasks, results, options.timeout) read_input(tasks, timeout) From a264d6a4ada599ccfb50e1386eb3dfa0795f8a23 Mon Sep 17 00:00:00 2001 From: Raymond Lee Date: Fri, 31 May 2013 02:46:34 +0800 Subject: [PATCH 05/85] Bug 846944 - Change www.mozilla.com to .org in official Firefox Branding preferences. r=gavin --- browser/app/profile/firefox.js | 4 ++-- browser/base/content/aboutDialog.xul | 2 +- browser/base/content/browser-appmenu.inc | 2 +- browser/branding/official/branding.nsi | 4 ++-- browser/fuel/test/browser_Bookmarks.js | 6 +++--- browser/locales/en-US/chrome/browser/aboutDialog.dtd | 2 +- browser/locales/en-US/chrome/browser/aboutRobots.dtd | 4 +--- browser/locales/en-US/profile/bookmarks.inc | 10 +++++----- browser/locales/generic/extract-bookmarks.py | 10 +++++----- browser/locales/generic/profile/bookmarks.html.in | 10 +++++----- browser/metro/base/content/pages/aboutRights.xhtml | 2 +- browser/metro/profile/metro.js | 4 ++-- 12 files changed, 29 insertions(+), 31 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 754501b178e..0aee107a6c8 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -51,7 +51,7 @@ pref("extensions.blocklist.interval", 86400); // blocking them. pref("extensions.blocklist.level", 2); pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/"); -pref("extensions.blocklist.detailsURL", "https://www.mozilla.com/%LOCALE%/blocklist/"); +pref("extensions.blocklist.detailsURL", "https://www.mozilla.org/%LOCALE%/blocklist/"); pref("extensions.blocklist.itemURL", "https://addons.mozilla.org/%LOCALE%/%APP%/blocked/%blockID%"); pref("extensions.update.autoUpdateDefault", true); @@ -753,7 +753,7 @@ pref("browser.safebrowsing.reportPhishURL", "http://%LOCALE%.phish-report.mozill pref("browser.safebrowsing.reportMalwareURL", "http://%LOCALE%.malware-report.mozilla.com/?hl=%LOCALE%"); pref("browser.safebrowsing.reportMalwareErrorURL", "http://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%"); -pref("browser.safebrowsing.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/phishing-protection/"); +pref("browser.safebrowsing.warning.infoURL", "https://www.mozilla.org/%LOCALE%/firefox/phishing-protection/"); pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site="); #ifdef MOZILLA_OFFICIAL diff --git a/browser/base/content/aboutDialog.xul b/browser/base/content/aboutDialog.xul index 848d940298e..3d88664dddc 100644 --- a/browser/base/content/aboutDialog.xul +++ b/browser/base/content/aboutDialog.xul @@ -117,7 +117,7 @@ - + &trademarkInfo.part1; diff --git a/browser/base/content/browser-appmenu.inc b/browser/base/content/browser-appmenu.inc index 042d06901eb..ecb3b8d5324 100644 --- a/browser/base/content/browser-appmenu.inc +++ b/browser/base/content/browser-appmenu.inc @@ -369,7 +369,7 @@ onclick="checkForMiddleClick(this, event);"/> #ifdef MOZ_SERVICES_HEALTHREPORT - + diff --git a/browser/locales/en-US/chrome/browser/aboutRobots.dtd b/browser/locales/en-US/chrome/browser/aboutRobots.dtd index f417428c84a..139603d8d3b 100644 --- a/browser/locales/en-US/chrome/browser/aboutRobots.dtd +++ b/browser/locales/en-US/chrome/browser/aboutRobots.dtd @@ -3,9 +3,7 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> diff --git a/browser/locales/en-US/profile/bookmarks.inc b/browser/locales/en-US/profile/bookmarks.inc index f91f15ef765..d2a701e52b9 100644 --- a/browser/locales/en-US/profile/bookmarks.inc +++ b/browser/locales/en-US/profile/bookmarks.inc @@ -14,7 +14,7 @@ #define bookmarks_toolbarfolder_description Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar # LOCALIZATION NOTE (getting_started): -# link title for http://en-US.www.mozilla.com/en-US/firefox/central/ +# link title for https://www.mozilla.org/en-US/firefox/central/ #define getting_started Getting Started # LOCALIZATION NOTE (firefox_heading): @@ -22,19 +22,19 @@ #define firefox_heading Mozilla Firefox # LOCALIZATION NOTE (firefox_help): -# link title for http://en-US.www.mozilla.com/en-US/firefox/help/ +# link title for https://www.mozilla.org/en-US/firefox/help/ #define firefox_help Help and Tutorials # LOCALIZATION NOTE (firefox_customize): -# link title for http://en-US.www.mozilla.com/en-US/firefox/customize/ +# link title for https://www.mozilla.org/en-US/firefox/customize/ #define firefox_customize Customize Firefox # LOCALIZATION NOTE (firefox_community): -# link title for http://en-US.www.mozilla.com/en-US/firefox/community/ +# link title for https://www.mozilla.org/en-US/contribute/ #define firefox_community Get Involved # LOCALIZATION NOTE (firefox_about): -# link title for http://en-US.www.mozilla.com/en-US/about/ +# link title for https://www.mozilla.org/en-US/about/ #define firefox_about About Us #unfilter emptyLines diff --git a/browser/locales/generic/extract-bookmarks.py b/browser/locales/generic/extract-bookmarks.py index cc8a954ef53..7bf711fff12 100644 --- a/browser/locales/generic/extract-bookmarks.py +++ b/browser/locales/generic/extract-bookmarks.py @@ -32,7 +32,7 @@ template = '''#filter emptyLines #define bookmarks_toolbarfolder_description %s # LOCALIZATION NOTE (getting_started): -# link title for http://www.mozilla.com/en-US/firefox/central/ +# link title for https://www.mozilla.org/en-US/firefox/central/ #define getting_started %s # LOCALIZATION NOTE (firefox_heading): @@ -40,19 +40,19 @@ template = '''#filter emptyLines #define firefox_heading %s # LOCALIZATION NOTE (firefox_help): -# link title for http://www.mozilla.com/en-US/firefox/help/ +# link title for https://www.mozilla.org/en-US/firefox/help/ #define firefox_help %s # LOCALIZATION NOTE (firefox_customize): -# link title for http://www.mozilla.com/en-US/firefox/customize/ +# link title for https://www.mozilla.org/en-US/firefox/customize/ #define firefox_customize %s # LOCALIZATION NOTE (firefox_community): -# link title for http://www.mozilla.com/en-US/firefox/community/ +# link title for https://www.mozilla.org/en-US/contribute/ #define firefox_community %s # LOCALIZATION NOTE (firefox_about): -# link title for http://www.mozilla.com/en-US/about/ +# link title for https://www.mozilla.org/en-US/about/ #define firefox_about %s #unfilter emptyLines''' diff --git a/browser/locales/generic/profile/bookmarks.html.in b/browser/locales/generic/profile/bookmarks.html.in index b9a5ba865d5..e925c1ef235 100644 --- a/browser/locales/generic/profile/bookmarks.html.in +++ b/browser/locales/generic/profile/bookmarks.html.in @@ -15,13 +15,13 @@

@bookmarks_toolbarfolder@

@bookmarks_toolbarfolder_description@

-

@getting_started@ +
@getting_started@

@firefox_heading@

-

@firefox_help@ -
@firefox_customize@ -
@firefox_community@ -
@firefox_about@ +
@firefox_help@ +
@firefox_customize@ +
@firefox_community@ +
@firefox_about@

diff --git a/browser/metro/base/content/pages/aboutRights.xhtml b/browser/metro/base/content/pages/aboutRights.xhtml index becab854e2d..df29ae7ea60 100644 --- a/browser/metro/base/content/pages/aboutRights.xhtml +++ b/browser/metro/base/content/pages/aboutRights.xhtml @@ -33,7 +33,7 @@ -->

  • &rights.intro-point2-a;&rights.intro-point2-b;&rights.intro-point2-c;
  • &rights.intro-point2.5;
  • -
  • &rights2.intro-point3a;&rights2.intro-point3b;&rights.intro-point3c;
  • +
  • &rights2.intro-point3a;&rights2.intro-point3b;&rights.intro-point3c;
  • &rights2.intro-point4a;&rights.intro-point4b;&rights.intro-point4c;
  • diff --git a/browser/metro/profile/metro.js b/browser/metro/profile/metro.js index 3b278bd59ce..381845c007c 100644 --- a/browser/metro/profile/metro.js +++ b/browser/metro/profile/metro.js @@ -188,7 +188,7 @@ pref("extensions.update.enabled", false); pref("extensions.blocklist.enabled", true); pref("extensions.blocklist.interval", 86400); pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/"); -pref("extensions.blocklist.detailsURL", "https://www.mozilla.com/%LOCALE%/blocklist/"); +pref("extensions.blocklist.detailsURL", "https://www.mozilla.org/%LOCALE%/blocklist/"); /* block popups by default, and notify the user about blocked popups */ pref("dom.disable_open_during_load", true); @@ -383,7 +383,7 @@ pref("breakpad.reportURL", "https://crash-stats.mozilla.com/report/index/"); // TODO: This is not the correct article for metro!!! pref("app.sync.tutorialURL", "https://support.mozilla.org/kb/sync-firefox-between-desktop-and-mobile"); pref("app.support.baseURL", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/"); -pref("app.privacyURL", "http://www.mozilla.com/legal/privacy/"); +pref("app.privacyURL", "https://www.mozilla.org/legal/privacy/"); pref("app.creditsURL", "http://www.mozilla.org/credits/"); pref("app.channelURL", "http://www.mozilla.org/%LOCALE%/firefox/channel/"); From f81ab1a89410d40897fe989eb836cc2d975f4b95 Mon Sep 17 00:00:00 2001 From: Raymond Lee Date: Fri, 31 May 2013 03:25:43 +0800 Subject: [PATCH 06/85] Bug 876037 - Make app.releaseNotesURL and app.vendorURL optional. r=gavin --- browser/branding/aurora/pref/firefox-branding.js | 4 ---- browser/branding/nightly/pref/firefox-branding.js | 4 ---- browser/branding/official/pref/firefox-branding.js | 4 ---- browser/branding/unofficial/pref/firefox-branding.js | 4 ---- toolkit/content/about.xhtml | 5 +++-- 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/browser/branding/aurora/pref/firefox-branding.js b/browser/branding/aurora/pref/firefox-branding.js index 07c6cc964b3..5a877321275 100644 --- a/browser/branding/aurora/pref/firefox-branding.js +++ b/browser/branding/aurora/pref/firefox-branding.js @@ -21,10 +21,6 @@ pref("app.update.url.manual", "https://www.mozilla.org/firefox/aurora/"); // supplied in the "An update is available" page of the update wizard. pref("app.update.url.details", "https://www.mozilla.org/firefox/aurora/"); -// Release notes and vendor URLs -pref("app.releaseNotesURL", "http://www.mozilla.org/projects/firefox/%VERSION%/releasenotes/"); -pref("app.vendorURL", "http://www.mozilla.org/projects/firefox/"); - // Search codes belong only in builds with official branding pref("browser.search.param.yahoo-fr", ""); pref("browser.search.param.yahoo-fr-cjkt", ""); // now unused diff --git a/browser/branding/nightly/pref/firefox-branding.js b/browser/branding/nightly/pref/firefox-branding.js index 74035365eb5..112322c623d 100644 --- a/browser/branding/nightly/pref/firefox-branding.js +++ b/browser/branding/nightly/pref/firefox-branding.js @@ -18,10 +18,6 @@ pref("app.update.url.manual", "https://nightly.mozilla.org"); // supplied in the "An update is available" page of the update wizard. pref("app.update.url.details", "https://nightly.mozilla.org"); -// Release notes and vendor URLs -pref("app.releaseNotesURL", "http://www.mozilla.org/projects/firefox/%VERSION%/releasenotes/"); -pref("app.vendorURL", "http://www.mozilla.org/projects/firefox/"); - // Search codes belong only in builds with official branding pref("browser.search.param.yahoo-fr", ""); pref("browser.search.param.yahoo-fr-cjkt", ""); // now unused diff --git a/browser/branding/official/pref/firefox-branding.js b/browser/branding/official/pref/firefox-branding.js index ce7e9450fe2..e3b5c5b2c31 100644 --- a/browser/branding/official/pref/firefox-branding.js +++ b/browser/branding/official/pref/firefox-branding.js @@ -18,10 +18,6 @@ pref("app.update.url.manual", "https://www.mozilla.org/firefox/"); // supplied in the "An update is available" page of the update wizard. pref("app.update.url.details", "https://www.mozilla.org/%LOCALE%/firefox/notes"); -// Release notes and vendor URLs -pref("app.releaseNotesURL", "http://www.mozilla.com/%LOCALE%/firefox/%VERSION%/releasenotes/"); -pref("app.vendorURL", "http://www.mozilla.com/%LOCALE%/firefox/"); - pref("browser.search.param.ms-pc", "MOZI"); pref("browser.search.param.yahoo-fr", "moz35"); pref("browser.search.param.yahoo-fr-cjkt", "moz35"); // now unused diff --git a/browser/branding/unofficial/pref/firefox-branding.js b/browser/branding/unofficial/pref/firefox-branding.js index 300fa3dc7a4..42792b981b0 100644 --- a/browser/branding/unofficial/pref/firefox-branding.js +++ b/browser/branding/unofficial/pref/firefox-branding.js @@ -18,10 +18,6 @@ pref("app.update.url.manual", "https://nightly.mozilla.org"); // supplied in the "An update is available" page of the update wizard. pref("app.update.url.details", "https://nightly.mozilla.org"); -// Release notes and vendor URLs -pref("app.releaseNotesURL", "http://www.mozilla.org/projects/firefox/%VERSION%/releasenotes/"); -pref("app.vendorURL", "http://www.mozilla.org/projects/firefox/"); - // Search codes belong only in builds with official branding pref("browser.search.param.yahoo-fr", ""); pref("browser.search.param.yahoo-fr-cjkt", ""); // now unused diff --git a/toolkit/content/about.xhtml b/toolkit/content/about.xhtml index 13d70eb8695..5351181f38d 100644 --- a/toolkit/content/about.xhtml +++ b/toolkit/content/about.xhtml @@ -22,7 +22,7 @@
    - + &brandShortName;

    @@ -31,7 +31,7 @@
    • &about.credits.beforeLink;&about.credits.linkTitle;&about.credits.afterLink;
    • &about.license.beforeTheLink;&about.license.linkTitle;&about.license.afterTheLink;
    • -
    • &about.relnotes.beforeTheLink;&about.relnotes.linkTitle;&about.relnotes.afterTheLink;
    • +
    • &about.buildconfig.beforeTheLink;&about.buildconfig.linkTitle;&about.buildconfig.afterTheLink;
    • + + + +
      +
      +
      +
      + + From 13fff291bffb0dbe22ccff7cf597cfb0b318e924 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 30 May 2013 20:53:15 -0400 Subject: [PATCH 52/85] Bug 876024 - Sanity check all of the time values passed to Web Audio; r=roc --- content/media/test/crashtests/876024-1.html | 5 ++++ content/media/test/crashtests/876024-2.html | 17 ++++++++++++++ content/media/test/crashtests/crashtests.list | 2 ++ .../media/webaudio/AudioBufferSourceNode.cpp | 11 +++++++++ content/media/webaudio/AudioParam.h | 23 ++++++++++++++++++- content/media/webaudio/WebAudioUtils.h | 5 ++++ dom/webidl/AudioParam.webidl | 1 + 7 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 content/media/test/crashtests/876024-1.html create mode 100644 content/media/test/crashtests/876024-2.html diff --git a/content/media/test/crashtests/876024-1.html b/content/media/test/crashtests/876024-1.html new file mode 100644 index 00000000000..5502d8e42d4 --- /dev/null +++ b/content/media/test/crashtests/876024-1.html @@ -0,0 +1,5 @@ + diff --git a/content/media/test/crashtests/876024-2.html b/content/media/test/crashtests/876024-2.html new file mode 100644 index 00000000000..d299ec4d2d6 --- /dev/null +++ b/content/media/test/crashtests/876024-2.html @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/content/media/test/crashtests/crashtests.list b/content/media/test/crashtests/crashtests.list index 733e0ab602b..42a3a8c2bf8 100644 --- a/content/media/test/crashtests/crashtests.list +++ b/content/media/test/crashtests/crashtests.list @@ -22,6 +22,8 @@ load 874952.html load 875144.html load 875596.html load 875911.html +load 876024-1.html +load 876024-2.html load 876118.html load 876207.html load 876215.html diff --git a/content/media/webaudio/AudioBufferSourceNode.cpp b/content/media/webaudio/AudioBufferSourceNode.cpp index d5d680d9d04..67d55fc9a14 100644 --- a/content/media/webaudio/AudioBufferSourceNode.cpp +++ b/content/media/webaudio/AudioBufferSourceNode.cpp @@ -480,6 +480,12 @@ void AudioBufferSourceNode::Start(double aWhen, double aOffset, const Optional& aDuration, ErrorResult& aRv) { + if (!WebAudioUtils::IsTimeValid(aWhen) || + (aDuration.WasPassed() && !WebAudioUtils::IsTimeValid(aDuration.Value()))) { + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } + if (mStartCalled) { aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; @@ -567,6 +573,11 @@ AudioBufferSourceNode::SendOffsetAndDurationParametersToStream(AudioNodeStream* void AudioBufferSourceNode::Stop(double aWhen, ErrorResult& aRv, bool aShuttingDown) { + if (!WebAudioUtils::IsTimeValid(aWhen)) { + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } + if (!mStartCalled) { aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; diff --git a/content/media/webaudio/AudioParam.h b/content/media/webaudio/AudioParam.h index abf528444a6..53470cbe152 100644 --- a/content/media/webaudio/AudioParam.h +++ b/content/media/webaudio/AudioParam.h @@ -72,21 +72,38 @@ public: } void SetValueAtTime(float aValue, double aStartTime, ErrorResult& aRv) { + if (!WebAudioUtils::IsTimeValid(aStartTime)) { + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } AudioParamTimeline::SetValueAtTime(aValue, aStartTime, aRv); mCallback(mNode); } void LinearRampToValueAtTime(float aValue, double aEndTime, ErrorResult& aRv) { + if (!WebAudioUtils::IsTimeValid(aEndTime)) { + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } AudioParamTimeline::LinearRampToValueAtTime(aValue, aEndTime, aRv); mCallback(mNode); } void ExponentialRampToValueAtTime(float aValue, double aEndTime, ErrorResult& aRv) { + if (!WebAudioUtils::IsTimeValid(aEndTime)) { + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } AudioParamTimeline::ExponentialRampToValueAtTime(aValue, aEndTime, aRv); mCallback(mNode); } void SetTargetAtTime(float aTarget, double aStartTime, double aTimeConstant, ErrorResult& aRv) { + if (!WebAudioUtils::IsTimeValid(aStartTime) || + !WebAudioUtils::IsTimeValid(aTimeConstant)) { + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } AudioParamTimeline::SetTargetAtTime(aTarget, aStartTime, aTimeConstant, aRv); mCallback(mNode); } @@ -94,8 +111,12 @@ public: { SetTargetAtTime(aTarget, aStartTime, aTimeConstant, aRv); } - void CancelScheduledValues(double aStartTime) + void CancelScheduledValues(double aStartTime, ErrorResult& aRv) { + if (!WebAudioUtils::IsTimeValid(aStartTime)) { + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return; + } AudioParamTimeline::CancelScheduledValues(aStartTime); mCallback(mNode); } diff --git a/content/media/webaudio/WebAudioUtils.h b/content/media/webaudio/WebAudioUtils.h index 7c559293103..ccaabd0cf52 100644 --- a/content/media/webaudio/WebAudioUtils.h +++ b/content/media/webaudio/WebAudioUtils.h @@ -104,6 +104,11 @@ struct WebAudioUtils { return 1.0 - std::exp(-1.0 / (sampleRate * timeConstant)); } + static bool IsTimeValid(double aTime) + { + return aTime >= 0 && aTime <= (MEDIA_TIME_MAX >> MEDIA_TIME_FRAC_BITS); + } + /** * Convert a stream position into the time coordinate of the destination * stream. diff --git a/dom/webidl/AudioParam.webidl b/dom/webidl/AudioParam.webidl index ba221250061..7981d377e99 100644 --- a/dom/webidl/AudioParam.webidl +++ b/dom/webidl/AudioParam.webidl @@ -34,6 +34,7 @@ interface AudioParam { void setValueCurveAtTime(Float32Array values, double startTime, double duration); // Cancels all scheduled parameter changes with times greater than or equal to startTime. + [Throws] void cancelScheduledValues(double startTime); }; From 6f0d7033ca11907e0c70292c446f1a782936f24f Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 30 May 2013 20:53:51 -0400 Subject: [PATCH 53/85] Bug 876273 - Only attempt to delete the media graph when the last stream goes away if we're waiting for all streams to be destroyed; r=roc --- content/media/MediaStreamGraph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/media/MediaStreamGraph.cpp b/content/media/MediaStreamGraph.cpp index 9de36489daf..4ff20992eba 100644 --- a/content/media/MediaStreamGraph.cpp +++ b/content/media/MediaStreamGraph.cpp @@ -1443,7 +1443,8 @@ MediaStreamGraphImpl::AppendMessage(ControlMessage* aMessage) // This should only happen during forced shutdown. aMessage->RunDuringShutdown(); delete aMessage; - if (IsEmpty()) { + if (IsEmpty() && + mLifecycleState >= LIFECYCLE_WAITING_FOR_STREAM_DESTRUCTION) { if (gGraph == this) { gGraph = nullptr; } From 72c63d4e5c49f15bce5b705471469484ecef34b5 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 30 May 2013 20:54:07 -0400 Subject: [PATCH 54/85] Bug 877820 - Improve the argument checking for OfflineAudioContext's sampleRate argument; r=roc --- content/media/test/crashtests/877820.html | 4 ++++ content/media/test/crashtests/crashtests.list | 1 + content/media/webaudio/AudioContext.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 content/media/test/crashtests/877820.html diff --git a/content/media/test/crashtests/877820.html b/content/media/test/crashtests/877820.html new file mode 100644 index 00000000000..6d65c1e9d9b --- /dev/null +++ b/content/media/test/crashtests/877820.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/content/media/test/crashtests/crashtests.list b/content/media/test/crashtests/crashtests.list index 42a3a8c2bf8..9f1ebc48f19 100644 --- a/content/media/test/crashtests/crashtests.list +++ b/content/media/test/crashtests/crashtests.list @@ -30,3 +30,4 @@ load 876215.html load 876249.html load 876252.html load 876834.html +load 877820.html diff --git a/content/media/webaudio/AudioContext.cpp b/content/media/webaudio/AudioContext.cpp index 0d4ac1055d2..eacef00288c 100644 --- a/content/media/webaudio/AudioContext.cpp +++ b/content/media/webaudio/AudioContext.cpp @@ -106,7 +106,7 @@ AudioContext::Constructor(const GlobalObject& aGlobal, if (aNumberOfChannels == 0 || aNumberOfChannels > WebAudioUtils::MaxChannelCount || aLength == 0 || - aSampleRate <= 0.0f || + aSampleRate <= 1.0f || aSampleRate >= TRACK_RATE_MAX) { // The DOM binding protects us against infinity and NaN aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); From 286425d4f415e9b598c3700246a5a7e2708678d3 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 30 May 2013 20:59:09 -0400 Subject: [PATCH 55/85] Crashtest for bug 868504 --- content/media/test/crashtests/868504.html | 14 ++++++++++++++ content/media/test/crashtests/crashtests.list | 1 + 2 files changed, 15 insertions(+) create mode 100644 content/media/test/crashtests/868504.html diff --git a/content/media/test/crashtests/868504.html b/content/media/test/crashtests/868504.html new file mode 100644 index 00000000000..637b710ad42 --- /dev/null +++ b/content/media/test/crashtests/868504.html @@ -0,0 +1,14 @@ + + + + + + + diff --git a/content/media/test/crashtests/crashtests.list b/content/media/test/crashtests/crashtests.list index 9f1ebc48f19..385f4570657 100644 --- a/content/media/test/crashtests/crashtests.list +++ b/content/media/test/crashtests/crashtests.list @@ -15,6 +15,7 @@ skip-if(Android||B2G) load 789075-1.html # load failed, bug 833371 for B2G load 844563.html load 846612.html load 852838.html +load 868504.html load 874869.html load 874915.html load 874934.html From 99a4283e34e54c7844f3ab296971b374b2831d0e Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 30 May 2013 21:30:13 -0400 Subject: [PATCH 56/85] Bug 877726 - Convert FrameMetrics.mScrollOffset to be a CSSPoint. r=kentuckyfriedtakahe --- dom/ipc/TabChild.cpp | 4 +-- gfx/2d/Point.h | 11 +++++++ gfx/layers/FrameMetrics.h | 3 +- gfx/layers/LayersLogging.cpp | 3 +- gfx/layers/LayersLogging.h | 3 +- gfx/layers/client/ClientTiledThebesLayer.cpp | 2 +- gfx/layers/client/TiledContentClient.cpp | 2 +- gfx/layers/client/TiledContentClient.h | 4 +-- gfx/layers/ipc/AsyncPanZoomController.cpp | 19 ++++++------ gfx/layers/ipc/Axis.cpp | 6 ++-- gfx/layers/ipc/Axis.h | 7 +++-- ipc/glue/IPCMessageUtils.h | 6 ++-- layout/base/Units.h | 31 ++++++++++++++++++++ layout/base/moz.build | 1 + layout/base/nsDisplayList.cpp | 8 ++--- layout/generic/nsGfxScrollFrame.cpp | 5 ++-- layout/generic/nsGfxScrollFrame.h | 7 ++--- layout/generic/nsIScrollableFrame.h | 6 ++-- 18 files changed, 86 insertions(+), 42 deletions(-) create mode 100644 layout/base/Units.h diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index ffae28c011d..a6078ed6089 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -354,7 +354,7 @@ TabChild::Observe(nsISupports *aSubject, mInnerSize); mLastMetrics.mResolution = AsyncPanZoomController::CalculateResolution(mLastMetrics); - mLastMetrics.mScrollOffset = gfx::Point(0, 0); + mLastMetrics.mScrollOffset = CSSPoint(0, 0); utils->SetResolution(mLastMetrics.mResolution.width, mLastMetrics.mResolution.height); @@ -1452,7 +1452,7 @@ TabChild::DispatchMessageManagerMessage(const nsAString& aMessageName, } static void -ScrollWindowTo(nsIDOMWindow* aWindow, const mozilla::gfx::Point& aPoint) +ScrollWindowTo(nsIDOMWindow* aWindow, const CSSPoint& aPoint) { nsGlobalWindow* window = static_cast(aWindow); nsIScrollableFrame* sf = window->GetScrollFrame(); diff --git a/gfx/2d/Point.h b/gfx/2d/Point.h index efe3dd7d9a5..a50e85da4e7 100644 --- a/gfx/2d/Point.h +++ b/gfx/2d/Point.h @@ -36,6 +36,17 @@ struct PointTyped : PointTyped() : Super() {} PointTyped(Float aX, Float aY) : Super(aX, aY) {} PointTyped(const IntPointTyped& point) : Super(float(point.x), float(point.y)) {} + + // XXX When all of the code is ported, the following functions to convert to and from + // unknown types should be removed. + + static PointTyped FromUnknownPoint(const PointTyped& pt) { + return PointTyped(pt.x, pt.y); + } + + PointTyped ToUnknownPoint() const { + return PointTyped(this->x, this->y); + } }; typedef PointTyped Point; diff --git a/gfx/layers/FrameMetrics.h b/gfx/layers/FrameMetrics.h index 384a963ed41..bda6dcee0ad 100644 --- a/gfx/layers/FrameMetrics.h +++ b/gfx/layers/FrameMetrics.h @@ -10,6 +10,7 @@ #include "gfxTypes.h" #include "nsRect.h" #include "mozilla/gfx/Rect.h" +#include "Units.h" namespace mozilla { namespace layers { @@ -190,7 +191,7 @@ public: // // This is valid for any layer, but is always relative to this frame and // not any parents, regardless of parent transforms. - gfx::Point mScrollOffset; + mozilla::CSSPoint mScrollOffset; // A unique ID assigned to each scrollable frame (unless this is // ROOT_SCROLL_ID, in which case it is not unique). diff --git a/gfx/layers/LayersLogging.cpp b/gfx/layers/LayersLogging.cpp index ff68324da45..877119c2826 100644 --- a/gfx/layers/LayersLogging.cpp +++ b/gfx/layers/LayersLogging.cpp @@ -95,8 +95,9 @@ AppendToString(nsACString& s, const nsIntPoint& p, return s += sfx; } +template nsACString& -AppendToString(nsACString& s, const Point& p, +AppendToString(nsACString& s, const PointTyped& p, const char* pfx, const char* sfx) { s += pfx; diff --git a/gfx/layers/LayersLogging.h b/gfx/layers/LayersLogging.h index 01c556ba42e..a936d8fa2f5 100644 --- a/gfx/layers/LayersLogging.h +++ b/gfx/layers/LayersLogging.h @@ -44,8 +44,9 @@ nsACString& AppendToString(nsACString& s, const nsIntPoint& p, const char* pfx="", const char* sfx=""); +template nsACString& -AppendToString(nsACString& s, const mozilla::gfx::Point& p, +AppendToString(nsACString& s, const mozilla::gfx::PointTyped& p, const char* pfx="", const char* sfx=""); nsACString& diff --git a/gfx/layers/client/ClientTiledThebesLayer.cpp b/gfx/layers/client/ClientTiledThebesLayer.cpp index 5f6d9d20619..bdfcb7b985d 100644 --- a/gfx/layers/client/ClientTiledThebesLayer.cpp +++ b/gfx/layers/client/ClientTiledThebesLayer.cpp @@ -18,7 +18,7 @@ ClientTiledThebesLayer::ClientTiledThebesLayer(ClientLayerManager* const aManage , mContentClient() { MOZ_COUNT_CTOR(ClientTiledThebesLayer); - mPaintData.mLastScrollOffset = gfx::Point(0, 0); + mPaintData.mLastScrollOffset = CSSPoint(0, 0); mPaintData.mFirstPaint = true; } diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp index 465866ad8d2..71bd1a78851 100644 --- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -273,7 +273,7 @@ BasicTiledLayerBuffer::ValidateTile(BasicTiledLayerTile aTile, static nsIntRect RoundedTransformViewportBounds(const gfx::Rect& aViewport, - const gfx::Point& aScrollOffset, + const CSSPoint& aScrollOffset, const gfxSize& aResolution, float aScaleX, float aScaleY, diff --git a/gfx/layers/client/TiledContentClient.h b/gfx/layers/client/TiledContentClient.h index a82ced50a1f..84972ad8249 100644 --- a/gfx/layers/client/TiledContentClient.h +++ b/gfx/layers/client/TiledContentClient.h @@ -73,8 +73,8 @@ struct BasicTiledLayerTile { * doesn't need to be recalculated on every repeated transaction. */ struct BasicTiledLayerPaintData { - gfx::Point mScrollOffset; - gfx::Point mLastScrollOffset; + CSSPoint mScrollOffset; + CSSPoint mLastScrollOffset; gfx3DMatrix mTransformScreenToLayer; nsIntRect mLayerCriticalDisplayPort; gfxSize mResolution; diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index 5b1c437f5be..071977d7198 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -828,7 +828,7 @@ void AsyncPanZoomController::ScrollBy(const gfx::Point& aOffset) { gfx::Point newOffset(mFrameMetrics.mScrollOffset.x + aOffset.x, mFrameMetrics.mScrollOffset.y + aOffset.y); FrameMetrics metrics(mFrameMetrics); - metrics.mScrollOffset = newOffset; + metrics.mScrollOffset = CSSPoint::FromUnknownPoint(newOffset); mFrameMetrics = metrics; } @@ -940,7 +940,7 @@ const gfx::Rect AsyncPanZoomController::CalculatePendingDisplayPort( scrollableRect.height = compositionBounds.height; } - gfx::Point scrollOffset = aFrameMetrics.mScrollOffset; + CSSPoint scrollOffset = aFrameMetrics.mScrollOffset; gfx::Rect displayPort(0, 0, compositionBounds.width * gXStationarySizeMultiplier, @@ -1055,8 +1055,8 @@ void AsyncPanZoomController::RequestContentRepaint() { GetAccelerationVector(), estimatedPaintDuration); - gfx::Point oldScrollOffset = mLastPaintRequestMetrics.mScrollOffset, - newScrollOffset = mFrameMetrics.mScrollOffset; + CSSPoint oldScrollOffset = mLastPaintRequestMetrics.mScrollOffset, + newScrollOffset = mFrameMetrics.mScrollOffset; // If we're trying to paint what we already think is painted, discard this // request since it's a pointless paint. @@ -1157,12 +1157,12 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa startZoom * (1 - sampledPosition)); mFrameMetrics.mZoom = gfxSize(sampledZoom, sampledZoom); - mFrameMetrics.mScrollOffset = gfx::Point( + mFrameMetrics.mScrollOffset = CSSPoint::FromUnknownPoint(gfx::Point( mEndZoomToMetrics.mScrollOffset.x * sampledPosition + mStartZoomToMetrics.mScrollOffset.x * (1 - sampledPosition), mEndZoomToMetrics.mScrollOffset.y * sampledPosition + mStartZoomToMetrics.mScrollOffset.y * (1 - sampledPosition) - ); + )); requestAnimationFrame = true; @@ -1191,7 +1191,7 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa } scrollOffset = gfxPoint(mFrameMetrics.mScrollOffset.x, mFrameMetrics.mScrollOffset.y); - mCurrentAsyncScrollOffset = mFrameMetrics.mScrollOffset; + mCurrentAsyncScrollOffset = mFrameMetrics.mScrollOffset.ToUnknownPoint(); } // Cancel the mAsyncScrollTimeoutTask because we will fire a @@ -1345,7 +1345,7 @@ void AsyncPanZoomController::ZoomToRect(const gfxRect& aRect) { nsIntRect compositionBounds = mFrameMetrics.mCompositionBounds; gfx::Rect cssPageRect = mFrameMetrics.mScrollableRect; - gfx::Point scrollOffset = mFrameMetrics.mScrollOffset; + CSSPoint scrollOffset = mFrameMetrics.mScrollOffset; gfxSize resolution = CalculateResolution(mFrameMetrics); gfxSize currentZoom = mFrameMetrics.mZoom; float targetZoom; @@ -1419,7 +1419,8 @@ void AsyncPanZoomController::ZoomToRect(const gfxRect& aRect) { } mStartZoomToMetrics = mFrameMetrics; - mEndZoomToMetrics.mScrollOffset = gfx::Point(zoomToRect.x, zoomToRect.y); + mEndZoomToMetrics.mScrollOffset = CSSPoint::FromUnknownPoint( + gfx::Point(zoomToRect.x, zoomToRect.y)); mAnimationStartTime = TimeStamp::Now(); diff --git a/gfx/layers/ipc/Axis.cpp b/gfx/layers/ipc/Axis.cpp index 6d2241a7e29..6eb16f6698f 100644 --- a/gfx/layers/ipc/Axis.cpp +++ b/gfx/layers/ipc/Axis.cpp @@ -292,7 +292,7 @@ float Axis::GetPageEnd() { } float Axis::GetOrigin() { - gfx::Point origin = mAsyncPanZoomController->GetFrameMetrics().mScrollOffset; + CSSPoint origin = mAsyncPanZoomController->GetFrameMetrics().mScrollOffset; return GetPointOffset(origin); } @@ -334,7 +334,7 @@ AxisX::AxisX(AsyncPanZoomController* aAsyncPanZoomController) } -float AxisX::GetPointOffset(const gfx::Point& aPoint) +float AxisX::GetPointOffset(const CSSPoint& aPoint) { return aPoint.x; } @@ -355,7 +355,7 @@ AxisY::AxisY(AsyncPanZoomController* aAsyncPanZoomController) } -float AxisY::GetPointOffset(const gfx::Point& aPoint) +float AxisY::GetPointOffset(const CSSPoint& aPoint) { return aPoint.y; } diff --git a/gfx/layers/ipc/Axis.h b/gfx/layers/ipc/Axis.h index e613c357283..85a13eb5f17 100644 --- a/gfx/layers/ipc/Axis.h +++ b/gfx/layers/ipc/Axis.h @@ -11,6 +11,7 @@ #include "mozilla/TimeStamp.h" #include "mozilla/gfx/2D.h" #include "nsTArray.h" +#include "Units.h" namespace mozilla { namespace layers { @@ -170,7 +171,7 @@ public: float GetCompositionEnd(); float GetPageEnd(); - virtual float GetPointOffset(const gfx::Point& aPoint) = 0; + virtual float GetPointOffset(const CSSPoint& aPoint) = 0; virtual float GetRectLength(const gfx::Rect& aRect) = 0; virtual float GetRectOffset(const gfx::Rect& aRect) = 0; @@ -191,7 +192,7 @@ protected: class AxisX : public Axis { public: AxisX(AsyncPanZoomController* mAsyncPanZoomController); - virtual float GetPointOffset(const gfx::Point& aPoint); + virtual float GetPointOffset(const CSSPoint& aPoint); virtual float GetRectLength(const gfx::Rect& aRect); virtual float GetRectOffset(const gfx::Rect& aRect); }; @@ -199,7 +200,7 @@ public: class AxisY : public Axis { public: AxisY(AsyncPanZoomController* mAsyncPanZoomController); - virtual float GetPointOffset(const gfx::Point& aPoint); + virtual float GetPointOffset(const CSSPoint& aPoint); virtual float GetRectLength(const gfx::Rect& aRect); virtual float GetRectOffset(const gfx::Rect& aRect); }; diff --git a/ipc/glue/IPCMessageUtils.h b/ipc/glue/IPCMessageUtils.h index 61885b94b71..4032718d63c 100644 --- a/ipc/glue/IPCMessageUtils.h +++ b/ipc/glue/IPCMessageUtils.h @@ -788,10 +788,10 @@ struct ParamTraits } }; -template<> -struct ParamTraits +template +struct ParamTraits< mozilla::gfx::PointTyped > { - typedef mozilla::gfx::Point paramType; + typedef mozilla::gfx::PointTyped paramType; static void Write(Message* msg, const paramType& param) { diff --git a/layout/base/Units.h b/layout/base/Units.h new file mode 100644 index 00000000000..1ff7f3d9ca6 --- /dev/null +++ b/layout/base/Units.h @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef MOZ_UNITS_H_ +#define MOZ_UNITS_H_ + +#include "mozilla/gfx/Point.h" +#include "nsDeviceContext.h" + +namespace mozilla { + +// The pixels that content authors use to specify sizes in. +struct CSSPixel { + static gfx::PointTyped FromAppUnits(const nsPoint &pt) { + return gfx::PointTyped(NSAppUnitsToFloatPixels(pt.x, float(nsDeviceContext::AppUnitsPerCSSPixel())), + NSAppUnitsToFloatPixels(pt.y, float(nsDeviceContext::AppUnitsPerCSSPixel()))); + } + + static nsPoint ToAppUnits(const gfx::PointTyped &pt) { + return nsPoint(NSFloatPixelsToAppUnits(pt.x, float(nsDeviceContext::AppUnitsPerCSSPixel())), + NSFloatPixelsToAppUnits(pt.y, float(nsDeviceContext::AppUnitsPerCSSPixel()))); + } +}; + +typedef gfx::PointTyped CSSPoint; + +}; + +#endif diff --git a/layout/base/moz.build b/layout/base/moz.build index 09e2c7fceab..dc280c40428 100644 --- a/layout/base/moz.build +++ b/layout/base/moz.build @@ -42,6 +42,7 @@ EXPORTS += [ 'FrameLayerBuilder.h', 'FramePropertyTable.h', 'StackArena.h', + 'Units.h', 'nsArenaMemoryStats.h', 'nsBidi.h', 'nsBidiPresUtils.h', diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 8792422a892..417c3e4a250 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -618,7 +618,6 @@ static void RecordFrameMetrics(nsIFrame* aForFrame, bool aMayHaveTouchListeners) { nsPresContext* presContext = aForFrame->PresContext(); int32_t auPerDevPixel = presContext->AppUnitsPerDevPixel(); - float auPerCSSPixel = nsPresContext::AppUnitsPerCSSPixel(); nsIntRect visible = aVisibleRect.ScaleToNearestPixels( aContainerParameters.mXScale, aContainerParameters.mYScale, auPerDevPixel); @@ -664,9 +663,7 @@ static void RecordFrameMetrics(nsIFrame* aForFrame, metrics.mContentRect = contentBounds.ScaleToNearestPixels( aContainerParameters.mXScale, aContainerParameters.mYScale, auPerDevPixel); nsPoint scrollPosition = scrollableFrame->GetScrollPosition(); - metrics.mScrollOffset = mozilla::gfx::Point( - NSAppUnitsToDoublePixels(scrollPosition.x, auPerCSSPixel), - NSAppUnitsToDoublePixels(scrollPosition.y, auPerCSSPixel)); + metrics.mScrollOffset = CSSPoint::FromAppUnits(scrollPosition); } else { nsRect contentBounds = aForFrame->GetRect(); @@ -687,7 +684,8 @@ static void RecordFrameMetrics(nsIFrame* aForFrame, } metrics.mResolution = gfxSize(presShell->GetXResolution(), presShell->GetYResolution()); - metrics.mDevPixelsPerCSSPixel = auPerCSSPixel / auPerDevPixel; + metrics.mDevPixelsPerCSSPixel = + (float)nsPresContext::AppUnitsPerCSSPixel() / auPerDevPixel; metrics.mMayHaveTouchListeners = aMayHaveTouchListeners; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 74446c6b7c2..5a3fc5bf149 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1609,10 +1609,9 @@ nsGfxScrollFrameInner::ScrollToCSSPixels(nsIntPoint aScrollPosition) } void -nsGfxScrollFrameInner::ScrollToCSSPixelsApproximate(const Point& aScrollPosition) +nsGfxScrollFrameInner::ScrollToCSSPixelsApproximate(const CSSPoint& aScrollPosition) { - nsPoint pt(nsPresContext::CSSPixelsToAppUnits(aScrollPosition.x), - nsPresContext::CSSPixelsToAppUnits(aScrollPosition.y)); + nsPoint pt = CSSPoint::ToAppUnits(aScrollPosition); nscoord halfRange = nsPresContext::CSSPixelsToAppUnits(1000); nsRect range(pt.x - halfRange, pt.y - halfRange, 2*halfRange - 1, 2*halfRange - 1); ScrollTo(pt, nsIScrollableFrame::INSTANT, &range); diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index ca4d274ed01..74e43e0fd6b 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -47,7 +47,6 @@ class ScrollbarActivity; class nsGfxScrollFrameInner : public nsIReflowCallback { public: - typedef mozilla::gfx::Point Point; typedef mozilla::layout::ScrollbarActivity ScrollbarActivity; class AsyncScroll; @@ -172,7 +171,7 @@ public: ScrollToWithOrigin(aScrollPosition, aMode, nsGkAtoms::other, aRange); } void ScrollToCSSPixels(nsIntPoint aScrollPosition); - void ScrollToCSSPixelsApproximate(const Point& aScrollPosition); + void ScrollToCSSPixelsApproximate(const mozilla::CSSPoint& aScrollPosition); nsIntPoint GetScrollPositionCSSPixels(); void ScrollToImpl(nsPoint aScrollPosition, const nsRect& aRange); void ScrollVisual(nsPoint aOldScrolledFramePosition); @@ -520,7 +519,7 @@ public: virtual void ScrollToCSSPixels(nsIntPoint aScrollPosition) MOZ_OVERRIDE { mInner.ScrollToCSSPixels(aScrollPosition); } - virtual void ScrollToCSSPixelsApproximate(const Point& aScrollPosition) MOZ_OVERRIDE { + virtual void ScrollToCSSPixelsApproximate(const mozilla::CSSPoint& aScrollPosition) MOZ_OVERRIDE { mInner.ScrollToCSSPixelsApproximate(aScrollPosition); } virtual nsIntPoint GetScrollPositionCSSPixels() MOZ_OVERRIDE { @@ -783,7 +782,7 @@ public: virtual void ScrollToCSSPixels(nsIntPoint aScrollPosition) MOZ_OVERRIDE { mInner.ScrollToCSSPixels(aScrollPosition); } - virtual void ScrollToCSSPixelsApproximate(const Point& aScrollPosition) MOZ_OVERRIDE { + virtual void ScrollToCSSPixelsApproximate(const mozilla::CSSPoint& aScrollPosition) MOZ_OVERRIDE { mInner.ScrollToCSSPixelsApproximate(aScrollPosition); } virtual nsIntPoint GetScrollPositionCSSPixels() MOZ_OVERRIDE { diff --git a/layout/generic/nsIScrollableFrame.h b/layout/generic/nsIScrollableFrame.h index b149b510dcc..430c683264c 100644 --- a/layout/generic/nsIScrollableFrame.h +++ b/layout/generic/nsIScrollableFrame.h @@ -15,6 +15,7 @@ #include "nsPresContext.h" #include "mozilla/gfx/Point.h" #include "nsIScrollbarOwner.h" +#include "Units.h" #define NS_DEFAULT_VERTICAL_SCROLL_DISTANCE 3 #define NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE 5 @@ -30,8 +31,6 @@ class nsIFrame; */ class nsIScrollableFrame : public nsIScrollbarOwner { public: - typedef mozilla::gfx::Point Point; - NS_DECL_QUERYFRAME_TARGET(nsIScrollableFrame) /** @@ -166,7 +165,8 @@ public: * number of layer pixels (so the operation is fast and looks clean). * The scroll mode is INSTANT. */ - virtual void ScrollToCSSPixelsApproximate(const Point& aScrollPosition) = 0; + virtual void ScrollToCSSPixelsApproximate(const mozilla::CSSPoint& aScrollPosition) = 0; + /** * Returns the scroll position in integer CSS pixels, rounded to the nearest * pixel. From 9a5d492da7563d69200ad0f1cfe6240a4e902b44 Mon Sep 17 00:00:00 2001 From: Joe Drew Date: Thu, 30 May 2013 09:50:50 -0400 Subject: [PATCH 57/85] Bug 867770 - Layerize all animated images. r=mattwoodrow --- layout/base/nsCSSRendering.cpp | 12 +++++++++ layout/base/nsCSSRendering.h | 1 + layout/base/nsDisplayList.cpp | 42 ++++++++++++++++------------- layout/base/nsDisplayList.h | 2 ++ layout/generic/nsImageFrame.cpp | 47 +++++++++++++++++++-------------- 5 files changed, 66 insertions(+), 38 deletions(-) diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index a83bea7219a..7a54a5de048 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -4688,6 +4688,18 @@ nsImageRenderer::IsRasterImage() return mImageContainer->GetType() == imgIContainer::TYPE_RASTER; } +bool +nsImageRenderer::IsAnimatedImage() +{ + if (mType != eStyleImageType_Image || !mImageContainer) + return false; + bool animated = false; + if (NS_SUCCEEDED(mImageContainer->GetAnimated(&animated)) && animated) + return true; + + return false; +} + already_AddRefed nsImageRenderer::GetContainer(LayerManager* aManager) { diff --git a/layout/base/nsCSSRendering.h b/layout/base/nsCSSRendering.h index fc3e97276b4..6e4435baf1a 100644 --- a/layout/base/nsCSSRendering.h +++ b/layout/base/nsCSSRendering.h @@ -63,6 +63,7 @@ public: const nsRect& aDirty); bool IsRasterImage(); + bool IsAnimatedImage(); already_AddRefed GetContainer(LayerManager* aManager); private: diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 417c3e4a250..97b5ac15979 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1559,6 +1559,7 @@ nsDisplayBackgroundImage::nsDisplayBackgroundImage(nsDisplayListBuilder* aBuilde , mLayer(aLayer) , mIsThemed(aIsThemed) , mIsBottommostLayer(true) + , mIsAnimated(false) { MOZ_COUNT_CTOR(nsDisplayBackgroundImage); @@ -1820,6 +1821,7 @@ nsDisplayBackgroundImage::TryOptimizeToImageLayer(LayerManager* aManager, int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel(); mDestRect = nsLayoutUtils::RectToGfxRect(state.mDestArea, appUnitsPerDevPixel); mImageContainer = imageContainer; + mIsAnimated = imageRenderer->IsAnimatedImage(); // Ok, we can turn this into a layer if needed. return true; @@ -1843,31 +1845,35 @@ nsDisplayBackgroundImage::GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const FrameLayerBuilder::ContainerParameters& aParameters) { - if (!aManager->IsCompositingCheap() || - !nsLayoutUtils::GPUImageScalingEnabled() || - !TryOptimizeToImageLayer(aManager, aBuilder)) { - return LAYER_NONE; + if (!TryOptimizeToImageLayer(aManager, aBuilder) || + !mIsAnimated) { + if (!aManager->IsCompositingCheap() || + !nsLayoutUtils::GPUImageScalingEnabled()) { + return LAYER_NONE; + } } - gfxSize imageSize = mImageContainer->GetCurrentSize(); - NS_ASSERTION(imageSize.width != 0 && imageSize.height != 0, "Invalid image size!"); + if (!mIsAnimated) { + gfxSize imageSize = mImageContainer->GetCurrentSize(); + NS_ASSERTION(imageSize.width != 0 && imageSize.height != 0, "Invalid image size!"); - gfxRect destRect = mDestRect; + gfxRect destRect = mDestRect; - destRect.width *= aParameters.mXScale; - destRect.height *= aParameters.mYScale; + destRect.width *= aParameters.mXScale; + destRect.height *= aParameters.mYScale; - // Calculate the scaling factor for the frame. - gfxSize scale = gfxSize(destRect.width / imageSize.width, destRect.height / imageSize.height); + // Calculate the scaling factor for the frame. + gfxSize scale = gfxSize(destRect.width / imageSize.width, destRect.height / imageSize.height); - // If we are not scaling at all, no point in separating this into a layer. - if (scale.width == 1.0f && scale.height == 1.0f) { - return LAYER_NONE; - } + // If we are not scaling at all, no point in separating this into a layer. + if (scale.width == 1.0f && scale.height == 1.0f) { + return LAYER_NONE; + } - // If the target size is pretty small, no point in using a layer. - if (destRect.width * destRect.height < 64 * 64) { - return LAYER_NONE; + // If the target size is pretty small, no point in using a layer. + if (destRect.width * destRect.height < 64 * 64) { + return LAYER_NONE; + } } return LAYER_ACTIVE; diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index 1eca3b8fd34..ecda275723c 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -2030,6 +2030,8 @@ protected: bool mIsThemed; /* true if this item represents the bottom-most background layer */ bool mIsBottommostLayer; + /* true if this image is known to be animated */ + bool mIsAnimated; }; class nsDisplayBackgroundColor : public nsDisplayItem diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index f0944c95da7..3652fee1fc3 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1258,35 +1258,42 @@ nsDisplayImage::GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const FrameLayerBuilder::ContainerParameters& aParameters) { + bool animated = false; if (mImage->GetType() != imgIContainer::TYPE_RASTER || - !aManager->IsCompositingCheap() || - !nsLayoutUtils::GPUImageScalingEnabled()) { - return LAYER_NONE; + NS_FAILED(mImage->GetAnimated(&animated)) || + !animated) { + if (!aManager->IsCompositingCheap() || + !nsLayoutUtils::GPUImageScalingEnabled()) { + return LAYER_NONE; + } } - int32_t imageWidth; - int32_t imageHeight; - mImage->GetWidth(&imageWidth); - mImage->GetHeight(&imageHeight); + if (!animated) { + int32_t imageWidth; + int32_t imageHeight; + mImage->GetWidth(&imageWidth); + mImage->GetHeight(&imageHeight); - NS_ASSERTION(imageWidth != 0 && imageHeight != 0, "Invalid image size!"); + NS_ASSERTION(imageWidth != 0 && imageHeight != 0, "Invalid image size!"); - gfxRect destRect = GetDestRect(); + gfxRect destRect = GetDestRect(); - destRect.width *= aParameters.mXScale; - destRect.height *= aParameters.mYScale; + destRect.width *= aParameters.mXScale; + destRect.height *= aParameters.mYScale; - // Calculate the scaling factor for the frame. - gfxSize scale = gfxSize(destRect.width / imageWidth, destRect.height / imageHeight); + // Calculate the scaling factor for the frame. + gfxSize scale = gfxSize(destRect.width / imageWidth, + destRect.height / imageHeight); - // If we are not scaling at all, no point in separating this into a layer. - if (scale.width == 1.0f && scale.height == 1.0f) { - return LAYER_NONE; - } + // If we are not scaling at all, no point in separating this into a layer. + if (scale.width == 1.0f && scale.height == 1.0f) { + return LAYER_NONE; + } - // If the target size is pretty small, no point in using a layer. - if (destRect.width * destRect.height < 64 * 64) { - return LAYER_NONE; + // If the target size is pretty small, no point in using a layer. + if (destRect.width * destRect.height < 64 * 64) { + return LAYER_NONE; + } } nsRefPtr container; From c4c196188fcbc256636033a135e3875a2e7aaa1c Mon Sep 17 00:00:00 2001 From: Joe Drew Date: Thu, 30 May 2013 21:33:17 -0400 Subject: [PATCH 58/85] Bug 867770 - Add a pref as to whether we layerize animated images, disabled by default. r=mattwoodrow --- layout/base/nsDisplayList.cpp | 1 + layout/base/nsLayoutUtils.cpp | 16 ++++++++++++++++ layout/base/nsLayoutUtils.h | 5 +++++ layout/generic/nsImageFrame.cpp | 3 ++- modules/libpref/src/init/all.js | 3 +++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 97b5ac15979..8f973cd4919 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1846,6 +1846,7 @@ nsDisplayBackgroundImage::GetLayerState(nsDisplayListBuilder* aBuilder, const FrameLayerBuilder::ContainerParameters& aParameters) { if (!TryOptimizeToImageLayer(aManager, aBuilder) || + !nsLayoutUtils::AnimatedImageLayersEnabled() || !mIsAnimated) { if (!aManager->IsCompositingCheap() || !nsLayoutUtils::GPUImageScalingEnabled()) { diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 8db5fd1807f..496e3007aa9 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -382,6 +382,22 @@ nsLayoutUtils::GPUImageScalingEnabled() return sGPUImageScalingEnabled; } +bool +nsLayoutUtils::AnimatedImageLayersEnabled() +{ + static bool sAnimatedImageLayersEnabled; + static bool sAnimatedImageLayersPrefCached = false; + + if (!sAnimatedImageLayersPrefCached) { + sAnimatedImageLayersPrefCached = true; + Preferences::AddBoolVarCache(&sAnimatedImageLayersEnabled, + "layout.animated-image-layers.enabled", + false); + } + + return sAnimatedImageLayersEnabled; +} + void nsLayoutUtils::UnionChildOverflow(nsIFrame* aFrame, nsOverflowAreas& aOverflowAreas) diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index a8d7174de67..fa38fef2b1e 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -1613,6 +1613,11 @@ public: */ static bool GPUImageScalingEnabled(); + /** + * Checks whether we want to layerize animated images whenever possible. + */ + static bool AnimatedImageLayersEnabled(); + /** * Unions the overflow areas of all non-popup children of aFrame with * aOverflowAreas. diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 3652fee1fc3..c038789908e 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1259,7 +1259,8 @@ nsDisplayImage::GetLayerState(nsDisplayListBuilder* aBuilder, const FrameLayerBuilder::ContainerParameters& aParameters) { bool animated = false; - if (mImage->GetType() != imgIContainer::TYPE_RASTER || + if (!nsLayoutUtils::AnimatedImageLayersEnabled() || + mImage->GetType() != imgIContainer::TYPE_RASTER || NS_FAILED(mImage->GetAnimated(&animated)) || !animated) { if (!aManager->IsCompositingCheap() || diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 114acdf4c48..cdfb53cb6b0 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -4078,6 +4078,9 @@ pref("dom.event.handling-user-input-time-limit", 1000); //3D Transforms pref("layout.3d-transforms.enabled", true); +// Whether we should layerize all animated images (if otherwise possible). +pref("layout.animated-image-layers.enabled", false); + pref("dom.vibrator.enabled", true); pref("dom.vibrator.max_vibrate_ms", 10000); pref("dom.vibrator.max_vibrate_list_len", 128); From a7e0d442e82fd75420f0b1fe95e0f8d932b79468 Mon Sep 17 00:00:00 2001 From: Joe Drew Date: Thu, 30 May 2013 21:33:17 -0400 Subject: [PATCH 59/85] Bug 867770 - Test to make sure that animated images are layerized correctly when the pref is enabled. r=mattwoodrow --- .../image_rgrg-256x256-animated.gif | Bin 0 -> 1748 bytes layout/reftests/invalidation/reftest.list | 2 ++ .../test-animated-image-layers-background.html | 16 ++++++++++++++++ .../test-animated-image-layers-ref.html | 8 ++++++++ .../test-animated-image-layers.html | 16 ++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 layout/reftests/invalidation/image_rgrg-256x256-animated.gif create mode 100644 layout/reftests/invalidation/test-animated-image-layers-background.html create mode 100644 layout/reftests/invalidation/test-animated-image-layers-ref.html create mode 100644 layout/reftests/invalidation/test-animated-image-layers.html diff --git a/layout/reftests/invalidation/image_rgrg-256x256-animated.gif b/layout/reftests/invalidation/image_rgrg-256x256-animated.gif new file mode 100644 index 0000000000000000000000000000000000000000..c03fad8bb09fb01a92f545cbccef322eec84a0dd GIT binary patch literal 1748 zcmZ?wbhEHbWME`qT*$=0@E-^n{)2(yPZmxt1||j_1`q(sGcf(@>0f#JE&t*zwOb9z-OJyR(WoF$9?>**Y$6)Cx4y$F3rcorMhp?M-3^h>0V1dzfAF3ZnEO* zs>NB`UDkY;e$;iGbHmR$imQ*l*jCBAeAn|EJ8C`8+rR&_;9vd~^$g~S6UH4Yl6FW; zesSWEgy$y@NySRZu$42LZ~olO+4aD3mROco7gs{nEUR5ow_g3)CHdOYJG#4a^~}|~ zy>C|k~Tmcl+JzZ~xYcuQT_H^DEDrzHT4i zb-V9;^7qa5hvnD%PwU@y{{H*3_GXL+c~l}UoOaaX+^=)zQouuJOTqO%OCkhM9sQ>% zxi)9YrNGDTHj0aTa)N|TdQQ<~UMq6x(+TexhTUhr1YbVxt6*9BZqLQd$Nd*Lmh-5F zn4G?-<(aCJdQ0TkWzj%sU*EvcSD_-2@i|X#l^zTCNObQ}jW)Y{Q!n%Cy4DM3C!@U! z9nUO{zJ54%N9EUdr5CQhkN0ad<;e@!apWOur@gM;3=_3_V?G_H+SaGzb*Uc`}T(?`{SeK{{Gzj^5%N^+j9SYumAY+ z{QW5T|9@Bi{P*+y{9E!3OaFckXqG?4J@Ew6lL|WKw1SwAdoc{^^NLKl^5+PTJWwGjma8 z->lqCmVL7e5B=<&Q+jD<@7&5qmA&(7KUwz9Z)Ez_v!GRISI@#urK+Aqy+&3&izhn$ z>RvK6Xjk{rnMqaM%jOnYbuVAo^s8&d(n-6zR<2xh$}4x%POs>+Z3kCLuibZ3OJ?1% zm#bvfpZlpLyWtw=YT1qVB(=TeHa*i^Ew}ldrMCQ*Z=S2=xBiRNR@la#wOe63f0ec3 z4)LztiaX_JSu5>QU$t9lxBf0` + + +
      +
      +
      + + + diff --git a/layout/reftests/invalidation/test-animated-image-layers-ref.html b/layout/reftests/invalidation/test-animated-image-layers-ref.html new file mode 100644 index 00000000000..d8bfb865563 --- /dev/null +++ b/layout/reftests/invalidation/test-animated-image-layers-ref.html @@ -0,0 +1,8 @@ + + + +
      + +
      + + diff --git a/layout/reftests/invalidation/test-animated-image-layers.html b/layout/reftests/invalidation/test-animated-image-layers.html new file mode 100644 index 00000000000..3eecf7f5057 --- /dev/null +++ b/layout/reftests/invalidation/test-animated-image-layers.html @@ -0,0 +1,16 @@ + + + +
      + +
      + + + From 3fb03ee4f9936a8ad646a47e3c2fb83a77bc0135 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Thu, 30 May 2013 22:11:26 -0400 Subject: [PATCH 60/85] Backed out 5 changesets (bug 872388) for Android 2.2 bustage on a CLOSED TREE. Backed out changeset f2fbb5c6cfc7 (bug 872388) Backed out changeset 416f9cdde0f7 (bug 872388) Backed out changeset 684ba082942b (bug 872388) Backed out changeset 7acb6c63fdf4 (bug 872388) Backed out changeset 2076903c21fa (bug 872388) --- mobile/android/base/AwesomeBar.java | 113 ++++++++- mobile/android/base/BrowserApp.java | 57 +---- mobile/android/base/EditBookmarkDialog.java | 237 ------------------ mobile/android/base/Makefile.in | 8 - mobile/android/base/db/BrowserDB.java | 6 - mobile/android/base/db/LocalBrowserDB.java | 19 -- .../base/locales/en-US/android_strings.dtd | 1 - .../base/resources/drawable-mdpi/toast.9.png | Bin 839 -> 0 bytes .../drawable-mdpi/toast_button_focused.9.png | Bin 311 -> 0 bytes .../drawable-mdpi/toast_button_pressed.9.png | Bin 311 -> 0 bytes .../drawable-mdpi/toast_divider.9.png | Bin 963 -> 0 bytes .../base/resources/drawable/toast_button.xml | 20 -- .../base/resources/layout/gecko_app.xml | 11 - .../android/base/resources/values/styles.xml | 48 ---- mobile/android/base/strings.xml.in | 1 - mobile/android/base/widget/ButtonToast.java | 150 ----------- 16 files changed, 114 insertions(+), 557 deletions(-) delete mode 100644 mobile/android/base/EditBookmarkDialog.java delete mode 100644 mobile/android/base/resources/drawable-mdpi/toast.9.png delete mode 100644 mobile/android/base/resources/drawable-mdpi/toast_button_focused.9.png delete mode 100644 mobile/android/base/resources/drawable-mdpi/toast_button_pressed.9.png delete mode 100644 mobile/android/base/resources/drawable-mdpi/toast_divider.9.png delete mode 100644 mobile/android/base/resources/drawable/toast_button.xml delete mode 100644 mobile/android/base/widget/ButtonToast.java diff --git a/mobile/android/base/AwesomeBar.java b/mobile/android/base/AwesomeBar.java index 2e1c1f3ce81..4da8bece5e1 100644 --- a/mobile/android/base/AwesomeBar.java +++ b/mobile/android/base/AwesomeBar.java @@ -15,7 +15,9 @@ import org.mozilla.gecko.util.ThreadUtils; import org.mozilla.gecko.util.UiAsyncTask; import android.app.Activity; +import android.app.AlertDialog; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.content.res.Configuration; import android.graphics.Bitmap; @@ -553,6 +555,62 @@ public class AwesomeBar extends GeckoActivity mContextMenuSubject = tab.getSubject(menu, view, menuInfo); } + private abstract class EditBookmarkTextWatcher implements TextWatcher { + protected AlertDialog mDialog; + protected EditBookmarkTextWatcher mPairedTextWatcher; + protected boolean mEnabled = true; + + public EditBookmarkTextWatcher(AlertDialog aDialog) { + mDialog = aDialog; + } + + public void setPairedTextWatcher(EditBookmarkTextWatcher aTextWatcher) { + mPairedTextWatcher = aTextWatcher; + } + + public boolean isEnabled() { + return mEnabled; + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + // Disable if the we're disabled or paired partner is disabled + boolean enabled = mEnabled && (mPairedTextWatcher == null || mPairedTextWatcher.isEnabled()); + mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(enabled); + } + + @Override + public void afterTextChanged(Editable s) {} + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) {} + } + + private class LocationTextWatcher extends EditBookmarkTextWatcher implements TextWatcher { + public LocationTextWatcher(AlertDialog aDialog) { + super(aDialog); + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + // Disable if the location is empty + mEnabled = (s.toString().trim().length() > 0); + super.onTextChanged(s, start, before, count); + } + } + + private class KeywordTextWatcher extends EditBookmarkTextWatcher implements TextWatcher { + public KeywordTextWatcher(AlertDialog aDialog) { + super(aDialog); + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + // Disable if the keyword contains spaces + mEnabled = (s.toString().trim().indexOf(' ') == -1); + super.onTextChanged(s, start, before, count); + } + } + @Override public boolean onContextItemSelected(MenuItem item) { if (mContextMenuSubject == null) @@ -595,7 +653,60 @@ public class AwesomeBar extends GeckoActivity break; } case R.id.edit_bookmark: { - new EditBookmarkDialog(this).show(id, title, url, keyword); + AlertDialog.Builder editPrompt = new AlertDialog.Builder(this); + final View editView = getLayoutInflater().inflate(R.layout.bookmark_edit, null); + editPrompt.setTitle(R.string.bookmark_edit_title); + editPrompt.setView(editView); + + final EditText nameText = ((EditText) editView.findViewById(R.id.edit_bookmark_name)); + final EditText locationText = ((EditText) editView.findViewById(R.id.edit_bookmark_location)); + final EditText keywordText = ((EditText) editView.findViewById(R.id.edit_bookmark_keyword)); + nameText.setText(title); + locationText.setText(url); + keywordText.setText(keyword); + + editPrompt.setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int whichButton) { + (new UiAsyncTask(ThreadUtils.getBackgroundHandler()) { + @Override + public Void doInBackground(Void... params) { + String newUrl = locationText.getText().toString().trim(); + String newKeyword = keywordText.getText().toString().trim(); + BrowserDB.updateBookmark(getContentResolver(), id, newUrl, nameText.getText().toString(), newKeyword); + return null; + } + + @Override + public void onPostExecute(Void result) { + Toast.makeText(AwesomeBar.this, R.string.bookmark_updated, Toast.LENGTH_SHORT).show(); + } + }).execute(); + } + }); + + editPrompt.setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int whichButton) { + // do nothing + } + }); + + final AlertDialog dialog = editPrompt.create(); + + // Create our TextWatchers + LocationTextWatcher locationTextWatcher = new LocationTextWatcher(dialog); + KeywordTextWatcher keywordTextWatcher = new KeywordTextWatcher(dialog); + + // Cross reference the TextWatchers + locationTextWatcher.setPairedTextWatcher(keywordTextWatcher); + keywordTextWatcher.setPairedTextWatcher(locationTextWatcher); + + // Add the TextWatcher Listeners + locationText.addTextChangedListener(locationTextWatcher); + keywordText.addTextChangedListener(keywordTextWatcher); + + dialog.show(); break; } case R.id.remove_bookmark: { diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index b233c79ce98..a1af84c7280 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -21,7 +21,6 @@ import org.mozilla.gecko.util.HardwareUtils; import org.mozilla.gecko.util.ThreadUtils; import org.mozilla.gecko.util.UiAsyncTask; import org.mozilla.gecko.widget.AboutHome; -import org.mozilla.gecko.widget.ButtonToast; import org.json.JSONArray; import org.json.JSONException; @@ -33,7 +32,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; -import android.content.res.Resources; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.PointF; @@ -88,8 +86,6 @@ abstract public class BrowserApp extends GeckoApp private static final int READER_ADD_FAILED = 1; private static final int READER_ADD_DUPLICATE = 2; - private static final String ADD_SHORTCUT_TOAST = "add_shortcut_toast"; - private static final String STATE_DYNAMIC_TOOLBAR_ENABLED = "dynamic_toolbar"; public static BrowserToolbar mBrowserToolbar; @@ -109,7 +105,7 @@ abstract public class BrowserApp extends GeckoApp } private Vector mAddonMenuItemsCache; - private ButtonToast mToast; + private PropertyAnimator mMainLayoutAnimator; private static final Interpolator sTabsInterpolator = new Interpolator() { @@ -366,15 +362,6 @@ abstract public class BrowserApp extends GeckoApp RelativeLayout actionBar = (RelativeLayout) findViewById(R.id.browser_toolbar); - mToast = new ButtonToast(findViewById(R.id.toast), new ButtonToast.ToastListener() { - @Override - public void onButtonClicked(CharSequence token) { - if (ADD_SHORTCUT_TOAST.equals(token)) { - showBookmarkDialog(); - } - } - }); - ((GeckoApp.MainLayout) mMainLayout).setTouchEventInterceptor(new HideTabsTouchListener()); ((GeckoApp.MainLayout) mMainLayout).setMotionEventInterceptor(new MotionEventInterceptor() { @Override @@ -481,42 +468,6 @@ abstract public class BrowserApp extends GeckoApp }); } - private void showBookmarkDialog() { - final Tab tab = Tabs.getInstance().getSelectedTab(); - final Prompt ps = new Prompt(this, new Prompt.PromptCallback() { - @Override - public void onPromptFinished(String result) { - int itemId = -1; - try { - itemId = new JSONObject(result).getInt("button"); - } catch(Exception ex) { - Log.e(LOGTAG, "Exception reading bookmark prompt result", ex); - } - - if (tab == null) - return; - - if (itemId == 0) { - new EditBookmarkDialog(BrowserApp.this).show(tab.getURL()); - } else if (itemId == 1) { - String url = tab.getURL(); - String title = tab.getDisplayTitle(); - Bitmap favicon = tab.getFavicon(); - if (url != null && title != null) { - GeckoAppShell.createShortcut(title, url, url, favicon == null ? null : favicon, ""); - } - } - } - }); - - final Prompt.PromptListItem[] items = new Prompt.PromptListItem[2]; - Resources res = getResources(); - items[0] = new Prompt.PromptListItem(res.getString(R.string.contextmenu_edit_bookmark)); - items[1] = new Prompt.PromptListItem(res.getString(R.string.contextmenu_add_to_launcher)); - - ps.show("", "", items, false); - } - private void setDynamicToolbarEnabled(boolean enabled) { if (enabled) { if (mLayerView != null) { @@ -1600,11 +1551,7 @@ abstract public class BrowserApp extends GeckoApp item.setIcon(R.drawable.ic_menu_bookmark_add); } else { tab.addBookmark(); - mToast.show(false, - getResources().getString(R.string.bookmark_added), - getResources().getString(R.string.bookmark_options), - 0, - ADD_SHORTCUT_TOAST); + Toast.makeText(this, R.string.bookmark_added, Toast.LENGTH_SHORT).show(); item.setIcon(R.drawable.ic_menu_bookmark_remove); } } diff --git a/mobile/android/base/EditBookmarkDialog.java b/mobile/android/base/EditBookmarkDialog.java deleted file mode 100644 index 867717ecf55..00000000000 --- a/mobile/android/base/EditBookmarkDialog.java +++ /dev/null @@ -1,237 +0,0 @@ -/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -package org.mozilla.gecko; - -import org.mozilla.gecko.db.BrowserContract.Bookmarks; -import org.mozilla.gecko.db.BrowserDB; -import org.mozilla.gecko.util.ThreadUtils; -import org.mozilla.gecko.util.UiAsyncTask; - -import android.content.Context; -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.database.Cursor; -import android.text.Editable; -import android.text.TextWatcher; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.EditText; -import android.widget.Toast; - -/** - * A dialog that allows editing a bookmarks url, title, or keywords - *

      - * Invoked by calling one of the {@link org.mozilla.gecko.EditBookmarkDialog.show} - * methods. - */ -public class EditBookmarkDialog { - private static final String LOGTAG = "GeckoEditBookmarkDialog"; - private Context mContext; - - public EditBookmarkDialog(Context context) { - mContext = context; - } - - /** - * A private struct to make it easier to pass bookmark data across threads - */ - private class Bookmark { - int id; - String title; - String url; - String keyword; - - public Bookmark(int aId, String aTitle, String aUrl, String aKeyword) { - id = aId; - title = aTitle; - url = aUrl; - keyword = aKeyword; - } - } - - /** - * This text watcher to enable or disable the OK button if the dialog contains - * valid information. This class is overridden to do data checking diffferent fields. - * By itself, it always enables the button. - * - * Callers can also assing a paired partner to the TextWatcher, and callers will check - * that both are enabled before enabling the ok button. - */ - private class EditBookmarkTextWatcher implements TextWatcher { - // A stored reference to the dialog containing the text field being watched - protected AlertDialog mDialog; - - // A stored text watcher to do the real verification of a field - protected EditBookmarkTextWatcher mPairedTextWatcher; - - // Whether or not the ok button should be enabled. - protected boolean mEnabled = true; - - public EditBookmarkTextWatcher(AlertDialog aDialog) { - mDialog = aDialog; - } - - public void setPairedTextWatcher(EditBookmarkTextWatcher aTextWatcher) { - mPairedTextWatcher = aTextWatcher; - } - - public boolean isEnabled() { - return mEnabled; - } - - // Textwatcher interface - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - // Disable if the we're disabled or the paired partner is disabled - boolean enabled = mEnabled && (mPairedTextWatcher == null || mPairedTextWatcher.isEnabled()); - mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(enabled); - } - - @Override - public void afterTextChanged(Editable s) {} - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) {} - } - - /** - * A version of the EditBookmarkTextWatcher for the url field of the dialog. - * Only checks if the field is empty or not. - */ - private class LocationTextWatcher extends EditBookmarkTextWatcher { - public LocationTextWatcher(AlertDialog aDialog) { - super(aDialog); - } - - // Disables the ok button if the location field is empty. - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - mEnabled = (s.toString().trim().length() > 0); - super.onTextChanged(s, start, before, count); - } - } - - /** - * A version of the EditBookmarkTextWatcher for the keyword field of the dialog. - * Checks if the field has any (non leading or trailing) spaces. - */ - private class KeywordTextWatcher extends EditBookmarkTextWatcher { - public KeywordTextWatcher(AlertDialog aDialog) { - super(aDialog); - } - - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - // Disable if the keyword contains spaces - mEnabled = (s.toString().trim().indexOf(' ') == -1); - super.onTextChanged(s, start, before, count); - } - } - - /** - * Show the Edit bookmark dialog for a particular url. If the url is bookmarked multiple times - * this will just edit the first instance it finds. - * - * @param url The url of the bookmark to edit. The dialog will look up other information like the id, - * current title, or keywords associated with this url. If the url isn't bookmarked, the - * dialog will fail silently. If the url is bookmarked multiple times, this will only show - * information about the first it finds. - */ - public void show(final String url) { - (new UiAsyncTask(ThreadUtils.getBackgroundHandler()) { - @Override - public Bookmark doInBackground(Void... params) { - Cursor cursor = BrowserDB.getBookmarkForUrl(mContext.getContentResolver(), url); - if (cursor == null) { - return null; - } - - cursor.moveToFirst(); - Bookmark bookmark = new Bookmark(cursor.getInt(cursor.getColumnIndexOrThrow(Bookmarks._ID)), - cursor.getString(cursor.getColumnIndexOrThrow(Bookmarks.TITLE)), - cursor.getString(cursor.getColumnIndexOrThrow(Bookmarks.URL)), - cursor.getString(cursor.getColumnIndexOrThrow(Bookmarks.KEYWORD))); - cursor.close(); - return bookmark; - } - - @Override - public void onPostExecute(Bookmark bookmark) { - if (bookmark == null) - return; - - show(bookmark.id, bookmark.title, bookmark.url, bookmark.keyword); - } - }).execute(); - } - - /** - * Show the Edit bookmark dialog for a set of data. This will show the dialog whether - * a bookmark with this url exists or not, but the results will NOT be saved if the id - * is not a valid bookmark id. - * - * @param id The id of the bookmark to change. If there is no bookmark with this ID, the dialog - * will fail silently. - * @param title The initial title to show in the dialog - * @param url The initial url to show in the dialog - * @param keyword The initial keyword to show in the dialog - */ - public void show(final int id, final String title, final String url, final String keyword) { - AlertDialog.Builder editPrompt = new AlertDialog.Builder(mContext); - final View editView = LayoutInflater.from(mContext).inflate(R.layout.bookmark_edit, null); - editPrompt.setTitle(R.string.bookmark_edit_title); - editPrompt.setView(editView); - - final EditText nameText = ((EditText) editView.findViewById(R.id.edit_bookmark_name)); - final EditText locationText = ((EditText) editView.findViewById(R.id.edit_bookmark_location)); - final EditText keywordText = ((EditText) editView.findViewById(R.id.edit_bookmark_keyword)); - nameText.setText(title); - locationText.setText(url); - keywordText.setText(keyword); - - editPrompt.setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int whichButton) { - (new UiAsyncTask(ThreadUtils.getBackgroundHandler()) { - @Override - public Void doInBackground(Void... params) { - String newUrl = locationText.getText().toString().trim(); - String newKeyword = keywordText.getText().toString().trim(); - BrowserDB.updateBookmark(mContext.getContentResolver(), id, newUrl, nameText.getText().toString(), newKeyword); - return null; - } - - @Override - public void onPostExecute(Void result) { - Toast.makeText(mContext, R.string.bookmark_updated, Toast.LENGTH_SHORT).show(); - } - }).execute(); - } - }); - - editPrompt.setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int whichButton) { - // do nothing - } - }); - - final AlertDialog dialog = editPrompt.create(); - - // Create our TextWatchers - LocationTextWatcher locationTextWatcher = new LocationTextWatcher(dialog); - KeywordTextWatcher keywordTextWatcher = new KeywordTextWatcher(dialog); - - // Cross reference the TextWatchers - locationTextWatcher.setPairedTextWatcher(keywordTextWatcher); - keywordTextWatcher.setPairedTextWatcher(locationTextWatcher); - - // Add the TextWatcher Listeners - locationText.addTextChangedListener(locationTextWatcher); - keywordText.addTextChangedListener(keywordTextWatcher); - - dialog.show(); - } -} diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index af6e7e04082..bc1be95c530 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -82,7 +82,6 @@ FENNEC_JAVA_FILES = \ Distribution.java \ DoorHanger.java \ DoorHangerPopup.java \ - EditBookmarkDialog.java \ Favicons.java \ FilePickerResultHandler.java \ FilePickerResultHandlerSync.java \ @@ -229,7 +228,6 @@ FENNEC_JAVA_FILES = \ widget/AboutHomeView.java \ widget/AboutHomeSection.java \ widget/AddonsSection.java \ - widget/ButtonToast.java \ widget/DateTimePicker.java \ widget/Divider.java \ widget/FaviconView.java \ @@ -636,11 +634,6 @@ RES_DRAWABLE_MDPI = \ res/drawable-mdpi/tab_thumbnail_shadow.png \ res/drawable-mdpi/tabs_count.png \ res/drawable-mdpi/tabs_count_foreground.png \ - res/drawable-mdpi/toast.9.png \ - res/drawable-mdpi/toast_button_focused.9.png \ - res/drawable-mdpi/toast_button_focused.9.png \ - res/drawable-mdpi/toast_button_pressed.9.png \ - res/drawable-mdpi/toast_divider.9.png \ res/drawable-mdpi/address_bar_url_default.9.png \ res/drawable-mdpi/address_bar_url_default_pb.9.png \ res/drawable-mdpi/address_bar_url_pressed.9.png \ @@ -1067,7 +1060,6 @@ MOZ_ANDROID_DRAWABLES += \ mobile/android/base/resources/drawable/tab_thumbnail.xml \ mobile/android/base/resources/drawable/tabs_panel_indicator.xml \ mobile/android/base/resources/drawable/textbox_bg.xml \ - mobile/android/base/resources/drawable/toast_button.xml \ mobile/android/base/resources/drawable/webapp_titlebar_bg.xml \ $(NULL) diff --git a/mobile/android/base/db/BrowserDB.java b/mobile/android/base/db/BrowserDB.java index fdf6d5a4fa2..b51014a317b 100644 --- a/mobile/android/base/db/BrowserDB.java +++ b/mobile/android/base/db/BrowserDB.java @@ -112,8 +112,6 @@ public class BrowserDB { public void unpinAllSites(ContentResolver cr); public Cursor getPinnedSites(ContentResolver cr, int limit); - - public Cursor getBookmarkForUrl(ContentResolver cr, String url); } static { @@ -291,10 +289,6 @@ public class BrowserDB { return sDb.getPinnedSites(cr, limit); } - public static Cursor getBookmarkForUrl(ContentResolver cr, String url) { - return sDb.getBookmarkForUrl(cr, url); - } - public static class PinnedSite { public String title = ""; public String url = ""; diff --git a/mobile/android/base/db/LocalBrowserDB.java b/mobile/android/base/db/LocalBrowserDB.java index d093662c4a7..484decc438b 100644 --- a/mobile/android/base/db/LocalBrowserDB.java +++ b/mobile/android/base/db/LocalBrowserDB.java @@ -1222,23 +1222,4 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface { return (count > 0); } - - public Cursor getBookmarkForUrl(ContentResolver cr, String url) { - Cursor c = cr.query(bookmarksUriWithLimit(1), - new String[] { Bookmarks._ID, - Bookmarks.URL, - Bookmarks.TITLE, - Bookmarks.KEYWORD }, - Bookmarks.URL + " = ?", - new String[] { url }, - null); - if (c == null) { - return c; - } else if (c.getCount() == 0) { - c.close(); - c = null; - } - - return c; - } } diff --git a/mobile/android/base/locales/en-US/android_strings.dtd b/mobile/android/base/locales/en-US/android_strings.dtd index 55535906e7c..1d326027fdb 100644 --- a/mobile/android/base/locales/en-US/android_strings.dtd +++ b/mobile/android/base/locales/en-US/android_strings.dtd @@ -42,7 +42,6 @@ - diff --git a/mobile/android/base/resources/drawable-mdpi/toast.9.png b/mobile/android/base/resources/drawable-mdpi/toast.9.png deleted file mode 100644 index b9105deeefb805737627a38fc0818ac00be90e11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 839 zcmV-N1GxN&P)j~O(aS~>jI*GARALPZW)ym*FPHDWq8I1(U46`4*`nM`D4nMO0(kX7~VWc8B1QAYMk#;(>=Ms+~!;%PV0Gr)z_q{C3C+FM>Baw?0{`#|j2Eey%`+L9N z|3EB+?_LjvCh`apVq4es)8TL!ErNlfs;X}Qej@gm6_n6K>hRD+9{hWJ42J2f4U2rolzf7QueV$hL*? zeq6Ps{oDTy*)c+Hc^mT++1otgPB0_q>{MgURD}oI*F)o7SLQ|BNQ`hyc?#qmEaNF@jv&1X-2A|B{*aCP2@CCrvu6{(w zNRVf+OW!EuQRD=m0q_Fg89)u-Pgg%9cu0fTL!$F&Ei5(YjZL1?AU%UM(r`{cJaB@_p?Zmwe8|2zaHPyRMb2tUt<#|N9Q^takF=<1YkybI$aT RjbH!(002ovPDHLkV1hAGdGG)L diff --git a/mobile/android/base/resources/drawable-mdpi/toast_button_focused.9.png b/mobile/android/base/resources/drawable-mdpi/toast_button_focused.9.png deleted file mode 100644 index e2a7942f5f45653f3b82f67549bf4ba1ee848e02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^`arD3!3HFiUopu8DYhhUcNd2LAh=-f^2tCE&H|6f zVg?58P7r1^KY4mBP>{XE)7O>#E-OE)fUuRrYGI(z5lBejUrQ@uNc11I906-{vJryH4I1k;)yr`BVqzzw4}<9ttw`C$gGpyb%y^;!ymq z(36&(E0&v`)T7@eGH=e42S@Aw)t;7nemco~{<@$~q6{xK)@e_UE=&Umj6lCtN3g`)&I#XbN|Xy&sFq4xSmt0F`Kfy#xZ1j zrNwefGlm;qrk?LjwYVA$wDxE9nz|dW#LvHb!j*entGxf-swY7IFnGH9xvX{XE)7O>#E-ODPKQFK7jCVkxBc3jfArXh)&fLq(WXRJR?<1C= z6w%mbt1+{ot*=RRMIJ+z+Jf{>Z3iZy_=E9dO*JFXUHK(^zL-`q}q z)j13SU#Fh$efl*d-;qP{$@`7JHeA)e_HGGdV5n|RpI})V&_4{Gu6{1-oD!M+EB?tsY|jY1TafHS=s>_ww>AzQaBmo zL2v#9vx!Ij0ebMfXK(%q6HjY2!6^%@2eD~8GjE>fc|Ye(v+-ze=k^Z6FnjeQtwq;s z^xNIOPXD#DJ2&Z)CbceU<35>~0b&kq+(V%5ngi5AragUjj!F!ZJa9T)(lw413%i^d zW4OrmDVt$R<;XX!5h9?629Bq)-#>q0fn%%eiD+aEzlw&=(JVmiS)*gkMwV=|<%ggY zDOA8k!~~Ih>V-?qf60f(3+(RQ58cuF(Wl93UWaxr~*C5J(aS^P(id2SCU| zfzQ%c%D}uLN{Ubb%ZH`j0=uuYG=1rdo>X>7h_CScWHR96<@|9|UOoD?B#;2<)HiwwtaEN_SZA;*;VOowC z8}2O_hN0BGkeHr@>YB<@4bE|FMJ(hCIa#mOpj3pg24%gNE9#YE0cLffs#jKA4O?Ru zd1S@4ueka~ZafUGPd#fWaGoPu53masNh{9gSgITKmRx&tEZRmcPlMs(*8bJ%m5I(z zyj>42J*-C`d34?bI@s@@T>PMyLab|to#b?Z@hRt2U05e>hacDI-Q>9;Jd_e p;;r!e{&tG_U>_K% - - - - - \ No newline at end of file diff --git a/mobile/android/base/resources/layout/gecko_app.xml b/mobile/android/base/resources/layout/gecko_app.xml index 7bffa430d21..a181be6375e 100644 --- a/mobile/android/base/resources/layout/gecko_app.xml +++ b/mobile/android/base/resources/layout/gecko_app.xml @@ -40,15 +40,4 @@ android:layout_height="@dimen/browser_toolbar_height"/> - - - - -