Merge mozilla-central to b2g-i

This commit is contained in:
Carsten "Tomcat" Book 2014-05-09 14:20:02 +02:00
commit a3c8c6b85e
375 changed files with 3329 additions and 1479 deletions

6
.gitignore vendored
View File

@ -55,3 +55,9 @@ python/psutil/build/
# Ignore chrome.manifest files from the devtools loader
browser/devtools/chrome.manifest
toolkit/devtools/chrome.manifest
# Tag files generated by GNU Global
GTAGS
GRTAGS
GSYMS
GPATH

View File

@ -61,3 +61,9 @@ _OPT\.OBJ/
# Ignore chrome.manifest files from the devtools loader
^browser/devtools/chrome.manifest$
^toolkit/devtools/chrome.manifest$
# Tag files generated by GNU Global
GTAGS
GRTAGS
GSYMS
GPATH

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 1005321 - Requires a clobber because of bug 1005486
Bug 994964 apparently requires a clobber, unclear why

View File

@ -1452,7 +1452,7 @@ pref("browser.newtabpage.rows", 3);
// number of columns of newtab grid
pref("browser.newtabpage.columns", 3);
pref("browser.newtabpage.directorySource", "data:application/json,{}");
pref("browser.newtabpage.directorySource", "chrome://global/content/directoryLinks.json");
// Enable the DOM fullscreen API.
pref("full-screen-api.enabled", true);

View File

@ -1509,9 +1509,6 @@ let SessionStoreInternal = {
},
getTabState: function ssi_getTabState(aTab) {
if (!aTab.ownerDocument) {
throw Components.Exception("Invalid tab object: no ownerDocument", Cr.NS_ERROR_INVALID_ARG);
}
if (!aTab.ownerDocument.defaultView.__SSi) {
throw Components.Exception("Default view is not tracked", Cr.NS_ERROR_INVALID_ARG);
}
@ -1536,9 +1533,6 @@ let SessionStoreInternal = {
if (!("entries" in tabState)) {
throw Components.Exception("Invalid state object: no entries", Cr.NS_ERROR_INVALID_ARG);
}
if (!aTab.ownerDocument) {
throw Components.Exception("Invalid tab object: no ownerDocument", Cr.NS_ERROR_INVALID_ARG);
}
let window = aTab.ownerDocument.defaultView;
if (!("__SSi" in window)) {
@ -1554,9 +1548,6 @@ let SessionStoreInternal = {
},
duplicateTab: function ssi_duplicateTab(aWindow, aTab, aDelta = 0) {
if (!aTab.ownerDocument) {
throw Components.Exception("Invalid tab object: no ownerDocument", Cr.NS_ERROR_INVALID_ARG);
}
if (!aTab.ownerDocument.defaultView.__SSi) {
throw Components.Exception("Default view is not tracked", Cr.NS_ERROR_INVALID_ARG);
}

View File

@ -11,7 +11,8 @@ function test() {
return false;
}
catch (ex) {
return ex.name == "NS_ERROR_ILLEGAL_VALUE";
return ex.name == "NS_ERROR_ILLEGAL_VALUE" ||
ex.name == "NS_ERROR_FAILURE";
}
}

View File

@ -786,10 +786,14 @@ StackFrames.prototype = {
if (!isClientEval && !isPopupShown) {
// Move the editor's caret to the proper url and line.
DebuggerView.setEditorLocation(where.url, where.line);
// Highlight the breakpoint at the specified url and line if it exists.
DebuggerView.Sources.highlightBreakpoint(where, { noEditorUpdate: true });
} else {
// Highlight the line where the execution is paused in the editor.
DebuggerView.setEditorLocation(where.url, where.line, { noCaret: true });
}
// Highlight the breakpoint at the line and column if it exists.
DebuggerView.Sources.highlightBreakpointAtCursor();
// Don't display the watch expressions textbox inputs in the pane.
DebuggerView.WatchExpressions.toggleContents(false);
@ -1747,12 +1751,14 @@ Breakpoints.prototype = {
// Initialize the breakpoint, but don't update the editor, since this
// callback is invoked because a breakpoint was added in the editor itself.
this.addBreakpoint(location, { noEditorUpdate: true }).then(aBreakpointClient => {
// If the breakpoint client has an "requestedLocation" attached, then
// If the breakpoint client has a "requestedLocation" attached, then
// the original requested placement for the breakpoint wasn't accepted.
// In this case, we need to update the editor with the new location.
if (aBreakpointClient.requestedLocation) {
DebuggerView.editor.removeBreakpoint(aBreakpointClient.requestedLocation.line - 1);
DebuggerView.editor.addBreakpoint(aBreakpointClient.location.line - 1);
DebuggerView.editor.moveBreakpoint(
aBreakpointClient.requestedLocation.line - 1,
aBreakpointClient.location.line - 1
);
}
// Notify that we've shown a breakpoint in the source editor.
window.emit(EVENTS.BREAKPOINT_SHOWN);

View File

@ -414,6 +414,17 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
}
},
/**
* Highlight the breakpoint on the current currently focused line/column
* if it exists.
*/
highlightBreakpointAtCursor: function() {
let url = DebuggerView.Sources.selectedValue;
let line = DebuggerView.editor.getCursor().line + 1;
let location = { url: url, line: line };
this.highlightBreakpoint(location, { noEditorUpdate: true });
},
/**
* Unhighlights the current breakpoint in this sources container.
*/
@ -2003,21 +2014,21 @@ VariableBubbleView.prototype = {
/**
* The mousemove listener for the source editor.
*/
_onMouseMove: function({ clientX: x, clientY: y, buttons: btns }) {
_onMouseMove: function(e) {
// Prevent the variable inspection popup from showing when the thread client
// is not paused, or while a popup is already visible, or when the user tries
// to select text in the editor.
if (gThreadClient && gThreadClient.state != "paused"
|| !this._tooltip.isHidden()
|| (DebuggerView.editor.somethingSelected()
&& btns > 0)) {
let isResumed = gThreadClient && gThreadClient.state != "paused";
let isSelecting = DebuggerView.editor.somethingSelected() && e.buttons > 0;
let isPopupVisible = !this._tooltip.isHidden();
if (isResumed || isSelecting || isPopupVisible) {
clearNamedTimeout("editor-mouse-move");
return;
}
// Allow events to settle down first. If the mouse hovers over
// a certain point in the editor long enough, try showing a variable bubble.
setNamedTimeout("editor-mouse-move",
EDITOR_VARIABLE_HOVER_DELAY, () => this._findIdentifier(x, y));
EDITOR_VARIABLE_HOVER_DELAY, () => this._findIdentifier(e.clientX, e.clientY));
},
/**

View File

@ -370,8 +370,7 @@ let DebuggerView = {
* The source object coming from the active thread.
* @param object aFlags
* Additional options for setting the source. Supported options:
* - force: boolean allowing whether we can get the selected url's
* text again.
* - force: boolean forcing all text to be reshown in the editor
* @return object
* A promise that is resolved after the source text has been set.
*/
@ -441,8 +440,7 @@ let DebuggerView = {
* - noDebug: don't set the debug location at the specified line
* - align: string specifying whether to align the specified line
* at the "top", "center" or "bottom" of the editor
* - force: boolean allowing whether we can get the selected url's
* text again
* - force: boolean forcing all text to be reshown in the editor
* @return object
* A promise that is resolved after the source text has been set.
*/

View File

@ -42,6 +42,7 @@ support-files =
doc_blackboxing.html
doc_breakpoints-break-on-last-line-of-script-on-reload.html
doc_closures.html
doc_closure-optimized-out.html
doc_cmd-break.html
doc_cmd-dbg.html
doc_conditional-breakpoints.html
@ -161,6 +162,7 @@ skip-if = true # Bug 933950 (leaky test)
[browser_dbg_navigation.js]
[browser_dbg_no-page-sources.js]
[browser_dbg_on-pause-highlight.js]
[browser_dbg_optimized-out-vars.js]
[browser_dbg_panel-size.js]
[browser_dbg_parser-01.js]
[browser_dbg_parser-02.js]
@ -285,6 +287,7 @@ skip-if = (os == 'mac' || os == 'win') && (debug == false) # Bug 986166
[browser_dbg_variables-view-popup-13.js]
[browser_dbg_variables-view-popup-14.js]
[browser_dbg_variables-view-popup-15.js]
[browser_dbg_variables-view-popup-16.js]
[browser_dbg_variables-view-reexpand-01.js]
[browser_dbg_variables-view-reexpand-02.js]
[browser_dbg_variables-view-reexpand-03.js]

View File

@ -0,0 +1,48 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Test that optimized out variables aren't present in the variables view.
function test() {
Task.spawn(function* () {
const TAB_URL = EXAMPLE_URL + "doc_closure-optimized-out.html";
let panel, debuggee, gDebugger, sources;
let [, debuggee, panel] = yield initDebugger(TAB_URL);
gDebugger = panel.panelWin;
sources = gDebugger.DebuggerView.Sources;
yield waitForSourceShown(panel, ".html");
yield panel.addBreakpoint({ url: sources.values[0], line: 18 });
yield ensureThreadClientState(panel, "resumed");
// Spin the event loop before causing the debuggee to pause, to allow
// this function to return first.
executeSoon(() => {
EventUtils.sendMouseEvent({ type: "click" },
debuggee.document.querySelector("button"),
debuggee);
});
yield waitForDebuggerEvents(panel, gDebugger.EVENTS.FETCHED_SCOPES);
let gVars = gDebugger.DebuggerView.Variables;
let outerScope = gVars.getScopeAtIndex(1);
outerScope.expand();
let upvarVar = outerScope.get("upvar");
ok(!upvarVar, "upvar was optimized out.");
if (upvarVar) {
ok(false, "upvar = " + upvarVar.target.querySelector(".value").getAttribute("value"));
}
let argVar = outerScope.get("arg");
is(argVar.target.querySelector(".name").getAttribute("value"), "arg",
"Should have the right property name for |arg|.");
is(argVar.target.querySelector(".value").getAttribute("value"), 42,
"Should have the right property value for |arg|.");
yield resumeDebuggerThenCloseAndFinish(panel);
}).then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
}

View File

@ -0,0 +1,68 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests if opening the variables inspection popup preserves the highlighting
* associated with the currently debugged line.
*/
const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
function test() {
Task.spawn(function() {
let [tab, debuggee, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let events = win.EVENTS;
let editor = win.DebuggerView.editor;
let frames = win.DebuggerView.StackFrames;
let variables = win.DebuggerView.Variables;
let bubble = win.DebuggerView.VariableBubble;
let tooltip = bubble._tooltip.panel;
function checkView(selectedFrame, caretLine, debugLine = caretLine) {
let deferred = promise.defer();
is(win.gThreadClient.state, "paused",
"Should only be getting stack frames while paused.");
is(frames.itemCount, 25,
"Should have 25 frames.");
is(frames.selectedDepth, selectedFrame,
"The correct frame is selected in the widget.");
ok(isCaretPos(panel, caretLine),
"Editor caret location is correct.");
// The editor's debug location takes a tick to update.
executeSoon(() => {
ok(isCaretPos(panel, caretLine), "Editor caret location is still correct.");
ok(isDebugPos(panel, debugLine), "Editor debug location is correct.");
deferred.resolve();
});
return deferred.promise;
}
function expandGlobalScope() {
let globalScope = variables.getScopeAtIndex(1);
is(globalScope.expanded, false,
"The globalScope should not be expanded yet.");
let finished = waitForDebuggerEvents(panel, events.FETCHED_VARIABLES);
globalScope.expand();
return finished;
}
// Allow this generator function to yield first.
executeSoon(() => debuggee.recurse());
yield waitForSourceAndCaretAndScopes(panel, ".html", 26);
yield checkView(0, 26);
yield expandGlobalScope();
yield checkView(0, 26);
// Inspect variable in topmost frame.
yield openVarPopup(panel, { line: 26, ch: 11 });
yield checkView(0, 26);
yield resumeDebuggerThenCloseAndFinish(panel);
});
}

View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'/>
<title>Debugger Test for Inspecting Optimized-Out Variables</title>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="text/javascript">
window.addEventListener("load", function onload() {
window.removeEventListener("load", onload);
function clickHandler(event) {
button.removeEventListener("click", clickHandler, false);
function outer(arg) {
var upvar = arg * 2;
// The inner lambda only aliases arg, so the frontend alias analysis decides
// that upvar is not aliased and is not in the CallObject.
return function () {
arg += 2;
};
}
var f = outer(42);
f();
}
var button = document.querySelector("button");
button.addEventListener("click", clickHandler, false);
});
</script>
</head>
<body>
<button>Click me!</button>
</body>
</html>

View File

@ -300,6 +300,15 @@ function isCaretPos(aPanel, aLine, aCol = 1) {
return cursor.line == (aLine - 1) && cursor.ch == (aCol - 1);
}
function isDebugPos(aPanel, aLine) {
let editor = aPanel.panelWin.DebuggerView.editor;
let location = editor.getDebugLocation();
// Source editor starts counting line and column numbers from 0.
info("Current editor debug position: " + (location + 1));
return location != null && editor.hasLineClass(aLine - 1, "debug-line");
}
function isEditorSel(aPanel, [start, end]) {
let editor = aPanel.panelWin.DebuggerView.editor;
let range = {

View File

@ -24,6 +24,11 @@
.breakpoint {
background-image: url("chrome://browser/skin/devtools/editor-breakpoint.png");
position: relative;
}
.breakpoint[adding] {
transition: transform .25s;
}
.debugLocation {

View File

@ -153,6 +153,29 @@ function removeBreakpoint(ctx, line) {
ed.emit("breakpointRemoved", line);
}
function moveBreakpoint(ctx, fromLine, toLine) {
let { ed, cm } = ctx;
let info = cm.lineInfo(fromLine);
var fromTop = cm.cursorCoords({ line: fromLine }).top;
var toTop = cm.cursorCoords({ line: toLine }).top;
var marker = ed.getMarker(info.line, "breakpoints", "breakpoint");
if (marker) {
marker.setAttribute("adding", "");
marker.style.transform = "translateY(" + (toTop - fromTop) + "px)";
marker.addEventListener('transitionend', function(e) {
ed.removeBreakpoint(info.line);
ed.addBreakpoint(toLine);
// For some reason, we have to reset the styles after the marker
// is already removed, not before.
e.target.removeAttribute("adding");
e.target.style.transform = "none";
});
}
}
/**
* Returns a list of all breakpoints in the current Editor.
*/
@ -236,6 +259,6 @@ function findPrev(ctx, query) {
[
initialize, hasBreakpoint, addBreakpoint, removeBreakpoint,
getBreakpoints, setDebugLocation, getDebugLocation,
moveBreakpoint, getBreakpoints, setDebugLocation, getDebugLocation,
clearDebugLocation, find, findNext, findPrev
].forEach(function (func) { module.exports[func.name] = func; });

View File

@ -509,16 +509,7 @@ Editor.prototype = {
* Returns whether a marker of a specified class exists in a line's gutter.
*/
hasMarker: function (line, gutterName, markerClass) {
let cm = editors.get(this);
let info = cm.lineInfo(line);
if (!info)
return false;
let gutterMarkers = info.gutterMarkers;
if (!gutterMarkers)
return false;
let marker = gutterMarkers[gutterName];
let marker = this.getMarker(line, gutterName);
if (!marker)
return false;
@ -561,6 +552,19 @@ Editor.prototype = {
cm.lineInfo(line).gutterMarkers[gutterName].classList.remove(markerClass);
},
getMarker: function(line, gutterName) {
let cm = editors.get(this);
let info = cm.lineInfo(line);
if (!info)
return null;
let gutterMarkers = info.gutterMarkers;
if (!gutterMarkers)
return null;
return gutterMarkers[gutterName];
},
/**
* Remove all gutter markers in the gutter with the given name.
*/

View File

@ -25,6 +25,7 @@ support-files =
simple.css.gz^headers^
simple.gz.html
simple.html
sourcemap-css/contained.css
sourcemap-css/sourcemaps.css
sourcemap-css/sourcemaps.css.map
sourcemap-sass/sourcemaps.scss

View File

@ -8,9 +8,11 @@ let {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
const TESTCASE_URI_HTML = TEST_BASE + "sourcemaps.html";
const TESTCASE_URI_CSS = TEST_BASE + "sourcemap-css/sourcemaps.css";
const TESTCASE_URI_CSS2 = TEST_BASE + "sourcemap-css/contained.css";
const TESTCASE_URI_REG_CSS = TEST_BASE + "simple.css";
const TESTCASE_URI_SCSS = TEST_BASE + "sourcemap-sass/sourcemaps.scss";
const TESTCASE_URI_MAP = TEST_BASE + "sourcemap-css/sourcemaps.css.map";
const TESTCASE_SCSS_NAME = "sourcemaps.scss";
const PREF = "devtools.styleeditor.source-maps-enabled";
@ -35,6 +37,7 @@ function test()
// copy all our files over so we don't screw them up for other tests
let HTMLFile = yield copy(TESTCASE_URI_HTML, ["sourcemaps.html"]);
let CSSFile = yield copy(TESTCASE_URI_CSS, ["sourcemap-css", "sourcemaps.css"]);
let CSSFile2 = yield copy(TESTCASE_URI_CSS2, ["sourcemap-css", "contained.css"]);
yield copy(TESTCASE_URI_SCSS, ["sourcemap-sass", "sourcemaps.scss"]);
yield copy(TESTCASE_URI_MAP, ["sourcemap-css", "sourcemaps.css.map"]);
yield copy(TESTCASE_URI_REG_CSS, ["simple.css"]);
@ -71,15 +74,19 @@ function test()
function openEditor(testcaseURI) {
let deferred = promise.defer();
addTabAndOpenStyleEditors(3, panel => {
addTabAndOpenStyleEditors(5, panel => {
let UI = panel.UI;
// wait for 3 editors - 1 for first style sheet, 1 for the
// generated style sheet, and 1 for original source after it
// loads and replaces the generated style sheet.
// wait for 5 editors - 1 for first style sheet, 2 for the
// generated style sheets, and 2 for original source after it
// loads and replaces the generated style sheets.
let editor = UI.editors[1];
if (getStylesheetNameFor(editor) != TESTCASE_SCSS_NAME) {
editor = UI.editors[2];
}
is(getStylesheetNameFor(editor), TESTCASE_SCSS_NAME, "found scss editor");
let link = getStylesheetNameLinkFor(editor);
let link = getLinkFor(editor);
link.click();
editor.getSourceEditor().then(deferred.resolve);
@ -125,10 +132,15 @@ function finishUp() {
/* Helpers */
function getStylesheetNameLinkFor(editor) {
function getLinkFor(editor) {
return editor.summary.querySelector(".stylesheet-name");
}
function getStylesheetNameFor(editor) {
return editor.summary.querySelector(".stylesheet-name > label")
.getAttribute("value")
}
function copy(aSrcChromeURL, aDestFilePath)
{
let destFile = FileUtils.getFile("ProfD", aDestFilePath);

View File

@ -6,106 +6,116 @@
const TESTCASE_URI = TEST_BASE_HTTPS + "sourcemaps.html";
const PREF = "devtools.styleeditor.source-maps-enabled";
function test()
{
waitForExplicitFinish();
const contents = {
"sourcemaps.scss": [
"",
"$paulrougetpink: #f06;",
"",
"div {",
" color: $paulrougetpink;",
"}",
"",
"span {",
" background-color: #EEE;",
"}"
].join("\n"),
"contained.scss": [
"$pink: #f06;",
"",
"#header {",
" color: $pink;",
"}"
].join("\n"),
"sourcemaps.css": [
"div {",
" color: #ff0066; }",
"",
"span {",
" background-color: #EEE; }",
"",
"/*# sourceMappingURL=sourcemaps.css.map */"
].join("\n"),
"contained.css": [
"#header {",
" color: #f06; }",
"",
"/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJzYXNzL2NvbnRhaW5lZC5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBO0VBQ0UsT0FISyIsInNvdXJjZXNDb250ZW50IjpbIiRwaW5rOiAjZjA2O1xuXG4jaGVhZGVyIHtcbiAgY29sb3I6ICRwaW5rO1xufSJdfQ==*/"
].join("\n")
}
const cssNames = ["sourcemaps.css", "contained.css"];
const scssNames = ["sourcemaps.scss", "contained.scss"];
waitForExplicitFinish();
let test = asyncTest(function*() {
Services.prefs.setBoolPref(PREF, true);
// wait for 3 editors - 1 for first style sheet, 1 for the
// generated style sheet, and 1 for original source after it
// loads and replaces the generated style sheet.
addTabAndOpenStyleEditors(3, panel => runTests(panel.UI));
let {UI} = yield addTabAndOpenStyleEditors(5, null, TESTCASE_URI);
content.location = TESTCASE_URI;
}
is(UI.editors.length, 3,
"correct number of editors with source maps enabled");
function runTests(UI)
{
is(UI.editors.length, 2);
// Test first plain css editor
testFirstEditor(UI.editors[0]);
let firstEditor = UI.editors[0];
testFirstEditor(firstEditor);
// Test Scss editors
yield testEditor(UI.editors[1], scssNames);
yield testEditor(UI.editors[2], scssNames);
let ScssEditor = UI.editors[1];
// Test disabling original sources
yield togglePref(UI);
let link = getStylesheetNameLinkFor(ScssEditor);
link.click();
is(UI.editors.length, 3, "correct number of editors after pref toggled");
ScssEditor.getSourceEditor().then(() => {
testScssEditor(ScssEditor);
// Test CSS editors
yield testEditor(UI.editors[1], cssNames);
yield testEditor(UI.editors[2], cssNames);
togglePref(UI);
});
}
function togglePref(UI) {
let count = 0;
UI.on("editor-added", (event, editor) => {
if (++count == 2) {
testTogglingPref(UI);
}
})
Services.prefs.setBoolPref(PREF, false);
}
function testTogglingPref(UI) {
is(UI.editors.length, 2, "correct number of editors after pref toggled");
let CSSEditor = UI.editors[1];
let link = getStylesheetNameLinkFor(CSSEditor);
link.click();
CSSEditor.getSourceEditor().then(() => {
testCSSEditor(CSSEditor);
finishUp();
})
}
Services.prefs.clearUserPref(PREF);
});
function testFirstEditor(editor) {
let name = getStylesheetNameFor(editor);
is(name, "simple.css", "First style sheet display name is correct");
}
function testScssEditor(editor) {
function testEditor(editor, possibleNames) {
let name = getStylesheetNameFor(editor);
is(name, "sourcemaps.scss", "Original source display name is correct");
ok(possibleNames.indexOf(name) >= 0, name + " editor name is correct");
let text = editor.sourceEditor.getText();
return openEditor(editor).then(() => {
let expectedText = contents[name];
is(text, "\n\
$paulrougetpink: #f06;\n\
\n\
div {\n\
color: $paulrougetpink;\n\
}\n\
\n\
span {\n\
background-color: #EEE;\n\
}", "Original source text is correct");
}
function testCSSEditor(editor) {
let name = getStylesheetNameFor(editor);
is(name, "sourcemaps.css", "CSS source display name is correct");
let text = editor.sourceEditor.getText();
is(text, "div {\n\
color: #ff0066; }\n\
\n\
span {\n\
background-color: #EEE; }\n\
\n\
/*# sourceMappingURL=sourcemaps.css.map */", "CSS text is correct");
let text = editor.sourceEditor.getText();
is(text, expectedText, name + " editor contains expected text");
});
}
/* Helpers */
function getStylesheetNameLinkFor(editor) {
function togglePref(UI) {
let deferred = promise.defer();
let count = 0;
UI.on("editor-added", (event, editor) => {
if (++count == 3) {
deferred.resolve();
}
})
Services.prefs.setBoolPref(PREF, false);
return deferred.promise;
}
function openEditor(editor) {
getLinkFor(editor).click();
return editor.getSourceEditor();
}
function getLinkFor(editor) {
return editor.summary.querySelector(".stylesheet-name");
}
@ -113,8 +123,3 @@ function getStylesheetNameFor(editor) {
return editor.summary.querySelector(".stylesheet-name > label")
.getAttribute("value")
}
function finishUp() {
Services.prefs.clearUserPref(PREF);
finish();
}

View File

@ -6,13 +6,11 @@ const TEST_BASE_HTTP = "http://example.com/browser/browser/devtools/styleeditor/
const TEST_BASE_HTTPS = "https://example.com/browser/browser/devtools/styleeditor/test/";
const TEST_HOST = 'mochi.test:8888';
let tempScope = {};
Cu.import("resource://gre/modules/devtools/Loader.jsm", tempScope);
let TargetFactory = tempScope.devtools.TargetFactory;
Cu.import("resource://gre/modules/LoadContextInfo.jsm", tempScope);
let LoadContextInfo = tempScope.LoadContextInfo;
Cu.import("resource://gre/modules/devtools/Console.jsm", tempScope);
let console = tempScope.console;
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let TargetFactory = devtools.TargetFactory;
let {LoadContextInfo} = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
let {console} = Cu.import("resource://gre/modules/devtools/Console.jsm", {});
let {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
let gPanelWindow;
let cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
@ -28,6 +26,13 @@ SimpleTest.registerCleanupFunction(() => {
gDevTools.testing = false;
});
/**
* Define an async test based on a generator function
*/
function asyncTest(generator) {
return () => Task.spawn(generator).then(null, ok.bind(null, false)).then(finish);
}
function cleanup()
{
gPanelWindow = null;
@ -36,16 +41,25 @@ function cleanup()
}
}
function addTabAndOpenStyleEditors(count, callback) {
function addTabAndOpenStyleEditors(count, callback, uri) {
let deferred = promise.defer();
let currentCount = 0;
let panel;
addTabAndCheckOnStyleEditorAdded(p => panel = p, function () {
currentCount++;
info(currentCount + " of " + count + " editors opened");
if (currentCount == count) {
callback(panel);
if (callback) {
callback(panel);
}
deferred.resolve(panel);
}
});
if (uri) {
content.location = uri;
}
return deferred.promise;
}
function addTabAndCheckOnStyleEditorAdded(callbackOnce, callbackOnAdded) {

View File

@ -0,0 +1,4 @@
#header {
color: #f06; }
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJzYXNzL2NvbnRhaW5lZC5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBO0VBQ0UsT0FISyIsInNvdXJjZXNDb250ZW50IjpbIiRwaW5rOiAjZjA2O1xuXG4jaGVhZGVyIHtcbiAgY29sb3I6ICRwaW5rO1xufSJdfQ==*/

View File

@ -4,6 +4,7 @@
<title>testcase for testing CSS source maps</title>
<link rel="stylesheet" type="text/css" href="simple.css"/>
<link rel="stylesheet" type="text/css" href="sourcemap-css/sourcemaps.css?test=1"/>
<link rel="stylesheet" type="text/css" href="sourcemap-css/contained.css"
</head>
<body>
<div>source maps <span>testcase</span></div>

View File

@ -9,5 +9,5 @@
<!ENTITY newtab.undo.restoreButton "Restore All.">
<!ENTITY newtab.undo.closeTooltip "Hide">
<!ENTITY newtab.sponsored.release.message "This Sponsor site was suggested because we hoped youd find it interesting and because it supports Mozillas mission.">
<!ENTITY newtab.sponsored.trial.message "This Trial Sponsor site was suggested because we hoped youd find it interesting and because it supports Mozillas mission.">
<!ENTITY newtab.sponsored.trial.message "This site was suggested because we hoped youd find it interesting and because it supports Mozillas mission.">
<!ENTITY newtab.panel.link.text "Learn more…">

View File

@ -277,9 +277,13 @@ browser.jar:
skin/classic/browser/devtools/close.png (../shared/devtools/images/close.png)
skin/classic/browser/devtools/close@2x.png (../shared/devtools/images/close@2x.png)
skin/classic/browser/devtools/vview-delete.png (../shared/devtools/images/vview-delete.png)
skin/classic/browser/devtools/vview-lock.png (../shared/devtools/images/vview-lock.png)
skin/classic/browser/devtools/vview-delete@2x.png (../shared/devtools/images/vview-delete@2x.png)
skin/classic/browser/devtools/vview-edit.png (../shared/devtools/images/vview-edit.png)
skin/classic/browser/devtools/vview-edit@2x.png (../shared/devtools/images/vview-edit@2x.png)
skin/classic/browser/devtools/vview-lock.png (../shared/devtools/images/vview-lock.png)
skin/classic/browser/devtools/vview-lock@2x.png (../shared/devtools/images/vview-lock@2x.png)
skin/classic/browser/devtools/vview-open-inspector.png (../shared/devtools/images/vview-open-inspector.png)
skin/classic/browser/devtools/vview-open-inspector@2x.png (../shared/devtools/images/vview-open-inspector@2x.png)
skin/classic/browser/devtools/undock@2x.png (../shared/devtools/images/undock@2x.png)
skin/classic/browser/devtools/font-inspector.css (../shared/devtools/font-inspector.css)
skin/classic/browser/devtools/computedview.css (devtools/computedview.css)

View File

@ -13,6 +13,10 @@ button[type="menu"] > .button-box > .button-menu-dropmarker {
-moz-appearance: none !important;
}
.help-button > .button-box > .button-icon {
-moz-margin-end: 0;
}
menulist:not([editable="true"]) > .menulist-dropmarker {
display: -moz-box;
margin-top: 6px;

View File

@ -398,9 +398,13 @@ browser.jar:
skin/classic/browser/devtools/close.png (../shared/devtools/images/close.png)
skin/classic/browser/devtools/close@2x.png (../shared/devtools/images/close@2x.png)
skin/classic/browser/devtools/vview-delete.png (../shared/devtools/images/vview-delete.png)
skin/classic/browser/devtools/vview-lock.png (../shared/devtools/images/vview-lock.png)
skin/classic/browser/devtools/vview-delete@2x.png (../shared/devtools/images/vview-delete@2x.png)
skin/classic/browser/devtools/vview-edit.png (../shared/devtools/images/vview-edit.png)
skin/classic/browser/devtools/vview-edit@2x.png (../shared/devtools/images/vview-edit@2x.png)
skin/classic/browser/devtools/vview-lock.png (../shared/devtools/images/vview-lock.png)
skin/classic/browser/devtools/vview-lock@2x.png (../shared/devtools/images/vview-lock@2x.png)
skin/classic/browser/devtools/vview-open-inspector.png (../shared/devtools/images/vview-open-inspector.png)
skin/classic/browser/devtools/vview-open-inspector@2x.png (../shared/devtools/images/vview-open-inspector@2x.png)
skin/classic/browser/devtools/undock@2x.png (../shared/devtools/images/undock@2x.png)
skin/classic/browser/devtools/font-inspector.css (../shared/devtools/font-inspector.css)
skin/classic/browser/devtools/computedview.css (devtools/computedview.css)

View File

@ -10,6 +10,10 @@ menulist:not([editable="true"]) > .menulist-dropmarker {
margin-bottom: 1px;
}
.help-button > .button-box > .button-icon {
-moz-margin-start: 0;
}
checkbox:hover::before,
checkbox[checked]::before {
-moz-margin-end: -20px;

View File

@ -689,17 +689,17 @@
.variable-or-property-non-writable-icon {
background: url("chrome://browser/skin/devtools/vview-lock.png") no-repeat;
background-size: cover;
width: 16px;
height: 16px;
}
/*@media (min-resolution: 2dppx) {
@media (min-resolution: 2dppx) {
.variable-or-property-non-writable-icon {
background-image: url("chrome://browser/skin/identity-icons-https@2x.png");
background-size: 32px;
background-image: url("chrome://browser/skin/devtools/vview-lock@2x.png");
}
}
*/
.variable-or-property-frozen-label,
.variable-or-property-sealed-label,
.variable-or-property-non-extensible-label {
@ -788,64 +788,84 @@
/* Variables and properties editing */
.variables-view-delete {
list-style-image: url("chrome://browser/skin/devtools/vview-delete.png");
-moz-image-region: rect(0,16px,16px,0);
}
.variables-view-delete:hover {
-moz-image-region: rect(0,48px,16px,32px);
}
.variables-view-delete:active {
-moz-image-region: rect(0,32px,16px,16px);
}
.variable-or-property:focus > .title > .variables-view-delete {
-moz-image-region: rect(0,16px,16px,0);
}
.variables-view-edit {
list-style-image: url("chrome://browser/skin/devtools/vview-edit.png");
-moz-image-region: rect(0,16px,16px,0);
cursor: pointer;
}
.variables-view-edit:hover {
-moz-image-region: rect(0,48px,16px,32px);
}
.variables-view-edit:active {
-moz-image-region: rect(0,32px,16px,16px);
}
.variable-or-property:focus > .title > .variables-view-edit {
-moz-image-region: rect(0,16px,16px,0);
}
.variables-view-open-inspector {
list-style-image: url("chrome://browser/skin/devtools/vview-open-inspector.png");
-moz-image-region: rect(0,16px,16px,0);
cursor: pointer;
}
.variables-view-open-inspector:hover {
-moz-image-region: rect(0,48px,16px,32px);
}
.variables-view-open-inspector:active {
-moz-image-region: rect(0,32px,16px,16px);
}
.variable-or-property:focus > .title > .variables-view-open-inspector {
-moz-image-region: rect(0,16px,16px,0);
}
.variables-view-throbber {
background: url("chrome://global/skin/icons/loading_16.png") center no-repeat;
background: url("chrome://browser/skin/devtools/vview-delete.png");
background-size: cover;
width: 16px;
height: 16px;
}
@media (min-resolution: 2dppx) {
.variables-view-delete {
background-image: url("chrome://browser/skin/devtools/vview-delete@2x.png");
}
}
.variables-view-delete:hover {
background-position: 16px;
}
.variables-view-delete:active {
background-position: 32px;
}
.variable-or-property:focus > .title > .variables-view-delete {
background-position: 0px;
}
.variables-view-edit {
background: url("chrome://browser/skin/devtools/vview-edit.png");
background-size: cover;
width: 16px;
height: 16px;
cursor: pointer;
}
@media (min-resolution: 2dppx) {
.variables-view-edit {
background-image: url("chrome://browser/skin/devtools/vview-edit@2x.png");
}
}
.variables-view-edit:hover {
background-position: 16px;
}
.variables-view-edit:active {
background-position: 32px;
}
.variable-or-property:focus > .title > .variables-view-edit {
background-position: 0px;
}
.variables-view-open-inspector {
background: url("chrome://browser/skin/devtools/vview-open-inspector.png");
background-size: cover;
width: 16px;
height: 16px;
cursor: pointer;
}
@media (min-resolution: 2dppx) {
.variables-view-open-inspector {
background-image: url("chrome://browser/skin/devtools/vview-open-inspector@2x.png");
}
}
.variables-view-open-inspector:hover {
background-position: 16px;
}
.variables-view-open-inspector:active {
background-position: 32px;
}
.variable-or-property:focus > .title > .variables-view-open-inspector {
background-position: 0px;
}
/* Variables and properties input boxes */
.variable-or-property > .title > .separator + .element-value-input {
-moz-margin-start: -2px !important;
-moz-margin-end: 2px !important;

View File

@ -224,6 +224,10 @@ button[type="menu"] > .button-box > .button-menu-dropmarker {
}
}
.help-button > .button-box > .button-text {
display: none;
}
.spinbuttons-button {
-moz-margin-start: 10px !important;
-moz-margin-end: 2px !important;

View File

@ -313,9 +313,13 @@ browser.jar:
skin/classic/browser/devtools/close.png (../shared/devtools/images/close.png)
skin/classic/browser/devtools/close@2x.png (../shared/devtools/images/close@2x.png)
skin/classic/browser/devtools/vview-delete.png (../shared/devtools/images/vview-delete.png)
skin/classic/browser/devtools/vview-lock.png (../shared/devtools/images/vview-lock.png)
skin/classic/browser/devtools/vview-delete@2x.png (../shared/devtools/images/vview-delete@2x.png)
skin/classic/browser/devtools/vview-edit.png (../shared/devtools/images/vview-edit.png)
skin/classic/browser/devtools/vview-edit@2x.png (../shared/devtools/images/vview-edit@2x.png)
skin/classic/browser/devtools/vview-lock.png (../shared/devtools/images/vview-lock.png)
skin/classic/browser/devtools/vview-lock@2x.png (../shared/devtools/images/vview-lock@2x.png)
skin/classic/browser/devtools/vview-open-inspector.png (../shared/devtools/images/vview-open-inspector.png)
skin/classic/browser/devtools/vview-open-inspector@2x.png (../shared/devtools/images/vview-open-inspector@2x.png)
skin/classic/browser/devtools/undock@2x.png (../shared/devtools/images/undock@2x.png)
skin/classic/browser/devtools/font-inspector.css (../shared/devtools/font-inspector.css)
skin/classic/browser/devtools/computedview.css (devtools/computedview.css)
@ -678,9 +682,13 @@ browser.jar:
skin/classic/aero/browser/devtools/close.png (../shared/devtools/images/close.png)
skin/classic/aero/browser/devtools/close@2x.png (../shared/devtools/images/close@2x.png)
skin/classic/aero/browser/devtools/vview-delete.png (../shared/devtools/images/vview-delete.png)
skin/classic/aero/browser/devtools/vview-lock.png (../shared/devtools/images/vview-lock.png)
skin/classic/aero/browser/devtools/vview-delete@2x.png (../shared/devtools/images/vview-delete@2x.png)
skin/classic/aero/browser/devtools/vview-edit.png (../shared/devtools/images/vview-edit.png)
skin/classic/aero/browser/devtools/vview-edit@2x.png (../shared/devtools/images/vview-edit@2x.png)
skin/classic/aero/browser/devtools/vview-lock.png (../shared/devtools/images/vview-lock.png)
skin/classic/aero/browser/devtools/vview-lock@2x.png (../shared/devtools/images/vview-lock@2x.png)
skin/classic/aero/browser/devtools/vview-open-inspector.png (../shared/devtools/images/vview-open-inspector.png)
skin/classic/aero/browser/devtools/vview-open-inspector@2x.png (../shared/devtools/images/vview-open-inspector@2x.png)
skin/classic/aero/browser/devtools/undock@2x.png (../shared/devtools/images/undock@2x.png)
skin/classic/aero/browser/devtools/font-inspector.css (../shared/devtools/font-inspector.css)
skin/classic/aero/browser/devtools/computedview.css (devtools/computedview.css)

View File

@ -714,9 +714,10 @@ public:
* Returns the appropriate event argument names for the specified
* namespace and event name. Added because we need to switch between
* SVG's "evt" and the rest of the world's "event", and because onerror
* takes 3 args.
* on window takes 5 args.
*/
static void GetEventArgNames(int32_t aNameSpaceID, nsIAtom *aEventName,
bool aIsForWindow,
uint32_t *aArgCount, const char*** aArgNames);
/**

View File

@ -13,7 +13,7 @@
interface nsIVariant;
[scriptable, builtinclass, uuid(af7077ac-0f9f-44e1-815f-9b1a94618531)]
[builtinclass, uuid(af7077ac-0f9f-44e1-815f-9b1a94618531)]
interface nsIDOMDataChannel : nsIDOMEventTarget
{
readonly attribute DOMString label;

View File

@ -7,7 +7,7 @@
interface nsIDOMFile;
[scriptable, uuid(283aa7b2-da81-4c72-aea2-9797b440fe34)]
[uuid(283aa7b2-da81-4c72-aea2-9797b440fe34)]
interface nsIDOMFileList : nsISupports
{
readonly attribute unsigned long length;

View File

@ -8,7 +8,7 @@
interface nsIDOMEventListener;
interface nsIDOMBlob;
[scriptable, builtinclass, uuid(39ea2c73-7711-4cea-9f73-3166c24dfa69)]
[builtinclass, uuid(39ea2c73-7711-4cea-9f73-3166c24dfa69)]
interface nsIDOMFileReader : nsIDOMEventTarget
{
[implicit_jscontext]

View File

@ -7,7 +7,7 @@
interface nsIVariant;
[scriptable, uuid(256c9139-5a29-41e1-8698-f9f9aae7d6cf)]
[uuid(256c9139-5a29-41e1-8698-f9f9aae7d6cf)]
interface nsIDOMFormData : nsISupports
{
void append(in DOMString name, in nsIVariant value);

View File

@ -19,7 +19,7 @@ interface nsIScriptGlobalObject;
* parsing with the XMLHttpRequest interface, which can be used for
* asynchronous (callback-based) loading.
*/
[scriptable, uuid(5677f36e-1842-4c6f-a39c-2e5576ab8b40)]
[uuid(5677f36e-1842-4c6f-a39c-2e5576ab8b40)]
interface nsIDOMParser : nsISupports
{
/**

View File

@ -15,7 +15,7 @@ interface nsIDOMNode;
* or any DOM subtree.
*/
[scriptable, uuid(9fd4ba15-e67c-4c98-b52c-7715f62c9196)]
[uuid(9fd4ba15-e67c-4c98-b52c-7715f62c9196)]
interface nsIDOMSerializer : nsISupports
{
/**

View File

@ -105,6 +105,7 @@ struct ElementRegistrationOptions;
class Event;
class EventTarget;
class FrameRequestCallback;
class OverfillCallback;
class HTMLBodyElement;
struct LifecycleCallbackArgs;
class Link;

View File

@ -18,7 +18,7 @@ interface nsINode;
* @version 1.0
*/
[scriptable, builtinclass, uuid(e0a4d4b3-f34e-44bd-b1f2-4e3bde9b6915)]
[builtinclass, uuid(e0a4d4b3-f34e-44bd-b1f2-4e3bde9b6915)]
interface nsISelection : nsISupports
{
/**

View File

@ -16,12 +16,12 @@ interface nsIGlobalObject;
interface nsIInputStream;
interface nsIDOMBlob;
[scriptable, builtinclass, uuid(5ced7e7a-e2c3-4563-a57d-31b97ce64dc5)]
[builtinclass, uuid(5ced7e7a-e2c3-4563-a57d-31b97ce64dc5)]
interface nsIXMLHttpRequestEventTarget : nsIDOMEventTarget {
// event handler attributes
};
[scriptable, builtinclass, uuid(df3796fa-d98a-4185-9dda-d2f2b56a5d38)]
[builtinclass, uuid(df3796fa-d98a-4185-9dda-d2f2b56a5d38)]
interface nsIXMLHttpRequestUpload : nsIXMLHttpRequestEventTarget {
// for future use
};

View File

@ -2881,14 +2881,15 @@ nsContentUtils::IsExactSitePermDeny(nsIPrincipal* aPrincipal, const char* aType)
static const char *gEventNames[] = {"event"};
static const char *gSVGEventNames[] = {"evt"};
// for b/w compat, the first name to onerror is still 'event', even though it
// is actually the error message. (pre this code, the other 2 were not avail.)
// XXXmarkh - a quick lxr shows no affected code - should we correct this?
static const char *gOnErrorNames[] = {"event", "source", "lineno"};
// is actually the error message
static const char *gOnErrorNames[] = {"event", "source", "lineno",
"colno", "error"};
// static
void
nsContentUtils::GetEventArgNames(int32_t aNameSpaceID,
nsIAtom *aEventName,
bool aIsForWindow,
uint32_t *aArgCount,
const char*** aArgArray)
{
@ -2899,7 +2900,7 @@ nsContentUtils::GetEventArgNames(int32_t aNameSpaceID,
// JSEventHandler is what does the arg magic for onerror, and it does
// not seem to take the namespace into account. So we let onerror in all
// namespaces get the 3 arg names.
if (aEventName == nsGkAtoms::onerror) {
if (aEventName == nsGkAtoms::onerror && aIsForWindow) {
SET_EVENT_ARG_NAMES(gOnErrorNames);
} else if (aNameSpaceID == kNameSpaceID_SVG) {
SET_EVENT_ARG_NAMES(gSVGEventNames);

View File

@ -79,7 +79,7 @@ nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, nsString &aURI)
int32_t
nsXMLNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const
{
uint32_t index = mNameSpaces.IndexOf(aPrefix);
size_t index = mNameSpaces.IndexOf(aPrefix);
if (index != mNameSpaces.NoIndex) {
return mNameSpaces[index].nameSpaceID;
}
@ -93,7 +93,7 @@ nsXMLNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const
nsIAtom*
nsXMLNameSpaceMap::FindPrefix(int32_t aNameSpaceID) const
{
uint32_t index = mNameSpaces.IndexOf(aNameSpaceID);
size_t index = mNameSpaces.IndexOf(aNameSpaceID);
if (index != mNameSpaces.NoIndex) {
return mNameSpaces[index].prefix;
}

View File

@ -1390,7 +1390,7 @@ CanvasRenderingContext2D::SetStyleFromUnion(const StringOrCanvasGradientOrCanvas
return;
}
MOZ_ASSUME_UNREACHABLE("Invalid union value");
MOZ_ASSERT_UNREACHABLE("Invalid union value");
}
void

View File

@ -18,4 +18,4 @@ support-files =
skipped_tests_winxp.txt
[test_webgl_conformance_test_suite.html]
skip-if = (toolkit == 'android') || (buildapp == 'b2g') #android(bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests)
skip-if = (buildapp == 'b2g') # bug 865443- separate suite - the non_conf* tests pass except for one on armv6 tests

View File

@ -26,6 +26,7 @@ conformance/glsl/functions/glsl-function-smoothstep-float.html
conformance/glsl/functions/glsl-function-smoothstep-gentype.html
conformance/glsl/functions/glsl-function-step-float.html
conformance/glsl/functions/glsl-function-step-gentype.html
conformance/misc/uninitialized-test.html
conformance/more/conformance/quickCheckAPI-B2.html
conformance/programs/gl-getshadersource.html
conformance/reading/read-pixels-test.html

View File

@ -361,7 +361,8 @@ HTMLFormControlsCollection::GetFirstNamedElement(const nsAString& aName, bool& a
nsINodeList& nodelist = result.GetAsNodeList();
return nodelist.Item(0)->AsElement();
}
MOZ_ASSUME_UNREACHABLE("Should only have Elements and NodeLists here.");
MOZ_ASSERT_UNREACHABLE("Should only have Elements and NodeLists here.");
return nullptr;
}
void
@ -383,7 +384,7 @@ HTMLFormControlsCollection::NamedGetter(const nsAString& aName,
aResult.SetValue().SetAsNodeList() = nodelist;
return;
}
MOZ_ASSERT(false, "Should only have Elements and NodeLists here.");
MOZ_ASSERT_UNREACHABLE("Should only have Elements and NodeLists here.");
}
static PLDHashOperator

View File

@ -1252,7 +1252,7 @@ HTMLFormElement::RemoveElement(nsGenericHTMLFormElement* aChild,
// Find the index of the child. This will be used later if necessary
// to find the default submit.
uint32_t index = controls.IndexOf(aChild);
size_t index = controls.IndexOf(aChild);
NS_ENSURE_STATE(index != controls.NoIndex);
controls.RemoveElementAt(index);
@ -2339,7 +2339,7 @@ HTMLFormElement::AddImageElementToTable(HTMLImageElement* aChild,
nsresult
HTMLFormElement::RemoveImageElement(HTMLImageElement* aChild)
{
uint32_t index = mImageElements.IndexOf(aChild);
size_t index = mImageElements.IndexOf(aChild);
NS_ENSURE_STATE(index != mImageElements.NoIndex);
mImageElements.RemoveElementAt(index);

View File

@ -2518,7 +2518,7 @@ HTMLInputElement::GetDisplayFileName(nsAString& aValue) const
}
} else {
nsString count;
count.AppendInt(mFiles.Length());
count.AppendInt(int(mFiles.Length()));
const char16_t* params[] = { count.get() };
nsContentUtils::FormatLocalizedString(nsContentUtils::eFORMS_PROPERTIES,

View File

@ -1146,7 +1146,7 @@ HTMLContentSink::FlushTags()
NS_IMETHODIMP
HTMLContentSink::SetDocumentCharset(nsACString& aCharset)
{
MOZ_ASSUME_UNREACHABLE("<meta charset> case doesn't occur with about:blank");
MOZ_ASSERT_UNREACHABLE("<meta charset> case doesn't occur with about:blank");
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@ -31,14 +31,14 @@ AudioNodeExternalInputStream::TrackMapEntry::~TrackMapEntry()
}
}
uint32_t
size_t
AudioNodeExternalInputStream::GetTrackMapEntry(const StreamBuffer::Track& aTrack,
GraphTime aFrom)
{
AudioSegment* segment = aTrack.Get<AudioSegment>();
// Check the map for an existing entry corresponding to the input track.
for (uint32_t i = 0; i < mTrackMap.Length(); ++i) {
for (size_t i = 0; i < mTrackMap.Length(); ++i) {
TrackMapEntry* map = &mTrackMap[i];
if (map->mTrackID == aTrack.GetID()) {
return i;
@ -58,7 +58,7 @@ AudioNodeExternalInputStream::GetTrackMapEntry(const StreamBuffer::Track& aTrack
// Create a speex resampler with the same sample rate and number of channels
// as the track.
SpeexResamplerState* resampler = nullptr;
uint32_t channelCount = std::min((*ci).mChannelData.Length(),
size_t channelCount = std::min((*ci).mChannelData.Length(),
WebAudioUtils::MaxChannelCount);
if (aTrack.GetRate() != mSampleRate) {
resampler = speex_resampler_init(channelCount,
@ -340,7 +340,7 @@ AudioNodeExternalInputStream::ProcessInput(GraphTime aFrom, GraphTime aTo,
!tracks.IsEnded(); tracks.Next()) {
const StreamBuffer::Track& inputTrack = *tracks;
// Create a TrackMapEntry if necessary.
uint32_t trackMapIndex = GetTrackMapEntry(inputTrack, aFrom);
size_t trackMapIndex = GetTrackMapEntry(inputTrack, aFrom);
// Maybe there's nothing in this track yet. If so, ignore it. (While the
// track is only playing silence, we may not be able to determine the
// correct number of channels to start resampling.)

View File

@ -92,8 +92,8 @@ private:
* Creates a TrackMapEntry for the track, if needed. Returns the index
* of the TrackMapEntry or NoIndex if no entry is needed yet.
*/
uint32_t GetTrackMapEntry(const StreamBuffer::Track& aTrack,
GraphTime aFrom);
size_t GetTrackMapEntry(const StreamBuffer::Track& aTrack,
GraphTime aFrom);
};
}

View File

@ -29,8 +29,8 @@ EncodedBufferCache::AppendBuffer(nsTArray<uint8_t> & aBuf)
if (mTempFileEnabled) {
// has created temporary file, write buffer in it
for (uint32_t i = 0; i < mEncodedBuffers.Length(); i++) {
int64_t amount = PR_Write(mFD, mEncodedBuffers.ElementAt(i).Elements(), mEncodedBuffers.ElementAt(i).Length());
if (amount < mEncodedBuffers.ElementAt(i).Length()) {
int32_t amount = PR_Write(mFD, mEncodedBuffers.ElementAt(i).Elements(), mEncodedBuffers.ElementAt(i).Length());
if (amount < 0 || size_t(amount) < mEncodedBuffers.ElementAt(i).Length()) {
NS_WARNING("Failed to write media cache block!");
}
}

View File

@ -779,7 +779,7 @@ MediaCache::FindReusableBlock(TimeStamp aNow,
{
mReentrantMonitor.AssertCurrentThreadIn();
uint32_t length = std::min(uint32_t(aMaxSearchBlockIndex), mIndex.Length());
uint32_t length = std::min(uint32_t(aMaxSearchBlockIndex), uint32_t(mIndex.Length()));
if (aForStream && aForStreamBlock > 0 &&
uint32_t(aForStreamBlock) <= aForStream->mBlocks.Length()) {

View File

@ -144,7 +144,7 @@ private:
uint32_t end = std::min(GetAtOffset(aOffset + aCount, nullptr) + 1, GetSize());
for (uint32_t i = start; i < end; ++i) {
ResourceItem* item = ResourceAt(i);
uint32_t bytes = std::min(aCount, item->mData.Length() - offset);
uint32_t bytes = std::min(aCount, uint32_t(item->mData.Length() - offset));
if (bytes != 0) {
memcpy(aDest, &item->mData[offset], bytes);
offset = 0;

View File

@ -172,9 +172,9 @@ AnalyserNode::GetFloatFrequencyData(const Float32Array& aArray)
}
float* buffer = aArray.Data();
uint32_t length = std::min(aArray.Length(), mOutputBuffer.Length());
size_t length = std::min(size_t(aArray.Length()), mOutputBuffer.Length());
for (uint32_t i = 0; i < length; ++i) {
for (size_t i = 0; i < length; ++i) {
buffer[i] = WebAudioUtils::ConvertLinearToDecibels(mOutputBuffer[i], mMinDecibels);
}
}
@ -190,9 +190,9 @@ AnalyserNode::GetByteFrequencyData(const Uint8Array& aArray)
const double rangeScaleFactor = 1.0 / (mMaxDecibels - mMinDecibels);
unsigned char* buffer = aArray.Data();
uint32_t length = std::min(aArray.Length(), mOutputBuffer.Length());
size_t length = std::min(size_t(aArray.Length()), mOutputBuffer.Length());
for (uint32_t i = 0; i < length; ++i) {
for (size_t i = 0; i < length; ++i) {
const double decibels = WebAudioUtils::ConvertLinearToDecibels(mOutputBuffer[i], mMinDecibels);
// scale down the value to the range of [0, UCHAR_MAX]
const double scaled = std::max(0.0, std::min(double(UCHAR_MAX),
@ -205,9 +205,9 @@ void
AnalyserNode::GetFloatTimeDomainData(const Float32Array& aArray)
{
float* buffer = aArray.Data();
uint32_t length = std::min(aArray.Length(), mBuffer.Length());
size_t length = std::min(size_t(aArray.Length()), mBuffer.Length());
for (uint32_t i = 0; i < length; ++i) {
for (size_t i = 0; i < length; ++i) {
buffer[i] = mBuffer[(i + mWriteIndex) % mBuffer.Length()];;
}
}
@ -216,9 +216,9 @@ void
AnalyserNode::GetByteTimeDomainData(const Uint8Array& aArray)
{
unsigned char* buffer = aArray.Data();
uint32_t length = std::min(aArray.Length(), mBuffer.Length());
size_t length = std::min(size_t(aArray.Length()), mBuffer.Length());
for (uint32_t i = 0; i < length; ++i) {
for (size_t i = 0; i < length; ++i) {
const float value = mBuffer[(i + mWriteIndex) % mBuffer.Length()];
// scale the value to the range of [0, UCHAR_MAX]
const float scaled = std::max(0.0f, std::min(float(UCHAR_MAX),

View File

@ -109,10 +109,10 @@ AudioNode::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
}
template <class InputNode>
static uint32_t
static size_t
FindIndexOfNode(const nsTArray<InputNode>& aInputNodes, const AudioNode* aNode)
{
for (uint32_t i = 0; i < aInputNodes.Length(); ++i) {
for (size_t i = 0; i < aInputNodes.Length(); ++i) {
if (aInputNodes[i].mInputNode == aNode) {
return i;
}
@ -121,11 +121,11 @@ FindIndexOfNode(const nsTArray<InputNode>& aInputNodes, const AudioNode* aNode)
}
template <class InputNode>
static uint32_t
static size_t
FindIndexOfNodeWithPorts(const nsTArray<InputNode>& aInputNodes, const AudioNode* aNode,
uint32_t aInputPort, uint32_t aOutputPort)
{
for (uint32_t i = 0; i < aInputNodes.Length(); ++i) {
for (size_t i = 0; i < aInputNodes.Length(); ++i) {
if (aInputNodes[i].mInputNode == aNode &&
aInputNodes[i].mInputPort == aInputPort &&
aInputNodes[i].mOutputPort == aOutputPort) {
@ -147,27 +147,27 @@ AudioNode::DisconnectFromGraph()
// Disconnect inputs. We don't need them anymore.
while (!mInputNodes.IsEmpty()) {
uint32_t i = mInputNodes.Length() - 1;
size_t i = mInputNodes.Length() - 1;
nsRefPtr<AudioNode> input = mInputNodes[i].mInputNode;
mInputNodes.RemoveElementAt(i);
input->mOutputNodes.RemoveElement(this);
}
while (!mOutputNodes.IsEmpty()) {
uint32_t i = mOutputNodes.Length() - 1;
size_t i = mOutputNodes.Length() - 1;
nsRefPtr<AudioNode> output = mOutputNodes[i].forget();
mOutputNodes.RemoveElementAt(i);
uint32_t inputIndex = FindIndexOfNode(output->mInputNodes, this);
size_t inputIndex = FindIndexOfNode(output->mInputNodes, this);
// It doesn't matter which one we remove, since we're going to remove all
// entries for this node anyway.
output->mInputNodes.RemoveElementAt(inputIndex);
}
while (!mOutputParams.IsEmpty()) {
uint32_t i = mOutputParams.Length() - 1;
size_t i = mOutputParams.Length() - 1;
nsRefPtr<AudioParam> output = mOutputParams[i].forget();
mOutputParams.RemoveElementAt(i);
uint32_t inputIndex = FindIndexOfNode(output->InputNodes(), this);
size_t inputIndex = FindIndexOfNode(output->InputNodes(), this);
// It doesn't matter which one we remove, since we're going to remove all
// entries for this node anyway.
output->RemoveInputNode(inputIndex);

View File

@ -16,7 +16,7 @@ namespace dom {
// 32 is the minimum required by the spec and matches what is used by blink.
// The limit protects against large memory allocations.
const uint32_t WebAudioUtils::MaxChannelCount = 32;
const size_t WebAudioUtils::MaxChannelCount = 32;
struct ConvertTimeToTickHelper
{

View File

@ -25,7 +25,7 @@ namespace dom {
class AudioParamTimeline;
struct WebAudioUtils {
static const uint32_t MaxChannelCount;
static const size_t MaxChannelCount;
static bool FuzzyEqual(float v1, float v2)
{

View File

@ -14,7 +14,7 @@
interface SpeechRecognitionResultList;
[scriptable, builtinclass, uuid(98dded70-33af-42d5-819d-e15b6f4a3aba)]
[builtinclass, uuid(98dded70-33af-42d5-819d-e15b6f4a3aba)]
interface nsIDOMSpeechRecognitionEvent : nsIDOMEvent {
[noscript] void initSpeechRecognitionEvent(in DOMString eventTypeArg,
in boolean canBubbleArg,

View File

@ -12,7 +12,7 @@
#include "nsIDOMEvent.idl"
[scriptable, builtinclass, uuid(b5240841-dc69-43dd-bcf1-9306b8ddaa09)]
[uuid(b5240841-dc69-43dd-bcf1-9306b8ddaa09)]
interface nsIDOMSpeechSynthesisEvent : nsIDOMEvent {
[noscript] void initSpeechSynthesisEvent(in DOMString aEventTypeArg,
in boolean aCanBubbleArg,

View File

@ -1033,7 +1033,7 @@ XULDocument::AttributeChanged(nsIDocument* aDocument,
attrSet,
needsAttrChange);
uint32_t index =
size_t index =
mDelayedAttrChangeBroadcasts.IndexOf(delayedUpdate,
0, nsDelayedBroadcastUpdate::Comparator());
if (index != mDelayedAttrChangeBroadcasts.NoIndex) {

View File

@ -1042,11 +1042,11 @@ MainProcessRunnable::Run()
case eWaitingToOpenCacheFileForRead:
case eOpened:
case eFinished: {
MOZ_ASSUME_UNREACHABLE("Shouldn't Run() in this state");
MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Shouldn't Run() in this state");
}
}
MOZ_ASSUME_UNREACHABLE("Corrupt state");
MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Corrupt state");
return NS_OK;
}
@ -1511,11 +1511,11 @@ ChildProcessRunnable::Run()
case eOpening:
case eOpened:
case eFinished: {
MOZ_ASSUME_UNREACHABLE("Shouldn't Run() in this state");
MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Shouldn't Run() in this state");
}
}
MOZ_ASSUME_UNREACHABLE("Corrupt state");
MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Corrupt state");
return NS_OK;
}
@ -1824,13 +1824,13 @@ public:
WaitForStoragesToComplete(nsTArray<nsIOfflineStorage*>& aStorages,
nsIRunnable* aCallback) MOZ_OVERRIDE
{
MOZ_ASSUME_UNREACHABLE("There are no storages");
MOZ_ASSERT_UNREACHABLE("There are no storages");
}
virtual void
AbortTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE
{
MOZ_ASSUME_UNREACHABLE("There are no storages");
MOZ_ASSERT_UNREACHABLE("There are no storages");
}
virtual bool

View File

@ -750,9 +750,9 @@ AudioChannelService::Observe(nsISupports* aSubject, const char* aTopic, const ch
} else if (!keyStr.EqualsLiteral("audio.volume.bt_sco")) {
// bt_sco is not a valid audio channel so we manipulate it in
// AudioManager.cpp. And the others should not be used.
// We didn't use MOZ_ASSUME_UNREACHABLE here because any web content who
// has permission of mozSettings can set any names then it can be easy to
// crash the B2G.
// We didn't use MOZ_CRASH or MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE here
// because any web content who has permission of mozSettings can set any
// names then it can be easy to crash the B2G.
NS_WARNING("unexpected audio channel for volume control");
}
}

View File

@ -68,7 +68,7 @@ public:
return mStack[i];
}
}
MOZ_ASSUME_UNREACHABLE("Non-empty stack should always have an entry point");
MOZ_CRASH("Non-empty stack should always have an entry point");
}
nsIGlobalObject* EntryGlobal() {

View File

@ -2021,47 +2021,11 @@ DefineInterfaceConstants(JSContext *cx, JS::Handle<JSObject*> obj, const nsIID *
JS::Rooted<JS::Value> v(cx);
for (i = parent_constant_count; i < constant_count; i++) {
const nsXPTConstant *c = nullptr;
nsXPIDLCString name;
rv = if_info->GetConstant(i, &v, getter_Copies(name));
NS_ENSURE_TRUE(NS_SUCCEEDED(rv), rv);
rv = if_info->GetConstant(i, &c);
NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && c, rv);
uint16_t type = c->GetType().TagPart();
v.setUndefined();
switch (type) {
case nsXPTType::T_I8:
case nsXPTType::T_U8:
{
v.setInt32(c->GetValue()->val.u8);
break;
}
case nsXPTType::T_I16:
case nsXPTType::T_U16:
{
v.setInt32(c->GetValue()->val.u16);
break;
}
case nsXPTType::T_I32:
{
v = JS_NumberValue(c->GetValue()->val.i32);
break;
}
case nsXPTType::T_U32:
{
v = JS_NumberValue(c->GetValue()->val.u32);
break;
}
default:
{
#ifdef DEBUG
NS_ERROR("Non-numeric constant found in interface.");
#endif
continue;
}
}
if (!::JS_DefineProperty(cx, obj, c->GetName(), v,
if (!::JS_DefineProperty(cx, obj, name, v,
JSPROP_ENUMERATE | JSPROP_READONLY |
JSPROP_PERMANENT,
JS_PropertyStub, JS_StrictPropertyStub)) {

View File

@ -7061,6 +7061,22 @@ nsGlobalWindow::ScrollTo(const CSSIntPoint& aScroll)
}
}
void
nsGlobalWindow::MozRequestOverfill(OverfillCallback& aCallback,
mozilla::ErrorResult& aError)
{
nsIWidget* widget = nsContentUtils::WidgetForDocument(mDoc);
if (widget) {
mozilla::layers::LayerManager* manager = widget->GetLayerManager();
if (manager) {
manager->RequestOverfill(&aCallback);
return;
}
}
aError.Throw(NS_ERROR_NOT_AVAILABLE);
}
NS_IMETHODIMP
nsGlobalWindow::ScrollBy(int32_t aXScrollDif, int32_t aYScrollDif)
{
@ -8978,6 +8994,9 @@ nsGlobalWindow::ShowModalDialog(JSContext* aCx, const nsAString& aUrl,
aError = nsContentUtils::XPConnect()->JSToVariant(aCx,
aArgument,
getter_AddRefs(args));
if (aError.Failed()) {
return JS::UndefinedValue();
}
nsCOMPtr<nsIVariant> retVal = ShowModalDialog(aUrl, args, aOptions, aError);
if (aError.Failed()) {

View File

@ -910,6 +910,7 @@ public:
{
return GetScrollY(aError);
}
void MozRequestOverfill(mozilla::dom::OverfillCallback& aCallback, mozilla::ErrorResult& aError);
int32_t GetScreenX(mozilla::ErrorResult& aError);
void SetScreenX(int32_t aScreenX, mozilla::ErrorResult& aError);
int32_t GetScreenY(mozilla::ErrorResult& aError);

View File

@ -12,7 +12,7 @@ interface nsICursorContinueCallback : nsISupports
void handleContinue();
};
[scriptable, builtinclass, uuid(062ea35a-5158-425a-b7bc-3ae9daa84398)]
[builtinclass, uuid(062ea35a-5158-425a-b7bc-3ae9daa84398)]
interface nsIDOMDOMCursor : nsISupports
{
readonly attribute boolean done;

View File

@ -10,7 +10,7 @@ interface nsIDOMWindow;
interface nsIDOMDOMCursor;
interface nsICursorContinueCallback;
[scriptable, builtinclass, uuid(d4c7372a-661c-4798-9a13-af48128609e9)]
[builtinclass, uuid(d4c7372a-661c-4798-9a13-af48128609e9)]
interface nsIDOMDOMRequest : nsIDOMEventTarget
{
readonly attribute DOMString readyState; // "pending" or "done"

View File

@ -1824,7 +1824,7 @@ BluetoothHfpManager::OnUpdateSdpRecords(const nsAString& aDeviceAddress)
{
// UpdateSdpRecord() is not called so this callback function should not
// be invoked.
MOZ_ASSUME_UNREACHABLE("UpdateSdpRecords() should be called somewhere");
MOZ_ASSERT_UNREACHABLE("UpdateSdpRecords() should be called somewhere");
}
void

View File

@ -179,7 +179,7 @@ nsDOMCameraControl::nsDOMCameraControl(uint32_t aCameraId,
break;
default:
MOZ_ASSUME_UNREACHABLE("Unanticipated camera mode!");
MOZ_ASSERT_UNREACHABLE("Unanticipated camera mode!");
}
config.mPreviewSize.width = aInitialConfig.mPreviewSize.mWidth;
@ -1068,7 +1068,7 @@ nsDOMCameraControl::OnHardwareStateChange(CameraControlListener::HardwareState a
break;
default:
MOZ_ASSUME_UNREACHABLE("Unanticipated camera hardware state");
MOZ_ASSERT_UNREACHABLE("Unanticipated camera hardware state");
}
}
@ -1163,7 +1163,7 @@ nsDOMCameraControl::OnRecorderStateChange(CameraControlListener::RecorderState a
#endif
default:
MOZ_ASSUME_UNREACHABLE("Unanticipated video recorder error");
MOZ_ASSERT_UNREACHABLE("Unanticipated video recorder error");
return;
}
@ -1344,7 +1344,7 @@ nsDOMCameraControl::OnUserError(CameraControlListener::UserContext aContext, nsr
nsPrintfCString msg("Unhandled aContext=%u, aError=0x%x\n", aContext, aError);
NS_WARNING(msg.get());
}
MOZ_ASSUME_UNREACHABLE("Unhandled user error");
MOZ_ASSERT_UNREACHABLE("Unhandled user error");
return;
}

View File

@ -131,7 +131,7 @@ DOMCameraControlListener::OnPreviewStateChange(PreviewState aState)
default:
DOM_CAMERA_LOGE("Unknown preview state %d\n", aState);
MOZ_ASSUME_UNREACHABLE("Invalid preview state");
MOZ_ASSERT_UNREACHABLE("Invalid preview state");
return;
}
NS_DispatchToMainThread(new Callback(mDOMCameraControl, aState));

View File

@ -221,7 +221,9 @@ nsGonkCameraControl::SetConfigurationInternal(const Configuration& aConfig)
break;
default:
MOZ_ASSUME_UNREACHABLE("Unanticipated camera mode in SetConfigurationInternal()");
MOZ_ASSERT_UNREACHABLE("Unanticipated camera mode in SetConfigurationInternal()");
rv = NS_ERROR_FAILURE;
break;
}
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);

View File

@ -849,10 +849,11 @@ EventListenerManager::CompileEventHandlerInternal(Listener* aListener,
lineNo = 1;
}
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(mTarget);
uint32_t argCount;
const char **argNames;
nsContentUtils::GetEventArgNames(aElement->GetNameSpaceID(),
typeAtom,
typeAtom, win,
&argCount, &argNames);
// Wrap the event target, so that we can use it as the scope for the event
@ -902,7 +903,6 @@ EventListenerManager::CompileEventHandlerInternal(Listener* aListener,
NS_ENSURE_SUCCESS(result, result);
NS_ENSURE_TRUE(handler, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(mTarget);
if (jsEventHandler->EventName() == nsGkAtoms::onerror && win) {
nsRefPtr<OnErrorEventHandlerNonNull> handlerCallback =
new OnErrorEventHandlerNonNull(handler, /* aIncumbentGlobal = */ nullptr);

View File

@ -150,6 +150,7 @@ skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
[test_focus_disabled.html]
[test_messageEvent.html]
[test_moz_mouse_pixel_scroll_event.html]
[test_onerror_handler_args.html]
[test_wheel_default_action.html]
skip-if = buildapp == 'b2g' || e10s
[test_bug985988.html]

View File

@ -0,0 +1,36 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1007790
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1007790</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 1007790 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
is(frames[0].onerror.toString(),
"function onerror(event, source, lineno, colno, error) {\n\n}",
"Should have the right arguments for onerror on window");
is($("content").onerror.toString(),
"function onerror(event) {\n\n}",
"Should have the right arguments for onerror on element");
SimpleTest.finish();
});
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1007790">Mozilla Bug 1007790</a>
<p id="display"></p>
<div id="content" style="display: none" onerror="">
<iframe src="data:text/html,<body onerror=''>"></iframe>
</div>
<pre id="test">
</pre>
</body>
</html>

View File

@ -351,7 +351,7 @@ IDBCursor::ConvertDirection(mozilla::dom::IDBCursorDirection aDirection)
return PREV_UNIQUE;
default:
MOZ_ASSUME_UNREACHABLE("Unknown direction!");
MOZ_CRASH("Unknown direction!");
}
}
@ -492,7 +492,7 @@ IDBCursor::ContinueInternal(const Key& aKey, int32_t aCount, ErrorResult& aRv)
break;
default:
MOZ_ASSUME_UNREACHABLE("Unknown cursor type!");
MOZ_CRASH("Unknown cursor type!");
}
nsresult rv = helper->DispatchToTransactionPool();
@ -560,7 +560,7 @@ IDBCursor::WrapObject(JSContext* aCx)
return IDBCursorBinding::Wrap(aCx, this);
default:
MOZ_ASSUME_UNREACHABLE("Bad type!");
MOZ_CRASH("Bad type!");
}
}
@ -583,7 +583,7 @@ IDBCursor::GetDirection() const
return mozilla::dom::IDBCursorDirection::Prevunique;
default:
MOZ_ASSUME_UNREACHABLE("Bad direction!");
MOZ_CRASH("Bad direction!");
}
}
@ -606,7 +606,7 @@ IDBCursor::GetSource(OwningIDBObjectStoreOrIDBIndex& aSource) const
break;
default:
MOZ_ASSUME_UNREACHABLE("Bad type!");
MOZ_ASSERT_UNREACHABLE("Bad type!");
}
}
@ -724,7 +724,7 @@ IDBCursor::Continue(JSContext* aCx,
break;
default:
MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
MOZ_CRASH("Unknown direction type!");
}
}

View File

@ -4125,7 +4125,7 @@ OpenKeyCursorHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
break;
default:
MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
MOZ_CRASH("Unknown direction type!");
}
nsCString firstQuery = queryStart + keyRangeClause + directionClause +
@ -4197,7 +4197,7 @@ OpenKeyCursorHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
break;
default:
MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
MOZ_CRASH("Unknown direction type!");
}
mContinueQuery = queryStart + keyRangeClause + directionClause + openLimit;

View File

@ -258,7 +258,7 @@ TransactionThreadPool::FinishTransaction(IDBTransaction* aTransaction)
NS_ASSERTION(info, "We've never heard of this transaction?!?");
const nsTArray<nsString>& objectStoreNames = aTransaction->mObjectStoreNames;
for (uint32_t index = 0, count = objectStoreNames.Length(); index < count;
for (size_t index = 0, count = objectStoreNames.Length(); index < count;
index++) {
TransactionInfoPair* blockInfo =
dbTransactionInfo->blockingTransactions.Get(objectStoreNames[index]);
@ -269,7 +269,7 @@ TransactionThreadPool::FinishTransaction(IDBTransaction* aTransaction)
blockInfo->lastBlockingReads = nullptr;
}
uint32_t i = blockInfo->lastBlockingWrites.IndexOf(info);
size_t i = blockInfo->lastBlockingWrites.IndexOf(info);
if (i != blockInfo->lastBlockingWrites.NoIndex) {
blockInfo->lastBlockingWrites.RemoveElementAt(i);
}

View File

@ -6,7 +6,7 @@
interface mozIDOMApplication;
[scriptable, builtinclass, uuid(453ae38a-8d8d-465f-a718-3f01240f8f75)]
[builtinclass, uuid(453ae38a-8d8d-465f-a718-3f01240f8f75)]
interface nsIDOMMozApplicationEvent : nsIDOMEvent
{
readonly attribute mozIDOMApplication application;

View File

@ -5,7 +5,7 @@
#include "domstubs.idl"
[scriptable, uuid(B2F824C4-D9D3-499B-8D3B-45C8245497C6)]
[uuid(B2F824C4-D9D3-499B-8D3B-45C8245497C6)]
interface nsIDOMClientRect : nsISupports
{
readonly attribute float left;

View File

@ -5,7 +5,7 @@
#include "domstubs.idl"
[scriptable, uuid(f474c567-cbcb-458f-abad-ae42363da287)]
[uuid(f474c567-cbcb-458f-abad-ae42363da287)]
interface nsIDOMClientRectList : nsISupports
{
readonly attribute unsigned long length;

View File

@ -5,7 +5,7 @@
#include "domstubs.idl"
[scriptable, uuid(55226663-fe68-48ba-addf-08e32eaab569)]
[uuid(55226663-fe68-48ba-addf-08e32eaab569)]
interface nsIDOMHistory : nsISupports
{
// Empty interface that exists only for extension backwards compat

View File

@ -5,7 +5,7 @@
#include "nsIDOMEventTarget.idl"
[scriptable, builtinclass, uuid(e732649a-4f78-4ded-abe1-dbdc36fd59d3)]
[builtinclass, uuid(e732649a-4f78-4ded-abe1-dbdc36fd59d3)]
interface nsIDOMScreen : nsIDOMEventTarget
{
readonly attribute long top;

View File

@ -13,7 +13,7 @@
* be referenced directly via a canvas context 2d rather than this interface,
* and that should be preferred in new code.
*/
[scriptable, uuid(4417cab7-c7eb-4e0c-b00a-c43842f0cba8)]
[uuid(4417cab7-c7eb-4e0c-b00a-c43842f0cba8)]
interface nsIDOMCanvasRenderingContext2D : nsISupports
{
// Show the caret if appropriate when drawing

View File

@ -14,7 +14,7 @@
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
[scriptable, builtinclass, uuid(a974a4d3-2ff1-445b-8b8e-0aada5d4eedc)]
[builtinclass, uuid(a974a4d3-2ff1-445b-8b8e-0aada5d4eedc)]
interface nsIDOMAttr : nsIDOMNode
{
readonly attribute DOMString name;

View File

@ -15,7 +15,7 @@
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
[scriptable, uuid(0f401429-30b3-46de-b1bf-d7d5fa7563f9)]
[uuid(0f401429-30b3-46de-b1bf-d7d5fa7563f9)]
interface nsIDOMCDATASection : nsIDOMText
{
};

View File

@ -13,7 +13,7 @@
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
[scriptable, uuid(84f72a38-1873-46f8-937c-1df22d7e7cae)]
[uuid(84f72a38-1873-46f8-937c-1df22d7e7cae)]
interface nsIDOMCharacterData : nsIDOMNode
{
attribute DOMString data;

View File

@ -14,7 +14,7 @@
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
[scriptable, uuid(e702a5d2-3aa8-4788-b048-2d3b3e6d16f2)]
[uuid(e702a5d2-3aa8-4788-b048-2d3b3e6d16f2)]
interface nsIDOMComment : nsIDOMCharacterData
{
};

View File

@ -17,7 +17,7 @@
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#domexception
*/
[scriptable, uuid(5bd766d3-57a9-4833-995d-dbe21da29595)]
[uuid(5bd766d3-57a9-4833-995d-dbe21da29595)]
interface nsIDOMDOMException : nsISupports
{
const unsigned short INDEX_SIZE_ERR = 1;

View File

@ -32,7 +32,7 @@ interface nsIDOMLocation;
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
[scriptable, uuid(d24d1118-a527-4d5a-9c4e-fb07dfc2fc27)]
[uuid(d24d1118-a527-4d5a-9c4e-fb07dfc2fc27)]
interface nsIDOMDocument : nsIDOMNode
{
readonly attribute nsIDOMDocumentType doctype;

View File

@ -14,7 +14,7 @@
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
[scriptable, builtinclass, uuid(75a237af-133e-40f0-8196-2a172867c41a)]
[builtinclass, uuid(75a237af-133e-40f0-8196-2a172867c41a)]
interface nsIDOMDocumentFragment : nsIDOMNode
{
/**

View File

@ -15,7 +15,7 @@
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
[scriptable, uuid(aa7d28b2-7122-422d-8fcf-634771fb9ac1)]
[uuid(aa7d28b2-7122-422d-8fcf-634771fb9ac1)]
interface nsIDOMDocumentType : nsIDOMNode
{
readonly attribute DOMString name;

View File

@ -15,7 +15,7 @@ interface nsIDOMMozNamedAttrMap;
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-element
*/
[scriptable, uuid(989422ef-120d-4d29-8a56-6aa2505a8b02)]
[uuid(989422ef-120d-4d29-8a56-6aa2505a8b02)]
interface nsIDOMElement : nsIDOMNode
{
readonly attribute DOMString tagName;

View File

@ -10,7 +10,7 @@
* world where Attr no longer inherits from Node.
*/
[scriptable, uuid(cb5564cd-26ec-418f-a6d6-1d57cd2c971c)]
[uuid(cb5564cd-26ec-418f-a6d6-1d57cd2c971c)]
interface nsIDOMMozNamedAttrMap : nsISupports
{
nsIDOMAttr getNamedItem(in DOMString name);

View File

@ -17,7 +17,7 @@ interface nsIDOMUserDataHandler;
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
[scriptable, uuid(56545150-a001-484e-9ed4-cb319eebd7b3)]
[uuid(56545150-a001-484e-9ed4-cb319eebd7b3)]
interface nsIDOMNode : nsISupports
{
const unsigned short ELEMENT_NODE = 1;

View File

@ -15,6 +15,8 @@
* http://www.w3.org/TR/DOM-Level-2-Core/
*/
// NOTE: Please do not attempt to make this not scriptable,
// see https://bugzilla.mozilla.org/show_bug.cgi?id=994964#c73.
[scriptable, uuid(450cf0ba-de90-4f86-85bf-e10cc8b8713f)]
interface nsIDOMNodeList : nsISupports
{

View File

@ -15,7 +15,7 @@
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
[scriptable, uuid(91f2e856-5596-44d6-b396-0a02d8ec28c6)]
[uuid(91f2e856-5596-44d6-b396-0a02d8ec28c6)]
interface nsIDOMProcessingInstruction : nsIDOMCharacterData
{
readonly attribute DOMString target;

View File

@ -13,7 +13,7 @@
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
[scriptable, uuid(d14d13b4-21d5-49e2-8d59-76a24156db54)]
[uuid(d14d13b4-21d5-49e2-8d59-76a24156db54)]
interface nsIDOMText : nsIDOMCharacterData
{
nsIDOMText splitText(in unsigned long offset)

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