Merge m-c to inbound.

This commit is contained in:
Ryan VanderMeulen 2013-07-10 09:45:16 -04:00
commit d806e1e244
359 changed files with 2722 additions and 1780 deletions

View File

@ -1,4 +1,4 @@
{
"revision": "58d73404571f7619b478116dfec8faced97be13d",
"revision": "5e60cb6fc0e09cefe242a6fb0159fbd09360cc1a",
"repo_path": "/integration/gaia-central"
}

View File

@ -1084,6 +1084,9 @@ pref("devtools.debugger.ui.variables-searchbox-visible", false);
// Enable the Profiler
pref("devtools.profiler.enabled", true);
// The default Profiler UI settings
pref("devtools.profiler.ui.show-platform-data", false);
// Enable the Network Monitor
pref("devtools.netmonitor.enabled", true);
@ -1123,6 +1126,7 @@ pref("devtools.gcli.eagerHelper", 2);
// Remember the Web Console filters
pref("devtools.webconsole.filter.network", true);
pref("devtools.webconsole.filter.networkinfo", true);
pref("devtools.webconsole.filter.netwarn", true);
pref("devtools.webconsole.filter.csserror", true);
pref("devtools.webconsole.filter.cssparser", true);
pref("devtools.webconsole.filter.exception", true);
@ -1138,6 +1142,7 @@ pref("devtools.webconsole.filter.secwarn", true);
// Remember the Browser Console filters
pref("devtools.browserconsole.filter.network", true);
pref("devtools.browserconsole.filter.networkinfo", true);
pref("devtools.browserconsole.filter.netwarn", true);
pref("devtools.browserconsole.filter.csserror", true);
pref("devtools.browserconsole.filter.cssparser", true);
pref("devtools.browserconsole.filter.exception", true);

View File

@ -0,0 +1,17 @@
[
{
"clang_version": "r170890"
},
{
"filename": "setup.sh",
"algorithm": "sha512",
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"size": 47
},
{
"filename": "clang.tar.bz2",
"algorithm": "sha512",
"digest": "0bcfc19f05cc0f042befb3823c7ecce9ba411b152921aa29e97e7adc846e0258fd7da521b1620cb1e61a19d2fcac9b60e6d613c922b6c153e01b9b0766651d09",
"size": 62708281
}
]

View File

@ -0,0 +1,17 @@
[
{
"clang_version": "r170890"
},
{
"filename": "setup.sh",
"algorithm": "sha512",
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"size": 47
},
{
"filename": "clang.tar.bz2",
"algorithm": "sha512",
"digest": "e14ccefd965372a57c540647b2b99e21a4aa82f81a8b9a9e18dac7cba4c3436181bef0dfab8c51bcb5c343f504a693fdcfbe7d609f10291b5dd65ab059979d29",
"size": 63034761
}
]

View File

@ -0,0 +1,17 @@
[
{
"clang_version": "r170890"
},
{
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 56126352,
"digest": "e156e2a39abd5bf272ee30748a6825f22ddd27565b097c66662a2a6f2e9892bc5b4bf30a3552dffbe867dbfc39e7ee086e0b2cd7935f6ea216c0cf936178a88f",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
}
]

View File

@ -314,7 +314,8 @@ let DebuggerController = {
* away old scripts and get sources again.
*/
reconfigureThread: function(aUseSourceMaps) {
this.client.reconfigureThread(aUseSourceMaps, (aResponse) => {
this.client.reconfigureThread({ useSourceMaps: aUseSourceMaps },
(aResponse) => {
if (aResponse.error) {
let msg = "Couldn't reconfigure thread: " + aResponse.message;
Cu.reportError(msg);

View File

@ -98,6 +98,7 @@ MOCHITEST_BROWSER_TESTS = \
browser_dbg_bug883220_raise_on_pause.js \
browser_dbg_displayName.js \
browser_dbg_pause-exceptions.js \
browser_dbg_pause-exceptions-reload.js \
browser_dbg_multiple-windows.js \
browser_dbg_iframes.js \
browser_dbg_bfcache.js \
@ -144,6 +145,7 @@ MOCHITEST_BROWSER_PAGES = \
test-location-changes-bp.js \
test-location-changes-bp.html \
test-step-out.html \
test-pause-exceptions-reload.html \
$(NULL)
ifneq (Linux,$(OS_ARCH))

View File

@ -53,7 +53,7 @@ function testLocationChange()
});
});
});
content.location = STACK_URL;
gDebugger.DebuggerController.client.activeTab.navigateTo(STACK_URL);
});
}

View File

@ -293,7 +293,7 @@ function test()
});
finalCheck();
gDebuggee.location.reload();
gDebugger.DebuggerController.client.activeTab.reload();
}
function finalCheck() {

View File

@ -95,7 +95,7 @@ function testLocationChange()
closeDebuggerAndFinish();
});
});
content.location = "about:blank";
gDebugger.DebuggerController.client.activeTab.navigateTo("about:blank");
});
}

View File

@ -103,7 +103,7 @@ function testReloadPage()
clickAgain();
});
content.location.reload();
gDebugger.DebuggerController.client.activeTab.reload();
}
function clickAgain()

View File

@ -95,7 +95,8 @@ function testLocationChange()
closeDebuggerAndFinish();
});
});
content.location = EXAMPLE_URL + "browser_dbg_iframes.html";
let newLocation = EXAMPLE_URL + "browser_dbg_iframes.html";
gDebugger.DebuggerController.client.activeTab.navigateTo(newLocation);
});
}

View File

@ -56,7 +56,7 @@ function testLocationChange()
closeDebuggerAndFinish();
});
content.location = TAB1_URL;
gDebugger.DebuggerController.client.activeTab.navigateTo(TAB1_URL);
});
}

View File

@ -0,0 +1,122 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Make sure that pausing on exceptions works after reload.
*/
const TAB_URL = EXAMPLE_URL + "test-pause-exceptions-reload.html";
var gPane = null;
var gTab = null;
var gDebugger = null;
var gPrevPref = null;
function test()
{
gPrevPref = Services.prefs.getBoolPref(
"devtools.debugger.pause-on-exceptions");
Services.prefs.setBoolPref(
"devtools.debugger.pause-on-exceptions", true);
debug_tab_pane(TAB_URL, function(aTab, aDebuggee, aPane) {
gTab = aTab;
gPane = aPane;
gDebugger = gPane.panelWin;
gDebugger.DebuggerController.StackFrames.autoScopeExpand = true;
gDebugger.DebuggerView.Variables.nonEnumVisible = false;
testWithFrame();
});
}
function testWithFrame()
{
// Pause on exceptions should be already enabled.
is(gDebugger.Prefs.pauseOnExceptions, true,
"The pause-on-exceptions pref should be true from startup.");
is(gDebugger.DebuggerView.Options._pauseOnExceptionsItem.getAttribute("checked"), "true",
"Pause on exceptions should be enabled from startup. ")
let count = 0;
gPane.panelWin.gClient.addOneTimeListener("paused", function() {
gDebugger.addEventListener("Debugger:FetchedVariables", function testA() {
// We expect 2 Debugger:FetchedVariables events, one from the global object
// scope and the regular one.
if (++count < 2) {
is(count, 1, "A. First Debugger:FetchedVariables event received.");
return;
}
is(count, 2, "A. Second Debugger:FetchedVariables event received.");
gDebugger.removeEventListener("Debugger:FetchedVariables", testA, false);
is(gDebugger.DebuggerController.activeThread.state, "paused",
"Should be paused now.");
count = 0;
gPane.panelWin.gClient.addOneTimeListener("paused", function() {
gDebugger.addEventListener("Debugger:FetchedVariables", function testB() {
// We expect 2 Debugger:FetchedVariables events, one from the global object
// scope and the regular one.
if (++count < 2) {
is(count, 1, "B. First Debugger:FetchedVariables event received.");
return;
}
is(count, 2, "B. Second Debugger:FetchedVariables event received.");
gDebugger.removeEventListener("Debugger:FetchedVariables", testB, false);
Services.tm.currentThread.dispatch({ run: function() {
var frames = gDebugger.DebuggerView.StackFrames.widget._list,
scopes = gDebugger.DebuggerView.Variables._list,
innerScope = scopes.firstChild,
innerNodes = innerScope.querySelector(".variables-view-element-details").childNodes;
is(gDebugger.DebuggerController.activeThread.state, "paused",
"Should be paused again.");
is(frames.querySelectorAll(".dbg-stackframe").length, 2,
"Should have two frames.");
is(scopes.children.length, 2, "Should have 2 variable scopes.");
is(innerNodes[0].querySelector(".name").getAttribute("value"), "<exception>",
"Should have the right property name for the exception.");
is(innerNodes[0].querySelector(".value").getAttribute("value"), "Error",
"Should have the right property value for the exception.");
resumeAndFinish();
}}, 0);
}, false);
});
content.window.location.reload();
}, false);
});
content.window.location.reload();
}
function resumeAndFinish() {
// Disable pause on exceptions.
gDebugger.DebuggerView.Options._pauseOnExceptionsItem.setAttribute("checked", "false");
gDebugger.DebuggerView.Options._togglePauseOnExceptions();
is(gDebugger.Prefs.pauseOnExceptions, false,
"The pause-on-exceptions pref should have been set to false.");
gPane.panelWin.gClient.addOneTimeListener("resumed", function() {
Services.tm.currentThread.dispatch({ run: closeDebuggerAndFinish }, 0);
});
// Resume to let the exception reach it's catch clause.
gDebugger.DebuggerController.activeThread.resume();
}
registerCleanupFunction(function() {
removeTab(gTab);
gPane = null;
gTab = null;
gDebugger = null;
});

View File

@ -204,7 +204,7 @@ function test()
function reloadPage()
{
gDebuggee.location.reload();
gDebugger.DebuggerController.client.activeTab.reload();
}
registerCleanupFunction(function() {

View File

@ -127,7 +127,7 @@ function testLocationChange()
});
});
content.location = TAB1_URL;
gDebugger.DebuggerController.client.activeTab.navigateTo(TAB1_URL);
}
function clear() {

View File

@ -108,7 +108,7 @@ function performReload(callback) {
callback();
});
gDebuggee.location.reload();
gDebugger.DebuggerController.client.activeTab.reload();
}
function testStateBeforeReload() {

View File

@ -0,0 +1,27 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'/>
<title>Debugger Pause on Exceptions After Reload Test</title>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
</head>
<body>
<ul></ul>
</body>
<script type="text/javascript">
window.addEventListener("load", function() {
function load() {
try {
throw new Error("boom");
} catch (e) {
var list = document.querySelector("ul");
var item = document.createElement("li");
item.innerHTML = e.message;
list.appendChild(item);
}
}
load();
});
</script>
</html>

View File

@ -37,6 +37,12 @@
tooltiptext="&options.enablePersistentLogging.tooltip;"
data-pref="devtools.webconsole.persistlog"/>
</vbox>
<label value="&options.profiler.label;"/>
<vbox id="profiler-options" class="options-groupbox">
<checkbox label="&options.showPlatformData.label;"
tooltiptext="&options.showPlatformData.tooltip;"
data-pref="devtools.profiler.ui.show-platform-data"/>
</vbox>
<label value="&options.context.advancedSettings;"/>
<vbox id="context-options" class="options-groupbox">
<hbox>

View File

@ -18,7 +18,7 @@
<div id="root"></div>
<div id="templates" style="display:none">
<ul>
<li id="template-container" save="${elt}" class="container"><span save="${expander}" class="theme-twisty expander"></span><span save="${codeBox}" class="codebox"><ul save="${children}" class="children"></ul></span></li>
<li id="template-container" save="${elt}" class="container"><span save="${codeBox}" class="codebox"><span save="${expander}" class="theme-twisty expander"></span><ul save="${children}" class="children"></ul></span></li>
<li id="template-more-nodes" class="more-nodes devtools-class-comment" save="${elt}"><span>${showing}</span> <button href="#" onclick="${allButtonClick}">${showAll}</button></li>
</ul>

View File

@ -18,13 +18,14 @@ XPCOMUtils.defineLazyModuleGetter(this, "Promise",
this.NetMonitorPanel = function NetMonitorPanel(iframeWindow, toolbox) {
this.panelWin = iframeWindow;
this._toolbox = toolbox;
this._destroyer = null;
this._view = this.panelWin.NetMonitorView;
this._controller = this.panelWin.NetMonitorController;
this._controller._target = this.target;
EventEmitter.decorate(this);
}
};
NetMonitorPanel.prototype = {
/**
@ -53,14 +54,22 @@ NetMonitorPanel.prototype = {
})
.then(null, function onError(aReason) {
Cu.reportError("NetMonitorPanel open failed. " +
reason.error + ": " + reason.message);
aReason.error + ": " + aReason.message);
});
},
// DevToolPanel API
get target() this._toolbox.target,
destroy: function() {
this._controller.shutdownNetMonitor().then(() => this.emit("destroyed"));
// Make sure this panel is not already destroyed.
if (this._destroyer) {
return this._destroyer;
}
return this._destroyer = this._controller.shutdownNetMonitor().then(() => {
this.emit("destroyed");
});
}
};

View File

@ -37,19 +37,14 @@ let NetMonitorController = {
* A promise that is resolved when the monitor finishes startup.
*/
startupNetMonitor: function() {
if (this._isInitialized) {
return this._startup.promise;
if (this._startup) {
return this._startup;
}
this._isInitialized = true;
let deferred = this._startup = Promise.defer();
NetMonitorView.initialize();
NetMonitorView.initialize(() => {
NetMonitorView._isInitialized = true;
deferred.resolve();
});
return deferred.promise;
// Startup is synchronous, for now.
return this._startup = Promise.resolve();
},
/**
@ -59,24 +54,17 @@ let NetMonitorController = {
* A promise that is resolved when the monitor finishes shutdown.
*/
shutdownNetMonitor: function() {
if (this._isDestroyed) {
return this._shutdown.promise;
if (this._shutdown) {
return this._shutdown;
}
this._isDestroyed = true;
this._startup = null;
let deferred = this._shutdown = Promise.defer();
NetMonitorView.destroy();
this.TargetEventsHandler.disconnect();
this.NetworkEventsHandler.disconnect();
this.disconnect();
NetMonitorView.destroy(() => {
NetMonitorView._isDestroyed = true;
this.TargetEventsHandler.disconnect();
this.NetworkEventsHandler.disconnect();
this.disconnect();
deferred.resolve();
});
return deferred.promise;
// Shutdown is synchronous, for now.
return this._shutdown = Promise.resolve();
},
/**
@ -88,10 +76,11 @@ let NetMonitorController = {
*/
connect: function() {
if (this._connection) {
return this._connection.promise;
return this._connection;
}
let deferred = this._connection = Promise.defer();
let deferred = Promise.defer();
this._connection = deferred.promise;
let target = this._target;
let { client, form } = target;
@ -192,8 +181,6 @@ let NetMonitorController = {
});
},
_isInitialized: false,
_isDestroyed: false,
_startup: null,
_shutdown: null,
_connection: null,
@ -505,7 +492,7 @@ NetworkEventsHandler.prototype = {
let { actor, initial, length } = aStringGrip;
let longStringClient = this.webConsoleClient.longString(aStringGrip);
longStringClient.substring(initial.length, length, (aResponse) => {
longStringClient.substring(initial.length, length, aResponse => {
if (aResponse.error) {
Cu.reportError(aResponse.error + ": " + aResponse.message);
deferred.reject(aResponse);

View File

@ -64,38 +64,24 @@ const GENERIC_VARIABLES_VIEW_SETTINGS = {
let NetMonitorView = {
/**
* Initializes the network monitor view.
*
* @param function aCallback
* Called after the view finishes initializing.
*/
initialize: function(aCallback) {
dumpn("Initializing the NetMonitorView");
initialize: function() {
this._initializePanes();
this.Toolbar.initialize();
this.RequestsMenu.initialize();
this.NetworkDetails.initialize();
aCallback();
},
/**
* Destroys the network monitor view.
*
* @param function aCallback
* Called after the view finishes destroying.
*/
destroy: function(aCallback) {
dumpn("Destroying the NetMonitorView");
destroy: function() {
this.Toolbar.destroy();
this.RequestsMenu.destroy();
this.NetworkDetails.destroy();
this._destroyPanes();
aCallback();
},
/**
@ -199,9 +185,7 @@ let NetMonitorView = {
_detailsPaneToggleButton: null,
_collapsePaneString: "",
_expandPaneString: "",
_editorPromises: new Map(),
_isInitialized: false,
_isDestroyed: false
_editorPromises: new Map()
};
/**
@ -392,8 +376,8 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
data.body = selected.requestPostData.postData.text;
}
NetMonitorController.webConsoleClient.sendHTTPRequest(data, (response) => {
let id = response.eventActor.actor;
NetMonitorController.webConsoleClient.sendHTTPRequest(data, aResponse => {
let id = aResponse.eventActor.actor;
this._preferredItemId = id;
});
@ -1383,7 +1367,7 @@ CustomRequestView.prototype = {
if (aData.requestPostData) {
let body = aData.requestPostData.postData.text;
gNetwork.getString(body).then((aString) => {
gNetwork.getString(body).then(aString => {
$("#custom-postdata-value").value = aString;
});
}
@ -1678,7 +1662,7 @@ NetworkDetailsView.prototype = {
for (let header of aResponse.headers) {
let headerVar = headersScope.addItem(header.name, {}, true);
gNetwork.getString(header.value).then((aString) => headerVar.setGrip(aString));
gNetwork.getString(header.value).then(aString => headerVar.setGrip(aString));
}
},
@ -1721,7 +1705,7 @@ NetworkDetailsView.prototype = {
for (let cookie of aResponse.cookies) {
let cookieVar = cookiesScope.addItem(cookie.name, {}, true);
gNetwork.getString(cookie.value).then((aString) => cookieVar.setGrip(aString));
gNetwork.getString(cookie.value).then(aString => cookieVar.setGrip(aString));
// By default the cookie name and value are shown. If this is the only
// information available, then nothing else is to be displayed.
@ -1733,7 +1717,7 @@ NetworkDetailsView.prototype = {
// Display any other information other than the cookie name and value
// which may be available.
let rawObject = Object.create(null);
let otherProps = cookieProps.filter((e) => e != "name" && e != "value");
let otherProps = cookieProps.filter(e => e != "name" && e != "value");
for (let prop of otherProps) {
rawObject[prop] = cookie[prop];
}
@ -1768,7 +1752,7 @@ NetworkDetailsView.prototype = {
if (!aHeadersResponse || !aPostDataResponse) {
return;
}
gNetwork.getString(aPostDataResponse.postData.text).then((aString) => {
gNetwork.getString(aPostDataResponse.postData.text).then(aString => {
// Handle query strings (poor man's forms, e.g. "?foo=bar&baz=42").
let cType = aHeadersResponse.headers.filter(({ name }) => name == "Content-Type")[0];
let cString = cType ? cType.value : "";
@ -1790,7 +1774,7 @@ NetworkDetailsView.prototype = {
paramsScope.locked = true;
$("#request-post-data-textarea-box").hidden = false;
NetMonitorView.editor("#request-post-data-textarea").then((aEditor) => {
NetMonitorView.editor("#request-post-data-textarea").then(aEditor => {
aEditor.setText(aString);
});
}
@ -1834,7 +1818,7 @@ NetworkDetailsView.prototype = {
}
let { mimeType, text, encoding } = aResponse.content;
gNetwork.getString(text).then((aString) => {
gNetwork.getString(text).then(aString => {
// Handle json.
if (mimeType.contains("/json")) {
let jsonpRegex = /^[a-zA-Z0-9_$]+\(|\)$/g; // JSONP with callback.
@ -1864,7 +1848,7 @@ NetworkDetailsView.prototype = {
// Malformed JSON.
else {
$("#response-content-textarea-box").hidden = false;
NetMonitorView.editor("#response-content-textarea").then((aEditor) => {
NetMonitorView.editor("#response-content-textarea").then(aEditor => {
aEditor.setMode(SourceEditor.MODES.JAVASCRIPT);
aEditor.setText(aString);
});
@ -1889,7 +1873,7 @@ NetworkDetailsView.prototype = {
$("#response-content-image-encoding-value").setAttribute("value", encoding);
// Wait for the image to load in order to display the width and height.
$("#response-content-image").onload = (e) => {
$("#response-content-image").onload = e => {
// XUL images are majestic so they don't bother storing their dimensions
// in width and height attributes like the rest of the folk. Hack around
// this by getting the bounding client rect and subtracting the margins.
@ -1901,7 +1885,7 @@ NetworkDetailsView.prototype = {
// Handle anything else.
else {
$("#response-content-textarea-box").hidden = false;
NetMonitorView.editor("#response-content-textarea").then((aEditor) => {
NetMonitorView.editor("#response-content-textarea").then(aEditor => {
aEditor.setMode(SourceEditor.MODES.TEXT);
aEditor.setText(aString);
@ -2036,7 +2020,7 @@ function parseQueryString(aQueryString) {
return;
}
// Turn the params string into an array containing { name: value } tuples.
let paramsArray = aQueryString.replace(/^[?&]/, "").split("&").map((e) =>
let paramsArray = aQueryString.replace(/^[?&]/, "").split("&").map(e =>
let (param = e.split("=")) {
name: NetworkHelper.convertToUnicode(unescape(param[0])),
value: NetworkHelper.convertToUnicode(unescape(param[1]))

View File

@ -19,12 +19,9 @@ function test() {
ok(aMonitor._view,
"The network monitor view object exists (" + aTag + ").");
ok(aMonitor._view._isInitialized,
"The network monitor view object exists and is initialized (" + aTag + ").");
ok(aMonitor._controller,
"The network monitor controller object exists (" + aTag + ").");
ok(aMonitor._controller._isInitialized,
ok(aMonitor._controller._startup,
"The network monitor controller object exists and is initialized (" + aTag + ").");
ok(aMonitor.isReady,
@ -41,6 +38,13 @@ function test() {
function checkIfDestroyed(aTag) {
info("Checking if destruction is ok.");
ok(aMonitor._view,
"The network monitor view object still exists (" + aTag + ").");
ok(aMonitor._controller,
"The network monitor controller object still exists (" + aTag + ").");
ok(aMonitor._controller._shutdown,
"The network monitor controller object still exists and is destroyed (" + aTag + ").");
ok(!aMonitor._controller.client,
"There shouldn't be a client available after destruction (" + aTag + ").");
ok(!aMonitor._controller.tabClient,

View File

@ -23,9 +23,10 @@ const { PROFILE_IDLE, PROFILE_COMPLETED, PROFILE_RUNNING } = require("devtools/p
* @param ProfilerPanel panel
* A reference to the container panel.
*/
function Cleopatra(uid, name, panel) {
function Cleopatra(panel, opts) {
let doc = panel.document;
let win = panel.window;
let { uid, name, showPlatformData } = opts;
EventEmitter.decorate(this);
@ -40,7 +41,7 @@ function Cleopatra(uid, name, panel) {
this.iframe = doc.createElement("iframe");
this.iframe.setAttribute("flex", "1");
this.iframe.setAttribute("id", "profiler-cleo-" + uid);
this.iframe.setAttribute("src", "cleopatra.html?" + uid);
this.iframe.setAttribute("src", "cleopatra.html?uid=" + uid + "&showPlatformData=" + showPlatformData);
this.iframe.setAttribute("hidden", "true");
// Append our iframe and subscribe to postMessage events.

View File

@ -3,6 +3,22 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gInstanceUID;
var gParsedQS;
function getParam(key) {
if (gParsedQS)
return gParsedQS[key];
var query = window.location.search.substring(1);
gParsedQS = {};
query.split("&").forEach(function (pair) {
pair = pair.split("=");
gParsedQS[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
});
return gParsedQS[key];
}
/**
* Sends a message to the parent window with a status
@ -17,7 +33,7 @@ var gInstanceUID;
*/
function notifyParent(status, data={}) {
if (!gInstanceUID) {
gInstanceUID = window.location.search.substr(1);
gInstanceUID = getParam("uid");
}
window.parent.postMessage({
@ -208,7 +224,8 @@ function enterFinishedProfileUI() {
}
}
toggleJavascriptOnly();
if (getParam("showPlatformData") !== "true")
toggleJavascriptOnly();
}
function enterProgressUI() {

View File

@ -5,9 +5,12 @@
"use strict";
module.exports = {
L10N_BUNDLE: "chrome://browser/locale/devtools/profiler.properties",
PROFILER_ENABLED: "devtools.profiler.enabled",
PROFILE_IDLE: 0,
PROFILE_RUNNING: 1,
PROFILE_COMPLETED: 2
L10N_BUNDLE: "chrome://browser/locale/devtools/profiler.properties",
PROFILER_ENABLED: "devtools.profiler.enabled",
SHOW_PLATFORM_DATA: "devtools.profiler.ui.show-platform-data",
PROFILE_IDLE: 0,
PROFILE_RUNNING: 1,
PROFILE_COMPLETED: 2
};

View File

@ -5,7 +5,12 @@
"use strict";
const { Cu } = require("chrome");
const { PROFILE_IDLE, PROFILE_RUNNING, PROFILE_COMPLETED } = require("devtools/profiler/consts");
const {
PROFILE_IDLE,
PROFILE_RUNNING,
PROFILE_COMPLETED,
SHOW_PLATFORM_DATA
} = require("devtools/profiler/consts");
var EventEmitter = require("devtools/shared/event-emitter");
var Promise = require("sdk/core/promise");
@ -15,7 +20,7 @@ var ProfilerController = require("devtools/profiler/controller");
Cu.import("resource:///modules/devtools/gDevTools.jsm");
Cu.import("resource://gre/modules/devtools/Console.jsm");
Cu.import("resource://gre/modules/Services.jsm")
Cu.import("resource://gre/modules/Services.jsm");
/**
* Profiler panel. It is responsible for creating and managing
@ -123,6 +128,14 @@ ProfilerPanel.prototype = {
return this._browserWin = win;
},
get showPlatformData() {
return Services.prefs.getBoolPref(SHOW_PLATFORM_DATA);
},
set showPlatformData(enabled) {
Services.prefs.setBoolPref(SHOW_PLATFORM_DATA, enabled);
},
/**
* Open a debug connection and, on success, switch to the newly created
* profile.
@ -139,8 +152,8 @@ ProfilerPanel.prototype = {
let deferred = Promise.defer();
this.controller = new ProfilerController(this.target);
this.sidebar = new Sidebar(this.document.querySelector("#profiles-list"));
this.sidebar = new Sidebar(this.document.querySelector("#profiles-list"));
this.sidebar.widget.addEventListener("select", (ev) => {
if (!ev.detail)
return;
@ -223,7 +236,11 @@ ProfilerPanel.prototype = {
let uid = ++this._uid;
let name = name || this.controller.getProfileName();
let profile = new Cleopatra(uid, name, this);
let profile = new Cleopatra(this, {
uid: uid,
name: name,
showPlatformData: this.showPlatformData
});
this.profiles.set(uid, profile);
this.sidebar.addProfile(profile);

View File

@ -22,6 +22,7 @@ MOCHITEST_BROWSER_TESTS = \
browser_profiler_console_api_mixed.js \
browser_profiler_console_api_content.js \
browser_profiler_escape.js \
browser_profiler_gecko_data.js \
head.js \
$(NULL)

View File

@ -0,0 +1,52 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const URL = "data:text/html;charset=utf8,<p>JavaScript Profiler test</p>";
let gTab, gPanel;
function test() {
waitForExplicitFinish();
setUp(URL, function onSetUp(tab, browser, panel) {
gTab = tab;
gPanel = panel;
function done() {
tearDown(gTab, () => { gPanel = null; gTab = null; });
}
Services.prefs.setBoolPref(SHOW_PLATFORM_DATA, false);
recordProfile()
.then(toggleGeckoDataOption)
.then(recordProfile)
.then(done);
});
}
function recordProfile() {
let deferred = Promise.defer();
let record = gPanel.controls.record;
gPanel.once("started", () => {
gPanel.once("parsed", () => {
// We cannot be sure which data is returned by
// the profiler within a test. Until we get rid
// of Cleopatra, at least.
deferred.resolve();
});
record.click();
});
record.click();
return deferred.promise;
}
function toggleGeckoDataOption() {
ok(!gPanel.showPlatformData, "showPlatformData is not set");
Services.prefs.setBoolPref(SHOW_PLATFORM_DATA, true);
ok(gPanel.showPlatformData, "showPlatformData is set");
}

View File

@ -5,6 +5,7 @@ let temp = {};
const PROFILER_ENABLED = "devtools.profiler.enabled";
const REMOTE_ENABLED = "devtools.debugger.remote-enabled";
const SHOW_PLATFORM_DATA = "devtools.profiler.ui.show-platform-data";
const PROFILE_IDLE = 0;
const PROFILE_RUNNING = 1;
const PROFILE_COMPLETED = 2;
@ -29,6 +30,7 @@ registerCleanupFunction(function () {
helpers = null;
Services.prefs.clearUserPref(PROFILER_ENABLED);
Services.prefs.clearUserPref(REMOTE_ENABLED);
Services.prefs.clearUserPref(SHOW_PLATFORM_DATA);
DebuggerServer.destroy();
});

View File

@ -132,11 +132,17 @@ function test() {
function restart() {
info("XXX BUG 851296: restarting.");
mgr.once("on", function() {executeSoon(onUIOpen2)});
info("XXX BUG 851296: __responsiveUI: " + gBrowser.selectedTab.__responsiveUI);
mgr.once("on", function() {
info("XXX BUG 851296: 'on' received.");
executeSoon(onUIOpen2);
});
synthesizeKeyFromKeyTag("key_responsiveUI");
info("XXX BUG 851296: restart() finished.");
}
function onUIOpen2() {
info("XXX BUG 851296: onUIOpen2.");
let container = gBrowser.getBrowserContainer();
is(container.getAttribute("responsivemode"), "true", "In responsive mode.");
@ -183,6 +189,8 @@ function test() {
accelKey: modifiersAttr.match("accel")
}
info("XXX BUG 851296: key name: " + name);
info("XXX BUG 851296: key modifiers: " + JSON.stringify(modifiers));
EventUtils.synthesizeKey(name, modifiers);
}
}

View File

@ -12,25 +12,31 @@ relativesrcdir = @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
MOCHITEST_BROWSER_FILES = \
browser_telemetry_toolboxtabs.js \
browser_telemetry_buttonsandsidebar.js \
browser_require_basic.js \
browser_templater_basic.js \
browser_toolbar_basic.js \
browser_toolbar_tooltip.js \
browser_toolbar_webconsole_errors_count.js \
browser_layoutHelpers.js \
browser_eventemitter_basic.js \
head.js \
leakhunt.js \
$(NULL)
browser_eventemitter_basic.js \
browser_layoutHelpers.js \
browser_require_basic.js \
browser_telemetry_buttonsandsidebar.js \
browser_telemetry_toolboxtabs_inspector.js \
browser_telemetry_toolboxtabs_jsdebugger.js \
browser_telemetry_toolboxtabs_jsprofiler.js \
browser_telemetry_toolboxtabs_netmonitor.js \
browser_telemetry_toolboxtabs_options.js \
browser_telemetry_toolboxtabs_styleeditor.js \
browser_telemetry_toolboxtabs_webconsole.js \
browser_templater_basic.js \
browser_toolbar_basic.js \
browser_toolbar_tooltip.js \
browser_toolbar_webconsole_errors_count.js \
head.js \
leakhunt.js \
$(NULL)
MOCHITEST_BROWSER_FILES += \
browser_templater_basic.html \
browser_toolbar_basic.html \
browser_toolbar_webconsole_errors_count.html \
browser_layoutHelpers.html \
browser_layoutHelpers_iframe.html \
$(NULL)
browser_templater_basic.html \
browser_toolbar_basic.html \
browser_toolbar_webconsole_errors_count.html \
browser_layoutHelpers.html \
browser_layoutHelpers_iframe.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs.js</p>";
const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_inspector.js</p>";
// Because we need to gather stats for the period of time that a tool has been
// opened we make use of setTimeout() to create tool active times.
@ -13,9 +13,6 @@ let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
let Telemetry = require("devtools/shared/telemetry");
let tabsToTest = ["inspector", "options", "webconsole", "jsdebugger",
"styleeditor", "jsprofiler", "netmonitor"];
function init() {
Telemetry.prototype.telemetryInfo = {};
Telemetry.prototype._oldlog = Telemetry.prototype.log;
@ -29,15 +26,7 @@ function init() {
}
}
testNextTool();
}
function testNextTool() {
let nextTool = tabsToTest.pop();
if (nextTool) {
openToolboxTabTwice(nextTool);
}
openToolboxTabTwice("inspector", false);
}
function openToolboxTabTwice(id, secondPass) {
@ -48,11 +37,7 @@ function openToolboxTabTwice(id, secondPass) {
toolbox.once("destroyed", function() {
if (secondPass) {
if (tabsToTest.length > 0) {
testNextTool();
} else {
checkResults();
}
checkResults();
} else {
openToolboxTabTwice(id, true);
}
@ -108,7 +93,7 @@ function finishUp() {
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype.telemetryInfo;
TargetFactory = tabsToTest = Services = Promise = require = null;
TargetFactory = Services = Promise = require = null;
finish();
}

View File

@ -0,0 +1,110 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_jsdebugger.js</p>";
// Because we need to gather stats for the period of time that a tool has been
// opened we make use of setTimeout() to create tool active times.
const TOOL_DELAY = 200;
let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
let Telemetry = require("devtools/shared/telemetry");
function init() {
Telemetry.prototype.telemetryInfo = {};
Telemetry.prototype._oldlog = Telemetry.prototype.log;
Telemetry.prototype.log = function(histogramId, value) {
if (histogramId) {
if (!this.telemetryInfo[histogramId]) {
this.telemetryInfo[histogramId] = [];
}
this.telemetryInfo[histogramId].push(value);
}
}
openToolboxTabTwice("jsdebugger", false);
}
function openToolboxTabTwice(id, secondPass) {
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, id).then(function(toolbox) {
info("Toolbox tab " + id + " opened");
toolbox.once("destroyed", function() {
if (secondPass) {
checkResults();
} else {
openToolboxTabTwice(id, true);
}
});
// We use a timeout to check the tools active time
setTimeout(function() {
gDevTools.closeToolbox(target);
}, TOOL_DELAY);
}).then(null, reportError);
}
function checkResults() {
let result = Telemetry.prototype.telemetryInfo;
for (let [histId, value] of Iterator(result)) {
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
ok(value.length === 1 && value[0] === true,
"Per user value " + histId + " has a single value of true");
} else if (histId.endsWith("OPENED_BOOLEAN")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element === true;
});
ok(okay, "All " + histId + " entries are === true");
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element > 0;
});
ok(okay, "All " + histId + " entries have time > 0");
}
}
finishUp();
}
function reportError(error) {
let stack = " " + error.stack.replace(/\n?.*?@/g, "\n JS frame :: ");
ok(false, "ERROR: " + error + " at " + error.fileName + ":" +
error.lineNumber + "\n\nStack trace:" + stack);
finishUp();
}
function finishUp() {
gBrowser.removeCurrentTab();
Telemetry.prototype.log = Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype.telemetryInfo;
TargetFactory = Services = Promise = require = null;
finish();
}
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
waitForFocus(init, content);
}, true);
content.location = TEST_URI;
}

View File

@ -0,0 +1,110 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_jsprofiler.js</p>";
// Because we need to gather stats for the period of time that a tool has been
// opened we make use of setTimeout() to create tool active times.
const TOOL_DELAY = 200;
let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
let Telemetry = require("devtools/shared/telemetry");
function init() {
Telemetry.prototype.telemetryInfo = {};
Telemetry.prototype._oldlog = Telemetry.prototype.log;
Telemetry.prototype.log = function(histogramId, value) {
if (histogramId) {
if (!this.telemetryInfo[histogramId]) {
this.telemetryInfo[histogramId] = [];
}
this.telemetryInfo[histogramId].push(value);
}
}
openToolboxTabTwice("jsprofiler", false);
}
function openToolboxTabTwice(id, secondPass) {
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, id).then(function(toolbox) {
info("Toolbox tab " + id + " opened");
toolbox.once("destroyed", function() {
if (secondPass) {
checkResults();
} else {
openToolboxTabTwice(id, true);
}
});
// We use a timeout to check the tools active time
setTimeout(function() {
gDevTools.closeToolbox(target);
}, TOOL_DELAY);
}).then(null, reportError);
}
function checkResults() {
let result = Telemetry.prototype.telemetryInfo;
for (let [histId, value] of Iterator(result)) {
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
ok(value.length === 1 && value[0] === true,
"Per user value " + histId + " has a single value of true");
} else if (histId.endsWith("OPENED_BOOLEAN")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element === true;
});
ok(okay, "All " + histId + " entries are === true");
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element > 0;
});
ok(okay, "All " + histId + " entries have time > 0");
}
}
finishUp();
}
function reportError(error) {
let stack = " " + error.stack.replace(/\n?.*?@/g, "\n JS frame :: ");
ok(false, "ERROR: " + error + " at " + error.fileName + ":" +
error.lineNumber + "\n\nStack trace:" + stack);
finishUp();
}
function finishUp() {
gBrowser.removeCurrentTab();
Telemetry.prototype.log = Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype.telemetryInfo;
TargetFactory = Services = Promise = require = null;
finish();
}
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
waitForFocus(init, content);
}, true);
content.location = TEST_URI;
}

View File

@ -0,0 +1,110 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_netmonitor.js</p>";
// Because we need to gather stats for the period of time that a tool has been
// opened we make use of setTimeout() to create tool active times.
const TOOL_DELAY = 200;
let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
let Telemetry = require("devtools/shared/telemetry");
function init() {
Telemetry.prototype.telemetryInfo = {};
Telemetry.prototype._oldlog = Telemetry.prototype.log;
Telemetry.prototype.log = function(histogramId, value) {
if (histogramId) {
if (!this.telemetryInfo[histogramId]) {
this.telemetryInfo[histogramId] = [];
}
this.telemetryInfo[histogramId].push(value);
}
}
openToolboxTabTwice("netmonitor", false);
}
function openToolboxTabTwice(id, secondPass) {
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, id).then(function(toolbox) {
info("Toolbox tab " + id + " opened");
toolbox.once("destroyed", function() {
if (secondPass) {
checkResults();
} else {
openToolboxTabTwice(id, true);
}
});
// We use a timeout to check the tools active time
setTimeout(function() {
gDevTools.closeToolbox(target);
}, TOOL_DELAY);
}).then(null, reportError);
}
function checkResults() {
let result = Telemetry.prototype.telemetryInfo;
for (let [histId, value] of Iterator(result)) {
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
ok(value.length === 1 && value[0] === true,
"Per user value " + histId + " has a single value of true");
} else if (histId.endsWith("OPENED_BOOLEAN")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element === true;
});
ok(okay, "All " + histId + " entries are === true");
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element > 0;
});
ok(okay, "All " + histId + " entries have time > 0");
}
}
finishUp();
}
function reportError(error) {
let stack = " " + error.stack.replace(/\n?.*?@/g, "\n JS frame :: ");
ok(false, "ERROR: " + error + " at " + error.fileName + ":" +
error.lineNumber + "\n\nStack trace:" + stack);
finishUp();
}
function finishUp() {
gBrowser.removeCurrentTab();
Telemetry.prototype.log = Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype.telemetryInfo;
TargetFactory = Services = Promise = require = null;
finish();
}
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
waitForFocus(init, content);
}, true);
content.location = TEST_URI;
}

View File

@ -0,0 +1,110 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_options.js</p>";
// Because we need to gather stats for the period of time that a tool has been
// opened we make use of setTimeout() to create tool active times.
const TOOL_DELAY = 200;
let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
let Telemetry = require("devtools/shared/telemetry");
function init() {
Telemetry.prototype.telemetryInfo = {};
Telemetry.prototype._oldlog = Telemetry.prototype.log;
Telemetry.prototype.log = function(histogramId, value) {
if (histogramId) {
if (!this.telemetryInfo[histogramId]) {
this.telemetryInfo[histogramId] = [];
}
this.telemetryInfo[histogramId].push(value);
}
}
openToolboxTabTwice("options", false);
}
function openToolboxTabTwice(id, secondPass) {
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, id).then(function(toolbox) {
info("Toolbox tab " + id + " opened");
toolbox.once("destroyed", function() {
if (secondPass) {
checkResults();
} else {
openToolboxTabTwice(id, true);
}
});
// We use a timeout to check the tools active time
setTimeout(function() {
gDevTools.closeToolbox(target);
}, TOOL_DELAY);
}).then(null, reportError);
}
function checkResults() {
let result = Telemetry.prototype.telemetryInfo;
for (let [histId, value] of Iterator(result)) {
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
ok(value.length === 1 && value[0] === true,
"Per user value " + histId + " has a single value of true");
} else if (histId.endsWith("OPENED_BOOLEAN")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element === true;
});
ok(okay, "All " + histId + " entries are === true");
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element > 0;
});
ok(okay, "All " + histId + " entries have time > 0");
}
}
finishUp();
}
function reportError(error) {
let stack = " " + error.stack.replace(/\n?.*?@/g, "\n JS frame :: ");
ok(false, "ERROR: " + error + " at " + error.fileName + ":" +
error.lineNumber + "\n\nStack trace:" + stack);
finishUp();
}
function finishUp() {
gBrowser.removeCurrentTab();
Telemetry.prototype.log = Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype.telemetryInfo;
TargetFactory = Services = Promise = require = null;
finish();
}
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
waitForFocus(init, content);
}, true);
content.location = TEST_URI;
}

View File

@ -0,0 +1,110 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_styleeditor.js</p>";
// Because we need to gather stats for the period of time that a tool has been
// opened we make use of setTimeout() to create tool active times.
const TOOL_DELAY = 200;
let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
let Telemetry = require("devtools/shared/telemetry");
function init() {
Telemetry.prototype.telemetryInfo = {};
Telemetry.prototype._oldlog = Telemetry.prototype.log;
Telemetry.prototype.log = function(histogramId, value) {
if (histogramId) {
if (!this.telemetryInfo[histogramId]) {
this.telemetryInfo[histogramId] = [];
}
this.telemetryInfo[histogramId].push(value);
}
}
openToolboxTabTwice("styleeditor", false);
}
function openToolboxTabTwice(id, secondPass) {
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, id).then(function(toolbox) {
info("Toolbox tab " + id + " opened");
toolbox.once("destroyed", function() {
if (secondPass) {
checkResults();
} else {
openToolboxTabTwice(id, true);
}
});
// We use a timeout to check the tools active time
setTimeout(function() {
gDevTools.closeToolbox(target);
}, TOOL_DELAY);
}).then(null, reportError);
}
function checkResults() {
let result = Telemetry.prototype.telemetryInfo;
for (let [histId, value] of Iterator(result)) {
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
ok(value.length === 1 && value[0] === true,
"Per user value " + histId + " has a single value of true");
} else if (histId.endsWith("OPENED_BOOLEAN")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element === true;
});
ok(okay, "All " + histId + " entries are === true");
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element > 0;
});
ok(okay, "All " + histId + " entries have time > 0");
}
}
finishUp();
}
function reportError(error) {
let stack = " " + error.stack.replace(/\n?.*?@/g, "\n JS frame :: ");
ok(false, "ERROR: " + error + " at " + error.fileName + ":" +
error.lineNumber + "\n\nStack trace:" + stack);
finishUp();
}
function finishUp() {
gBrowser.removeCurrentTab();
Telemetry.prototype.log = Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype.telemetryInfo;
TargetFactory = Services = Promise = require = null;
finish();
}
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
waitForFocus(init, content);
}, true);
content.location = TEST_URI;
}

View File

@ -0,0 +1,110 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_styleeditor_webconsole.js</p>";
// Because we need to gather stats for the period of time that a tool has been
// opened we make use of setTimeout() to create tool active times.
const TOOL_DELAY = 200;
let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
let Telemetry = require("devtools/shared/telemetry");
function init() {
Telemetry.prototype.telemetryInfo = {};
Telemetry.prototype._oldlog = Telemetry.prototype.log;
Telemetry.prototype.log = function(histogramId, value) {
if (histogramId) {
if (!this.telemetryInfo[histogramId]) {
this.telemetryInfo[histogramId] = [];
}
this.telemetryInfo[histogramId].push(value);
}
}
openToolboxTabTwice("webconsole", false);
}
function openToolboxTabTwice(id, secondPass) {
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, id).then(function(toolbox) {
info("Toolbox tab " + id + " opened");
toolbox.once("destroyed", function() {
if (secondPass) {
checkResults();
} else {
openToolboxTabTwice(id, true);
}
});
// We use a timeout to check the tools active time
setTimeout(function() {
gDevTools.closeToolbox(target);
}, TOOL_DELAY);
}).then(null, reportError);
}
function checkResults() {
let result = Telemetry.prototype.telemetryInfo;
for (let [histId, value] of Iterator(result)) {
if (histId.endsWith("OPENED_PER_USER_FLAG")) {
ok(value.length === 1 && value[0] === true,
"Per user value " + histId + " has a single value of true");
} else if (histId.endsWith("OPENED_BOOLEAN")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element === true;
});
ok(okay, "All " + histId + " entries are === true");
} else if (histId.endsWith("TIME_ACTIVE_SECONDS")) {
ok(value.length > 1, histId + " has more than one entry");
let okay = value.every(function(element) {
return element > 0;
});
ok(okay, "All " + histId + " entries have time > 0");
}
}
finishUp();
}
function reportError(error) {
let stack = " " + error.stack.replace(/\n?.*?@/g, "\n JS frame :: ");
ok(false, "ERROR: " + error + " at " + error.fileName + ":" +
error.lineNumber + "\n\nStack trace:" + stack);
finishUp();
}
function finishUp() {
gBrowser.removeCurrentTab();
Telemetry.prototype.log = Telemetry.prototype._oldlog;
delete Telemetry.prototype._oldlog;
delete Telemetry.prototype.telemetryInfo;
TargetFactory = Services = Promise = require = null;
finish();
}
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function() {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
waitForFocus(init, content);
}, true);
content.location = TEST_URI;
}

View File

@ -222,13 +222,11 @@ let StyleSheet = function(form, debuggee) {
this._onSourceLoad = this._onSourceLoad.bind(this);
this._onPropertyChange = this._onPropertyChange.bind(this);
this._onError = this._onError.bind(this);
this._onStyleApplied = this._onStyleApplied.bind(this);
this._client.addListener("sourceLoad-" + this._actor, this._onSourceLoad);
this._client.addListener("propertyChange-" + this._actor, this._onPropertyChange);
this._client.addListener("error-" + this._actor, this._onError);
this._client.addListener("styleApplied-" + this._actor, this._onStyleApplied);
this._client.addListener("sourceLoad", this._onSourceLoad);
this._client.addListener("propertyChange", this._onPropertyChange);
this._client.addListener("styleApplied", this._onStyleApplied);
// set initial property values
for (let attr in form) {
@ -274,7 +272,12 @@ StyleSheet.prototype = {
* Event details
*/
_onSourceLoad: function(type, request) {
this.emit("source-load", request.source);
if (request.from == this._actor) {
if (request.error) {
return this.emit("error", request.error);
}
this.emit("source-load", request.source);
}
},
/**
@ -286,27 +289,19 @@ StyleSheet.prototype = {
* Event details
*/
_onPropertyChange: function(type, request) {
this[request.property] = request.value;
this.emit("property-change", request.property);
},
/**
* Propogate errors from the server that relate to this stylesheet.
*
* @param {string} type
* Event type
* @param {object} request
* Event details
*/
_onError: function(type, request) {
this.emit("error", request.errorMessage);
if (request.from == this._actor) {
this[request.property] = request.value;
this.emit("property-change", request.property);
}
},
/**
* Handle event when update has been successfully applied and propogate it.
*/
_onStyleApplied: function() {
this.emit("style-applied");
_onStyleApplied: function(type, request) {
if (request.from == this._actor) {
this.emit("style-applied");
}
},
/**
@ -326,9 +321,8 @@ StyleSheet.prototype = {
* Clean up and remove event listeners
*/
destroy: function() {
this._client.removeListener("sourceLoad-" + this._actor, this._onSourceLoad);
this._client.removeListener("propertyChange-" + this._actor, this._onPropertyChange);
this._client.removeListener("error-" + this._actor, this._onError);
this._client.removeListener("styleApplied-" + this._actor, this._onStyleApplied);
this._client.removeListener("sourceLoad", this._onSourceLoad);
this._client.removeListener("propertyChange", this._onPropertyChange);
this._client.removeListener("styleApplied", this._onStyleApplied);
}
}

View File

@ -279,5 +279,50 @@ function popupHideAfterReturnWithNoSelection()
is(jsterm.history[jsterm.history.length-1], "window.testBug",
"jsterm history is correct");
executeSoon(finishTest);
executeSoon(testCompletionInText);
}
function testCompletionInText()
{
info("test that completion works inside text, see bug 812618");
popup._panel.addEventListener("popupshown", function onShown() {
popup._panel.removeEventListener("popupshown", onShown);
ok(popup.isOpen, "popup is open");
is(popup.itemCount, 2, "popup.itemCount is correct");
EventUtils.synthesizeKey("VK_DOWN", {});
EventUtils.synthesizeKey("VK_DOWN", {});
is(popup.selectedIndex, 0, "popup.selectedIndex is correct");
ok(!completeNode.value, "completeNode.value is empty");
let items = popup.getItems().reverse().map(e => e.label);
let sameItems = items.every((prop, index) =>
["testBug873250a", "testBug873250b"][index] === prop);
ok(sameItems, "getItems returns the items we expect");
info("press Tab and wait for popup to hide");
popup._panel.addEventListener("popuphidden", popupHideAfterCompletionInText);
EventUtils.synthesizeKey("VK_TAB", {});
});
jsterm.setInputValue("dump(window.testBu)");
inputNode.selectionStart = inputNode.selectionEnd = 18;
EventUtils.synthesizeKey("g", {});
}
function popupHideAfterCompletionInText()
{
// At this point the completion suggestion should be accepted.
popup._panel.removeEventListener("popuphidden", popupHideAfterCompletionInText);
ok(!popup.isOpen, "popup is not open");
is(inputNode.value, "dump(window.testBug873250b)",
"completion was successful after VK_TAB");
is(inputNode.selectionStart, 26, "cursor location is correct");
is(inputNode.selectionStart, inputNode.selectionEnd, "cursor location (confirmed)");
ok(!completeNode.value, "completeNode is empty");
finishTest();
}

View File

@ -4,7 +4,8 @@
let prefs = {
"net": [
"network",
"networkinfo"
"netwarn",
"networkinfo",
],
"css": [
"csserror",

View File

@ -12,9 +12,6 @@
const TEST_HTTPS_URI = "https://example.com/browser/browser/devtools/webconsole/test/test-bug-737873-mixedcontent.html";
var origBlockDisplay;
var origBlockActive;
function test() {
addTab("data:text/html;charset=utf8,Web Console mixed content test");
browser.addEventListener("load", onLoad, true);
@ -22,8 +19,6 @@ function test() {
function onLoad(aEvent) {
browser.removeEventListener("load", onLoad, true);
origBlockDisplay = Services.prefs.getBoolPref("security.mixed_content.block_display_content");
origBlockActive = Services.prefs.getBoolPref("security.mixed_content.block_active_content")
Services.prefs.setBoolPref("security.mixed_content.block_display_content", false);
Services.prefs.setBoolPref("security.mixed_content.block_active_content", false);
openConsole(null, testMixedContent);
@ -31,66 +26,50 @@ function onLoad(aEvent) {
function testMixedContent(hud) {
content.location = TEST_HTTPS_URI;
var aOutputNode = hud.outputNode;
waitForSuccess(
{
name: "mixed content warning displayed successfully",
timeout: 20000,
validatorFn: function() {
return ( aOutputNode.querySelector(".webconsole-mixed-content") );
},
waitForMessages({
webconsole: hud,
messages: [{
text: "example.com",
category: CATEGORY_NETWORK,
severity: SEVERITY_WARNING,
}],
}).then((results) => {
let msg = [...results[0].matched][0];
ok(msg, "page load logged");
successFn: function() {
let mixedContent = msg.querySelector(".webconsole-mixed-content");
ok(mixedContent, ".webconsole-mixed-content element");
//tests on the urlnode
let node = aOutputNode.querySelector(".webconsole-mixed-content");
ok(testSeverity(node), "Severity type is SEVERITY_WARNING.");
let link = msg.querySelector(".webconsole-mixed-content-link");
ok(link, "mixed content link element");
is(link.value, "[Mixed Content]", "link text is accurate");
//tests on the warningNode
let warningNode = aOutputNode.querySelector(".webconsole-mixed-content-link");
is(warningNode.value, "[Mixed Content]", "Message text is accurate." );
testClickOpenNewTab(warningNode);
endTest();
},
failureFn: endTest,
}
);
}
function testSeverity(node) {
let linkNode = node.parentNode;
let msgNode = linkNode.parentNode;
let bodyNode = msgNode.parentNode;
let finalNode = bodyNode.parentNode;
return finalNode.classList.contains("webconsole-msg-warn");
}
function testClickOpenNewTab(warningNode) {
/* Invoke the click event and check if a new tab would open to the correct page */
let linkOpened = false;
let oldOpenUILinkIn = window.openUILinkIn;
window.openUILinkIn = function(aLink) {
if (aLink == "https://developer.mozilla.org/en/Security/MixedContent") {
let oldOpenLink = hud.openLink;
let linkOpened = false;
hud.openLink = (url) => {
is(url, "https://developer.mozilla.org/en/Security/MixedContent",
"url opened");
linkOpened = true;
}
}
};
EventUtils.synthesizeMouse(warningNode, 2, 2, {},
warningNode.ownerDocument.defaultView);
EventUtils.synthesizeMouse(link, 2, 2, {}, link.ownerDocument.defaultView);
ok(linkOpened, "Clicking the Mixed Content Warning node opens the desired page");
ok(linkOpened, "clicking the Mixed Content link opened a page");
window.openUILinkIn = oldOpenUILinkIn;
}
function endTest() {
Services.prefs.setBoolPref("security.mixed_content.block_display_content", origBlockDisplay);
Services.prefs.setBoolPref("security.mixed_content.block_active_content", origBlockActive);
finishTest();
hud.openLink = oldOpenLink;
ok(!msg.classList.contains("hud-filtered-by-type"), "message is not filtered");
hud.setFilterState("netwarn", false);
ok(msg.classList.contains("hud-filtered-by-type"), "message is filtered");
hud.setFilterState("netwarn", true);
Services.prefs.clearUserPref("security.mixed_content.block_display_content");
Services.prefs.clearUserPref("security.mixed_content.block_active_content");
finishTest();
});
}

View File

@ -119,7 +119,7 @@ const SEVERITY_CLASS_FRAGMENTS = [
// division of message type into "category" and "severity".
const MESSAGE_PREFERENCE_KEYS = [
// Error Warning Info Log
[ "network", null, null, "networkinfo", ], // Network
[ "network", "netwarn", null, "networkinfo", ], // Network
[ "csserror", "cssparser", null, null, ], // CSS
[ "exception", "jswarn", null, "jslog", ], // JS
[ "error", "warn", "info", "log", ], // Web Developer
@ -559,7 +559,7 @@ WebConsoleFrame.prototype = {
{
let prefs = ["network", "networkinfo", "csserror", "cssparser", "exception",
"jswarn", "jslog", "error", "info", "warn", "log", "secerror",
"secwarn"];
"secwarn", "netwarn"];
for (let pref of prefs) {
this.filterPrefs[pref] = Services.prefs
.getBoolPref(this._filterPrefsPrefix + pref);
@ -4077,9 +4077,8 @@ JSTerm.prototype = {
return false;
}
// Only complete if the selection is empty and at the end of the input.
if (inputNode.selectionStart == inputNode.selectionEnd &&
inputNode.selectionEnd != inputValue.length) {
// Only complete if the selection is empty.
if (inputNode.selectionStart != inputNode.selectionEnd) {
this.clearCompletion();
return false;
}
@ -4215,6 +4214,11 @@ JSTerm.prototype = {
onAutocompleteSelect: function JSTF_onAutocompleteSelect()
{
// Render the suggestion only if the cursor is at the end of the input.
if (this.inputNode.selectionStart != this.inputNode.value.length) {
return;
}
let currentItem = this.autocompletePopup.selectedItem;
if (currentItem && this.lastCompletion.value) {
let suffix = currentItem.label.substring(this.lastCompletion.
@ -4256,7 +4260,11 @@ JSTerm.prototype = {
if (currentItem && this.lastCompletion.value) {
let suffix = currentItem.label.substring(this.lastCompletion.
matchProp.length);
this.setInputValue(this.inputNode.value + suffix);
let cursor = this.inputNode.selectionStart;
let value = this.inputNode.value;
this.setInputValue(value.substr(0, cursor) + suffix + value.substr(cursor));
let newCursor = cursor + suffix.length;
this.inputNode.selectionStart = this.inputNode.selectionEnd = newCursor;
updated = true;
}

View File

@ -87,6 +87,8 @@
<menupopup>
<menuitem label="&btnConsoleErrors;" type="checkbox" autocheck="false"
prefKey="network"/>
<menuitem label="&btnConsoleWarnings;" type="checkbox" autocheck="false"
prefKey="netwarn"/>
<menuitem label="&btnConsoleLog;" type="checkbox" autocheck="false"
prefKey="networkinfo"/>
<menuseparator id="saveBodiesSeparator" />

View File

@ -79,3 +79,16 @@
- in the options panel. -->
<!ENTITY options.enablePersistentLogging.label "Enable persistent logs">
<!ENTITY options.enablePersistentLogging.tooltip "If you enable this option the Web Console will not clear the output each time you navigate to a new page">
<!-- LOCALIZATION NOTE (options.profiler.label): This is the label for the
- heading of the group of JavaScript Profiler preferences in the options
- panel. -->
<!ENTITY options.profiler.label "JavaScript Profiler">
<!-- LOCALIZATION NOTE (options.showPlatformData.label): This is the
- label for the checkbox that toggles the display of the platform data in the,
- Profiler i.e. devtools.profiler.ui.show-platform-data a boolean preference
- in about:config, in the options panel. -->
<!ENTITY options.showPlatformData.label "Show Gecko platform data">
<!ENTITY options.showPlatformData.tooltip "If you enable this option the JavaScript Profiler reports will include
Gecko platform symbols">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

View File

@ -87,10 +87,6 @@ body {
margin-left: -12px!important;
}
.expander[open] {
margin-left: -17px!important;
}
.expandable {
visibility: visible;
}

View File

@ -1,104 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* 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/. */
/* According to:
* https://bugzilla.mozilla.org/show_bug.cgi?id=715472#c17
*/
.theme-body {
background: #131c26;
color: #8fa1b2
}
.theme-twisty {
cursor: pointer;
margin-right: 5px;
}
.theme-twisty:-moz-focusring {
outline-style: none;
}
.theme-twisty:not([open]) {
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid rgba(255,255,255,0.5);
margin-left: 5px;
}
.theme-twisty[open] {
width: 10px;
height: 10px;
background-image: linear-gradient(to bottom right, transparent 68%, rgba(255,255,255,0.5) 68%);
}
.theme-checkbox {
display: inline-block;
border: 0;
width: 14px;
height: 14px;
padding: 0;
outline: none;
background: url("chrome://browser/skin/devtools/checkbox-dark.png") no-repeat;
}
.theme-checkbox[checked] {
background: url("chrome://browser/skin/devtools/checkbox-dark.png") 14px 0;
}
.theme-selected {
background: #26384E;
}
.theme-bg-darker {
background-color: rgba(0,0,0,0.1);
}
.theme-link { /* blue */
color: #3689b2;
}
.theme-comment { /* grey */
color: #5c6773;
}
.theme-gutter {
background-color: #0f171f;
color: #667380;
border-color: #303b47;
}
.theme-separator { /* grey */
border-color: #303b47;
}
.theme-fg-color1 { /* green */
color: #5c9966;
}
.theme-fg-color2 { /* blue */
color: #3689b2;
}
.theme-fg-color3 { /* pink/lavender */
color: #a673bf;
}
.theme-fg-color4 { /* purple/violet */
color: #6270b2;
}
.theme-fg-color5 { /* Yellow */
color: #a18650;
}
.theme-fg-color6 { /* Orange */
color: #b26b47;
}
.theme-fg-color7 { /* Red */
color: #bf5656;
}

View File

@ -123,8 +123,9 @@ browser.jar:
skin/classic/browser/tabview/tabview.png (tabview/tabview.png)
skin/classic/browser/tabview/tabview.css (tabview/tabview.css)
* skin/classic/browser/devtools/common.css (devtools/common.css)
skin/classic/browser/devtools/dark-theme.css (devtools/dark-theme.css)
skin/classic/browser/devtools/light-theme.css (devtools/light-theme.css)
skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
skin/classic/browser/devtools/controls.png (../shared/devtools/controls.png)
skin/classic/browser/devtools/widgets.css (devtools/widgets.css)
skin/classic/browser/devtools/commandline-icon.png (devtools/commandline-icon.png)
skin/classic/browser/devtools/command-paintflashing.png (devtools/command-paintflashing.png)
@ -136,10 +137,8 @@ browser.jar:
* skin/classic/browser/devtools/webconsole.css (devtools/webconsole.css)
skin/classic/browser/devtools/webconsole_networkpanel.css (devtools/webconsole_networkpanel.css)
skin/classic/browser/devtools/webconsole.png (devtools/webconsole.png)
skin/classic/browser/devtools/checkbox-dark.png (devtools/checkbox-dark.png)
skin/classic/browser/devtools/checkbox-light.png (devtools/checkbox-light.png)
skin/classic/browser/devtools/commandline.css (devtools/commandline.css)
skin/classic/browser/devtools/markup-view.css (devtools/markup-view.css)
skin/classic/browser/devtools/markup-view.css (../shared/devtools/markup-view.css)
skin/classic/browser/devtools/orion.css (devtools/orion.css)
skin/classic/browser/devtools/orion-container.css (devtools/orion-container.css)
skin/classic/browser/devtools/orion-task.png (devtools/orion-task.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

View File

@ -105,10 +105,6 @@ body {
margin-left: -12px!important;
}
.expander[open] {
margin-left: -17px!important;
}
.expandable {
visibility: visible;
}

View File

@ -1,104 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* 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/. */
/* According to:
* https://bugzilla.mozilla.org/show_bug.cgi?id=715472#c17
*/
.theme-body {
background: #131c26;
color: #8fa1b2
}
.theme-twisty {
cursor: pointer;
margin-right: 5px;
}
.theme-twisty:-moz-focusring {
outline-style: none;
}
.theme-twisty:not([open]) {
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid rgba(255,255,255,0.5);
margin-left: 5px;
}
.theme-twisty[open] {
width: 10px;
height: 10px;
background-image: linear-gradient(to bottom right, transparent 68%, rgba(255,255,255,0.5) 68%);
}
.theme-checkbox {
display: inline-block;
border: 0;
width: 14px;
height: 14px;
padding: 0;
outline: none;
background: url("chrome://browser/skin/devtools/checkbox-dark.png") no-repeat;
}
.theme-checkbox[checked] {
background: url("chrome://browser/skin/devtools/checkbox-dark.png") 14px 0;
}
.theme-selected {
background: #26384E;
}
.theme-bg-darker {
background-color: rgba(0,0,0,0.1);
}
.theme-link { /* blue */
color: #3689b2;
}
.theme-comment { /* grey */
color: #5c6773;
}
.theme-gutter {
background-color: #0f171f;
color: #667380;
border-color: #303b47;
}
.theme-separator { /* grey */
border-color: #303b47;
}
.theme-fg-color1 { /* green */
color: #5c9966;
}
.theme-fg-color2 { /* blue */
color: #3689b2;
}
.theme-fg-color3 { /* pink/lavender */
color: #a673bf;
}
.theme-fg-color4 { /* purple/violet */
color: #6270b2;
}
.theme-fg-color5 { /* Yellow */
color: #a18650;
}
.theme-fg-color6 { /* Orange */
color: #b26b47;
}
.theme-fg-color7 { /* Red */
color: #bf5656;
}

View File

@ -1,104 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* 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/. */
/* According to:
* https://bugzilla.mozilla.org/show_bug.cgi?id=715472#c17
*/
.theme-body {
background: white;
color: black;
}
.theme-twisty {
cursor: pointer;
margin-right: 5px;
}
.theme-twisty:-moz-focusring {
outline-style: none;
}
.theme-twisty:not([open]) {
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid rgba(0,0,0,0.5);
margin-left: 5px;
}
.theme-twisty[open] {
width: 10px;
height: 10px;
background-image: linear-gradient(to bottom right, transparent 68%, rgba(0,0,0,0.5) 68%);
}
.theme-checkbox {
display: inline-block;
border: 0;
width: 14px;
height: 14px;
padding: 0;
outline: none;
background: url("chrome://browser/skin/devtools/checkbox-light.png") no-repeat;
}
.theme-checkbox[checked] {
background: url("chrome://browser/skin/devtools/checkbox-light.png") 14px 0;
}
.theme-selected {
background-color: hsl(0,0%,90%);
}
.theme-bg-darker {
background: #F9F9F9;
}
.theme-link { /* blue */
color: hsl(208,56%,40%);
}
.theme-comment { /* grey */
color: hsl(90,2%,46%);
}
.theme-gutter {
background-color: hsl(0,0%,90%);
color: #667380;
border-color: hsl(0,0%,65%);
}
.theme-separator { /* grey */
border-color: #cddae5;
}
.theme-fg-color1 { /* green */
color: hsl(72,100%,27%);
}
.theme-fg-color2 { /* blue */
color: hsl(208,56%,40%);
}
.theme-fg-color3 { /* dark blue */
color: hsl(208,81%,21%)
}
.theme-fg-color4 { /* Orange */
color: hsl(24,85%,39%);
}
.theme-fg-color5 { /* Yellow */
color: #a18650;
}
.theme-fg-color6 { /* Orange */
color: hsl(24,85%,39%);
}
.theme-fg-color7 { /* Red */
color: #bf5656;
}

View File

@ -1,44 +0,0 @@
/* 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/. */
* {
padding: 0;
margin: 0;
}
.newattr {
cursor: pointer;
}
.selected {
background-color: hsl(0,0%,90%);
}
/* Give some padding to focusable elements to match the editor input
* that will replace them. */
span[tabindex] {
display: inline-block;
padding: 1px 0;
}
li.container {
position: relative;
padding: 2px 0 0 2px;
}
.codebox {
padding-left: 14px;
}
.expander {
position: absolute;
}
.more-nodes {
padding-left: 16px;
}
.styleinspector-propertyeditor {
border: 1px solid #CCC;
}

View File

@ -211,8 +211,9 @@ browser.jar:
skin/classic/browser/tabview/tabview.png (tabview/tabview.png)
skin/classic/browser/tabview/tabview.css (tabview/tabview.css)
* skin/classic/browser/devtools/common.css (devtools/common.css)
skin/classic/browser/devtools/dark-theme.css (devtools/dark-theme.css)
skin/classic/browser/devtools/light-theme.css (devtools/light-theme.css)
skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
skin/classic/browser/devtools/controls.png (../shared/devtools/controls.png)
skin/classic/browser/devtools/widgets.css (devtools/widgets.css)
skin/classic/browser/devtools/commandline-icon.png (devtools/commandline-icon.png)
skin/classic/browser/devtools/command-paintflashing.png (devtools/command-paintflashing.png)
@ -222,9 +223,7 @@ browser.jar:
skin/classic/browser/devtools/alerticon-warning.png (devtools/alerticon-warning.png)
skin/classic/browser/devtools/ruleview.css (devtools/ruleview.css)
skin/classic/browser/devtools/commandline.css (devtools/commandline.css)
skin/classic/browser/devtools/checkbox-dark.png (devtools/checkbox-dark.png)
skin/classic/browser/devtools/checkbox-light.png (devtools/checkbox-light.png)
skin/classic/browser/devtools/markup-view.css (devtools/markup-view.css)
skin/classic/browser/devtools/markup-view.css (../shared/devtools/markup-view.css)
skin/classic/browser/devtools/orion.css (devtools/orion.css)
skin/classic/browser/devtools/orion-container.css (devtools/orion-container.css)
skin/classic/browser/devtools/orion-task.png (devtools/orion-task.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

View File

@ -13,26 +13,19 @@
.theme-twisty {
cursor: pointer;
margin-right: 5px;
width: 14px;
height: 14px;
background-repeat: no-repeat;
background-image: url("chrome://browser/skin/devtools/controls.png");
background-position: -28px -14px;
}
.theme-twisty:-moz-focusring {
outline-style: none;
}
.theme-twisty:not([open]) {
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid rgba(255,255,255,0.5);
margin-left: 5px;
}
.theme-twisty[open] {
width: 10px;
height: 10px;
background-image: linear-gradient(to bottom right, transparent 68%, rgba(255,255,255,0.5) 68%);
background-position: -42px -14px;
}
.theme-checkbox {
@ -42,11 +35,12 @@
height: 14px;
padding: 0;
outline: none;
background: url("chrome://browser/skin/devtools/checkbox-dark.png") no-repeat;
background-image: url("chrome://browser/skin/devtools/controls.png");
background-position: -28px 0;
}
.theme-checkbox[checked] {
background: url("chrome://browser/skin/devtools/checkbox-dark.png") 14px 0;
background-position: -42px 0;
}
.theme-selected {

View File

@ -13,26 +13,19 @@
.theme-twisty {
cursor: pointer;
margin-right: 5px;
width: 14px;
height: 14px;
background-repeat: no-repeat;
background-image: url("chrome://browser/skin/devtools/controls.png");
background-position: 0 -14px;
}
.theme-twisty:-moz-focusring {
outline-style: none;
}
.theme-twisty:not([open]) {
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid rgba(0,0,0,0.5);
margin-left: 5px;
}
.theme-twisty[open] {
width: 10px;
height: 10px;
background-image: linear-gradient(to bottom right, transparent 68%, rgba(0,0,0,0.5) 68%);
background-position: -14px -14px;
}
.theme-checkbox {
@ -42,11 +35,12 @@
height: 14px;
padding: 0;
outline: none;
background: url("chrome://browser/skin/devtools/checkbox-light.png") no-repeat;
background-image: url("chrome://browser/skin/devtools/controls.png");
background-position: 0 0;
}
.theme-checkbox[checked] {
background: url("chrome://browser/skin/devtools/checkbox-light.png") 14px 0;
background-position: -14px 0;
}
.theme-selected {

View File

@ -23,7 +23,6 @@ span[tabindex] {
}
li.container {
position: relative;
padding: 2px 0 0 2px;
}
@ -31,8 +30,13 @@ li.container {
padding-left: 14px;
}
.codebox > * {
vertical-align: middle;
}
.expander {
position: absolute;
display: inline-block;
margin-left: -14px;
}
.more-nodes {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

View File

@ -105,10 +105,6 @@ body {
margin-left: -12px!important;
}
.expander[open] {
margin-left: -17px!important;
}
.expandable {
visibility: visible;
}

View File

@ -1,104 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* 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/. */
/* According to:
* https://bugzilla.mozilla.org/show_bug.cgi?id=715472#c17
*/
.theme-body {
background: white;
color: black;
}
.theme-twisty {
cursor: pointer;
margin-right: 5px;
}
.theme-twisty:-moz-focusring {
outline-style: none;
}
.theme-twisty:not([open]) {
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid rgba(0,0,0,0.5);
margin-left: 5px;
}
.theme-twisty[open] {
width: 10px;
height: 10px;
background-image: linear-gradient(to bottom right, transparent 68%, rgba(0,0,0,0.5) 68%);
}
.theme-checkbox {
display: inline-block;
border: 0;
width: 14px;
height: 14px;
padding: 0;
outline: none;
background: url("chrome://browser/skin/devtools/checkbox-light.png") no-repeat;
}
.theme-checkbox[checked] {
background: url("chrome://browser/skin/devtools/checkbox-light.png") 14px 0;
}
.theme-selected {
background-color: hsl(0,0%,90%);
}
.theme-bg-darker {
background: #F9F9F9;
}
.theme-link { /* blue */
color: hsl(208,56%,40%);
}
.theme-comment { /* grey */
color: hsl(90,2%,46%);
}
.theme-gutter {
background-color: hsl(0,0%,90%);
color: #667380;
border-color: hsl(0,0%,65%);
}
.theme-separator { /* grey */
border-color: #cddae5;
}
.theme-fg-color1 { /* green */
color: hsl(72,100%,27%);
}
.theme-fg-color2 { /* blue */
color: hsl(208,56%,40%);
}
.theme-fg-color3 { /* dark blue */
color: hsl(208,81%,21%)
}
.theme-fg-color4 { /* Orange */
color: hsl(24,85%,39%);
}
.theme-fg-color5 { /* Yellow */
color: #a18650;
}
.theme-fg-color6 { /* Orange */
color: hsl(24,85%,39%);
}
.theme-fg-color7 { /* Red */
color: #bf5656;
}

View File

@ -1,44 +0,0 @@
/* 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/. */
* {
padding: 0;
margin: 0;
}
.newattr {
cursor: pointer;
}
.selected {
background-color: hsl(0,0%,90%);
}
/* Give some padding to focusable elements to match the editor input
* that will replace them. */
span[tabindex] {
display: inline-block;
padding: 1px 0;
}
li.container {
position: relative;
padding: 2px 0 0 2px;
}
.codebox {
padding-left: 14px;
}
.expander {
position: absolute;
}
.more-nodes {
padding-left: 16px;
}
.styleinspector-propertyeditor {
border: 1px solid #CCC;
}

View File

@ -149,8 +149,9 @@ browser.jar:
skin/classic/browser/tabview/tabview-inverted.png (tabview/tabview-inverted.png)
skin/classic/browser/tabview/tabview.css (tabview/tabview.css)
* skin/classic/browser/devtools/common.css (devtools/common.css)
skin/classic/browser/devtools/dark-theme.css (devtools/dark-theme.css)
skin/classic/browser/devtools/light-theme.css (devtools/light-theme.css)
skin/classic/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
skin/classic/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
skin/classic/browser/devtools/controls.png (../shared/devtools/controls.png)
skin/classic/browser/devtools/widgets.css (devtools/widgets.css)
skin/classic/browser/devtools/commandline-icon.png (devtools/commandline-icon.png)
skin/classic/browser/devtools/alerticon-warning.png (devtools/alerticon-warning.png)
@ -160,9 +161,7 @@ browser.jar:
skin/classic/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
skin/classic/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
skin/classic/browser/devtools/command-tilt.png (devtools/command-tilt.png)
skin/classic/browser/devtools/checkbox-dark.png (devtools/checkbox-dark.png)
skin/classic/browser/devtools/checkbox-light.png (devtools/checkbox-light.png)
skin/classic/browser/devtools/markup-view.css (devtools/markup-view.css)
skin/classic/browser/devtools/markup-view.css (../shared/devtools/markup-view.css)
skin/classic/browser/devtools/orion.css (devtools/orion.css)
skin/classic/browser/devtools/orion-container.css (devtools/orion-container.css)
skin/classic/browser/devtools/orion-task.png (devtools/orion-task.png)
@ -404,20 +403,19 @@ browser.jar:
skin/classic/aero/browser/tabview/tabview-inverted.png (tabview/tabview-inverted.png)
skin/classic/aero/browser/tabview/tabview.css (tabview/tabview.css)
* skin/classic/aero/browser/devtools/common.css (devtools/common.css)
skin/classic/aero/browser/devtools/dark-theme.css (devtools/dark-theme.css)
skin/classic/aero/browser/devtools/light-theme.css (devtools/light-theme.css)
skin/classic/aero/browser/devtools/dark-theme.css (../shared/devtools/dark-theme.css)
skin/classic/aero/browser/devtools/light-theme.css (../shared/devtools/light-theme.css)
skin/classic/aero/browser/devtools/controls.png (../shared/devtools/controls.png)
skin/classic/aero/browser/devtools/widgets.css (devtools/widgets.css)
skin/classic/aero/browser/devtools/commandline-icon.png (devtools/commandline-icon.png)
skin/classic/aero/browser/devtools/command-paintflashing.png (devtools/command-paintflashing.png)
skin/classic/aero/browser/devtools/command-responsivemode.png (devtools/command-responsivemode.png)
skin/classic/aero/browser/devtools/command-scratchpad.png (devtools/command-scratchpad.png)
skin/classic/aero/browser/devtools/command-tilt.png (devtools/command-tilt.png)
skin/classic/aero/browser/devtools/checkbox-dark.png (devtools/checkbox-dark.png)
skin/classic/aero/browser/devtools/checkbox-light.png (devtools/checkbox-light.png)
skin/classic/aero/browser/devtools/alerticon-warning.png (devtools/alerticon-warning.png)
skin/classic/aero/browser/devtools/ruleview.css (devtools/ruleview.css)
skin/classic/aero/browser/devtools/commandline.css (devtools/commandline.css)
skin/classic/aero/browser/devtools/markup-view.css (devtools/markup-view.css)
skin/classic/aero/browser/devtools/markup-view.css (../shared/devtools/markup-view.css)
skin/classic/aero/browser/devtools/orion.css (devtools/orion.css)
skin/classic/aero/browser/devtools/orion-container.css (devtools/orion-container.css)
skin/classic/aero/browser/devtools/orion-task.png (devtools/orion-task.png)

View File

@ -357,12 +357,10 @@ ifdef BOTH_MANIFESTS
MAKE_JARS_FLAGS += --both-manifests
endif
TAR_CREATE_FLAGS = -cvhf
TAR_CREATE_FLAGS_QUIET = -chf
TAR_CREATE_FLAGS = -chf
ifeq ($(OS_ARCH),OS2)
TAR_CREATE_FLAGS = -cvf
TAR_CREATE_FLAGS_QUIET = -cf
TAR_CREATE_FLAGS = -cf
endif
#

View File

@ -118,4 +118,4 @@ ifdef USE_RCS_MK
endif
## copy(src, dst): recursive copy
copy_dir = (cd $(1)/. && $(TAR) $(TAR_CREATE_FLAGS_QUIET) - .) | (cd $(2)/. && tar -xf -)
copy_dir = (cd $(1)/. && $(TAR) $(TAR_CREATE_FLAGS) - .) | (cd $(2)/. && tar -xf -)

View File

@ -32,6 +32,7 @@ class nsAString;
class nsBindingManager;
class nsCSSStyleSheet;
class nsDOMNavigationTiming;
class nsDOMTouchList;
class nsEventStates;
class nsFrameLoader;
class nsHTMLCSSStyleSheet;
@ -50,7 +51,6 @@ class nsIDOMDocumentFragment;
class nsIDOMDocumentType;
class nsIDOMElement;
class nsIDOMNodeList;
class nsIDOMTouchList;
class nsIDOMXPathExpression;
class nsIDOMXPathNSResolver;
class nsILayoutHistoryState;
@ -2099,11 +2099,11 @@ public:
int32_t aScreenX, int32_t aScreenY, int32_t aClientX,
int32_t aClientY, int32_t aRadiusX, int32_t aRadiusY,
float aRotationAngle, float aForce);
already_AddRefed<nsIDOMTouchList> CreateTouchList();
already_AddRefed<nsIDOMTouchList>
already_AddRefed<nsDOMTouchList> CreateTouchList();
already_AddRefed<nsDOMTouchList>
CreateTouchList(mozilla::dom::Touch& aTouch,
const mozilla::dom::Sequence<mozilla::dom::OwningNonNull<mozilla::dom::Touch> >& aTouches);
already_AddRefed<nsIDOMTouchList>
already_AddRefed<nsDOMTouchList>
CreateTouchList(const mozilla::dom::Sequence<mozilla::dom::OwningNonNull<mozilla::dom::Touch> >& aTouches);
void SetStyleSheetChangeEventsEnabled(bool aValue)

View File

@ -151,7 +151,7 @@ public:
void SetCreatorParser(nsIParser* aParser)
{
mCreatorParser = getter_AddRefs(NS_GetWeakReference(aParser));
mCreatorParser = do_GetWeakReference(aParser);
}
/**

View File

@ -9301,7 +9301,7 @@ NS_IMETHODIMP
nsDocument::CreateTouchList(nsIVariant* aPoints,
nsIDOMTouchList** aRetVal)
{
nsRefPtr<nsDOMTouchList> retval = new nsDOMTouchList();
nsRefPtr<nsDOMTouchList> retval = new nsDOMTouchList(ToSupports(this));
if (aPoints) {
uint16_t type;
aPoints->GetDataType(&type);
@ -9338,18 +9338,18 @@ nsDocument::CreateTouchList(nsIVariant* aPoints,
return NS_OK;
}
already_AddRefed<nsIDOMTouchList>
already_AddRefed<nsDOMTouchList>
nsIDocument::CreateTouchList()
{
nsRefPtr<nsDOMTouchList> retval = new nsDOMTouchList();
nsRefPtr<nsDOMTouchList> retval = new nsDOMTouchList(ToSupports(this));
return retval.forget();
}
already_AddRefed<nsIDOMTouchList>
already_AddRefed<nsDOMTouchList>
nsIDocument::CreateTouchList(Touch& aTouch,
const Sequence<OwningNonNull<Touch> >& aTouches)
{
nsRefPtr<nsDOMTouchList> retval = new nsDOMTouchList();
nsRefPtr<nsDOMTouchList> retval = new nsDOMTouchList(ToSupports(this));
retval->Append(&aTouch);
for (uint32_t i = 0; i < aTouches.Length(); ++i) {
retval->Append(aTouches[i].get());
@ -9357,10 +9357,10 @@ nsIDocument::CreateTouchList(Touch& aTouch,
return retval.forget();
}
already_AddRefed<nsIDOMTouchList>
already_AddRefed<nsDOMTouchList>
nsIDocument::CreateTouchList(const Sequence<OwningNonNull<Touch> >& aTouches)
{
nsRefPtr<nsDOMTouchList> retval = new nsDOMTouchList();
nsRefPtr<nsDOMTouchList> retval = new nsDOMTouchList(ToSupports(this));
for (uint32_t i = 0; i < aTouches.Length(); ++i) {
retval->Append(aTouches[i].get());
}

View File

@ -3948,6 +3948,3 @@ CanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager *aManager)
}
}
DOMCI_DATA(CanvasRenderingContext2D, mozilla::dom::CanvasRenderingContext2D)

View File

@ -13,6 +13,7 @@
#include "nsJSEnvironment.h"
#include "nsWrapperCache.h"
#include "mozilla/dom/EventTarget.h"
#include "Units.h"
namespace mozilla {
namespace dom {
@ -39,9 +40,9 @@ public:
SetIsDOMBinding();
mTarget = aTarget;
mIdentifier = aIdentifier;
mPagePoint = nsIntPoint(aPageX, aPageY);
mPagePoint = CSSIntPoint(aPageX, aPageY);
mScreenPoint = nsIntPoint(aScreenX, aScreenY);
mClientPoint = nsIntPoint(aClientX, aClientY);
mClientPoint = CSSIntPoint(aClientX, aClientY);
mRefPoint = nsIntPoint(0, 0);
mPointsInitialized = true;
mRadius.x = aRadiusX;
@ -61,9 +62,9 @@ public:
{
SetIsDOMBinding();
mIdentifier = aIdentifier;
mPagePoint = nsIntPoint(0, 0);
mPagePoint = CSSIntPoint(0, 0);
mScreenPoint = nsIntPoint(0, 0);
mClientPoint = nsIntPoint(0, 0);
mClientPoint = CSSIntPoint(0, 0);
mRefPoint = aPoint;
mPointsInitialized = false;
mRadius = aRadius;
@ -105,8 +106,8 @@ public:
float Force() const { return mForce; }
int32_t mIdentifier;
nsIntPoint mPagePoint;
nsIntPoint mClientPoint;
CSSIntPoint mPagePoint;
CSSIntPoint mClientPoint;
nsIntPoint mScreenPoint;
nsIntPoint mRadius;
float mRotationAngle;

View File

@ -1091,25 +1091,23 @@ nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
}
//static
nsIntPoint
CSSIntPoint
nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
nsEvent* aEvent,
nsIntPoint aPoint,
nsIntPoint aDefaultPoint)
CSSIntPoint aDefaultPoint)
{
nsIntPoint pagePoint = nsDOMEvent::GetClientCoords(aPresContext,
aEvent,
aPoint,
aDefaultPoint);
CSSIntPoint pagePoint = nsDOMEvent::GetClientCoords(aPresContext,
aEvent,
aPoint,
aDefaultPoint);
// If there is some scrolling, add scroll info to client point.
if (aPresContext && aPresContext->GetPresShell()) {
nsIPresShell* shell = aPresContext->GetPresShell();
nsIScrollableFrame* scrollframe = shell->GetRootScrollFrameAsScrollable();
if (scrollframe) {
nsPoint pt = scrollframe->GetScrollPosition();
pagePoint += nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
nsPresContext::AppUnitsToIntCSSPixels(pt.y));
pagePoint += CSSIntPoint::FromAppUnitsRounded(scrollframe->GetScrollPosition());
}
}
@ -1117,11 +1115,11 @@ nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
}
// static
nsIntPoint
CSSIntPoint
nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
nsEvent* aEvent,
nsIntPoint aPoint,
nsIntPoint aDefaultPoint)
CSSIntPoint aDefaultPoint)
{
if (nsEventStateManager::sIsPointerLocked) {
return nsEventStateManager::sLastClientPoint;
@ -1135,21 +1133,23 @@ nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
aEvent->eventStructType != NS_DRAG_EVENT &&
aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||
!aPresContext ||
!((nsGUIEvent*)aEvent)->widget) {
!static_cast<nsGUIEvent*>(aEvent)->widget) {
return aDefaultPoint;
}
nsPoint pt(0, 0);
nsIPresShell* shell = aPresContext->GetPresShell();
if (!shell) {
return nsIntPoint(0, 0);
return CSSIntPoint(0, 0);
}
nsIFrame* rootFrame = shell->GetRootFrame();
if (rootFrame)
pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, aPoint, rootFrame);
return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
nsPresContext::AppUnitsToIntCSSPixels(pt.y));
nsIFrame* rootFrame = shell->GetRootFrame();
if (!rootFrame) {
return CSSIntPoint(0, 0);
}
nsPoint pt =
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, aPoint, rootFrame);
return CSSIntPoint::FromAppUnitsRounded(pt);
}
// To be called ONLY by nsDOMEvent::GetType (which has the additional

View File

@ -19,6 +19,7 @@
#include "mozilla/dom/EventTarget.h"
#include "mozilla/dom/EventBinding.h"
#include "nsIScriptGlobalObject.h"
#include "Units.h"
class nsIContent;
class nsPresContext;
@ -99,14 +100,12 @@ public:
static void Shutdown();
static const char* GetEventName(uint32_t aEventType);
static nsIntPoint GetClientCoords(nsPresContext* aPresContext,
nsEvent* aEvent,
nsIntPoint aPoint,
nsIntPoint aDefaultPoint);
static nsIntPoint GetPageCoords(nsPresContext* aPresContext,
nsEvent* aEvent,
nsIntPoint aPoint,
nsIntPoint aDefaultPoint);
static mozilla::CSSIntPoint
GetClientCoords(nsPresContext* aPresContext, nsEvent* aEvent,
nsIntPoint aPoint, mozilla::CSSIntPoint aDefaultPoint);
static mozilla::CSSIntPoint
GetPageCoords(nsPresContext* aPresContext, nsEvent* aEvent, nsIntPoint aPoint,
mozilla::CSSIntPoint aDefaultPoint);
static nsIntPoint GetScreenCoords(nsPresContext* aPresContext,
nsEvent* aEvent,
nsIntPoint aPoint);

View File

@ -92,7 +92,7 @@ nsDOMNotifyPaintEvent::ClientRects()
}
NS_IMETHODIMP
nsDOMNotifyPaintEvent::GetPaintRequests(nsIDOMPaintRequestList** aResult)
nsDOMNotifyPaintEvent::GetPaintRequests(nsISupports** aResult)
{
nsRefPtr<nsPaintRequestList> requests = PaintRequests();
requests.forget(aResult);

View File

@ -10,58 +10,67 @@
#include "mozilla/Preferences.h"
#include "nsPresContext.h"
#include "mozilla/dom/Touch.h"
#include "mozilla/dom/TouchListBinding.h"
using namespace mozilla;
using namespace mozilla::dom;
// TouchList
nsDOMTouchList::nsDOMTouchList(nsTArray<nsCOMPtr<nsIDOMTouch> > &aTouches)
{
mPoints.AppendElements(aTouches);
nsJSContext::LikelyShortLivingObjectCreated();
}
DOMCI_DATA(TouchList, nsDOMTouchList)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMTouchList)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY(nsIDOMTouchList)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TouchList)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_1(nsDOMTouchList, mPoints)
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(nsDOMTouchList, mParent, mPoints)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMTouchList)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMTouchList)
/* virtual */ JSObject*
nsDOMTouchList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
return TouchListBinding::Wrap(aCx, aScope, this);
}
/* static */ bool
nsDOMTouchList::PrefEnabled()
{
return nsDOMTouchEvent::PrefEnabled();
}
NS_IMETHODIMP
nsDOMTouchList::GetLength(uint32_t* aLength)
{
*aLength = mPoints.Length();
*aLength = Length();
return NS_OK;
}
NS_IMETHODIMP
nsDOMTouchList::Item(uint32_t aIndex, nsIDOMTouch** aRetVal)
{
NS_IF_ADDREF(*aRetVal = mPoints.SafeElementAt(aIndex, nullptr));
NS_IF_ADDREF(*aRetVal = Item(aIndex));
return NS_OK;
}
NS_IMETHODIMP
nsDOMTouchList::IdentifiedTouch(int32_t aIdentifier, nsIDOMTouch** aRetVal)
{
*aRetVal = nullptr;
NS_IF_ADDREF(*aRetVal = IdentifiedTouch(aIdentifier));
return NS_OK;
}
Touch*
nsDOMTouchList::IdentifiedTouch(int32_t aIdentifier) const
{
for (uint32_t i = 0; i < mPoints.Length(); ++i) {
nsCOMPtr<nsIDOMTouch> point = mPoints[i];
int32_t identifier;
if (point && NS_SUCCEEDED(point->GetIdentifier(&identifier)) &&
aIdentifier == identifier) {
point.swap(*aRetVal);
break;
Touch* point = mPoints[i];
if (point && point->Identifier() == aIdentifier) {
return point;
}
}
return NS_OK;
return nullptr;
}
// TouchEvent
@ -151,16 +160,16 @@ nsDOMTouchEvent::Touches()
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(mEvent);
if (mEvent->message == NS_TOUCH_END || mEvent->message == NS_TOUCH_CANCEL) {
// for touchend events, remove any changed touches from the touches array
nsTArray<nsCOMPtr<nsIDOMTouch> > unchangedTouches;
const nsTArray<nsCOMPtr<nsIDOMTouch> >& touches = touchEvent->touches;
nsTArray< nsRefPtr<Touch> > unchangedTouches;
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches;
for (uint32_t i = 0; i < touches.Length(); ++i) {
if (!touches[i]->mChanged) {
unchangedTouches.AppendElement(touches[i]);
}
}
mTouches = new nsDOMTouchList(unchangedTouches);
mTouches = new nsDOMTouchList(ToSupports(this), unchangedTouches);
} else {
mTouches = new nsDOMTouchList(touchEvent->touches);
mTouches = new nsDOMTouchList(ToSupports(this), touchEvent->touches);
}
}
return mTouches;
@ -178,21 +187,20 @@ nsDOMTouchList*
nsDOMTouchEvent::TargetTouches()
{
if (!mTargetTouches) {
nsTArray<nsCOMPtr<nsIDOMTouch> > targetTouches;
nsTArray< nsRefPtr<Touch> > targetTouches;
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(mEvent);
const nsTArray<nsCOMPtr<nsIDOMTouch> >& touches = touchEvent->touches;
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches;
for (uint32_t i = 0; i < touches.Length(); ++i) {
// for touchend/cancel events, don't append to the target list if this is a
// touch that is ending
if ((mEvent->message != NS_TOUCH_END &&
mEvent->message != NS_TOUCH_CANCEL) || !touches[i]->mChanged) {
EventTarget* targetPtr = touches[i]->GetTarget();
if (targetPtr == mEvent->originalTarget) {
if (touches[i]->mTarget == mEvent->originalTarget) {
targetTouches.AppendElement(touches[i]);
}
}
}
mTargetTouches = new nsDOMTouchList(targetTouches);
mTargetTouches = new nsDOMTouchList(ToSupports(this), targetTouches);
}
return mTargetTouches;
}
@ -209,15 +217,15 @@ nsDOMTouchList*
nsDOMTouchEvent::ChangedTouches()
{
if (!mChangedTouches) {
nsTArray<nsCOMPtr<nsIDOMTouch> > changedTouches;
nsTArray< nsRefPtr<Touch> > changedTouches;
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(mEvent);
const nsTArray<nsCOMPtr<nsIDOMTouch> >& touches = touchEvent->touches;
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches;
for (uint32_t i = 0; i < touches.Length(); ++i) {
if (touches[i]->mChanged) {
changedTouches.AppendElement(touches[i]);
}
}
mChangedTouches = new nsDOMTouchList(changedTouches);
mChangedTouches = new nsDOMTouchList(ToSupports(this), changedTouches);
}
return mChangedTouches;
}

View File

@ -12,32 +12,69 @@
#include "mozilla/Attributes.h"
#include "nsJSEnvironment.h"
#include "mozilla/dom/TouchEventBinding.h"
#include "nsWrapperCache.h"
class nsDOMTouchList MOZ_FINAL : public nsIDOMTouchList
, public nsWrapperCache
{
typedef mozilla::dom::Touch Touch;
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsDOMTouchList)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMTouchList)
NS_DECL_NSIDOMTOUCHLIST
nsDOMTouchList()
nsDOMTouchList(nsISupports* aParent)
: mParent(aParent)
{
SetIsDOMBinding();
nsJSContext::LikelyShortLivingObjectCreated();
}
nsDOMTouchList(nsISupports* aParent,
const nsTArray< nsRefPtr<Touch> >& aTouches)
: mParent(aParent)
, mPoints(aTouches)
{
SetIsDOMBinding();
nsJSContext::LikelyShortLivingObjectCreated();
}
nsDOMTouchList(nsTArray<nsCOMPtr<nsIDOMTouch> > &aTouches);
void Append(nsIDOMTouch* aPoint)
void Append(Touch* aPoint)
{
mPoints.AppendElement(aPoint);
}
nsIDOMTouch* GetItemAt(uint32_t aIndex)
virtual JSObject*
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
nsISupports* GetParentObject() const
{
return mPoints.SafeElementAt(aIndex, nullptr);
return mParent;
}
static bool PrefEnabled();
uint32_t Length() const
{
return mPoints.Length();
}
Touch* Item(uint32_t aIndex) const
{
return mPoints.SafeElementAt(aIndex);
}
Touch* IndexedGetter(uint32_t aIndex, bool& aFound) const
{
aFound = aIndex < mPoints.Length();
if (!aFound) {
return nullptr;
}
return mPoints[aIndex];
}
Touch* IdentifiedTouch(int32_t aIdentifier) const;
protected:
nsTArray<nsCOMPtr<nsIDOMTouch> > mPoints;
nsCOMPtr<nsISupports> mParent;
nsTArray< nsRefPtr<Touch> > mPoints;
};
class nsDOMTouchEvent : public nsDOMUIEvent,

View File

@ -131,16 +131,6 @@ nsDOMUIEvent::GetMovementPoint()
return current - last;
}
nsIntPoint
nsDOMUIEvent::GetClientPoint()
{
if (mIsPointerLocked) {
return mLastClientPoint;
}
return CalculateClientPoint(mPresContext, mEvent, &mClientPoint);
}
NS_IMETHODIMP
nsDOMUIEvent::GetView(nsIDOMWindow** aView)
{

View File

@ -12,10 +12,12 @@
#include "nsLayoutUtils.h"
#include "nsEvent.h"
#include "mozilla/dom/UIEventBinding.h"
#include "Units.h"
class nsDOMUIEvent : public nsDOMEvent,
public nsIDOMUIEvent
{
typedef mozilla::CSSIntPoint CSSIntPoint;
public:
nsDOMUIEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsGUIEvent* aEvent);
@ -55,9 +57,9 @@ public:
nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
}
static nsIntPoint CalculateClientPoint(nsPresContext* aPresContext,
nsEvent* aEvent,
nsIntPoint* aDefaultClientPoint)
static CSSIntPoint CalculateClientPoint(nsPresContext* aPresContext,
nsEvent* aEvent,
CSSIntPoint* aDefaultClientPoint)
{
if (!aEvent ||
(aEvent->eventStructType != NS_MOUSE_EVENT &&
@ -66,23 +68,24 @@ public:
aEvent->eventStructType != NS_DRAG_EVENT &&
aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||
!aPresContext ||
!((nsGUIEvent*)aEvent)->widget) {
return (nullptr == aDefaultClientPoint ? nsIntPoint(0, 0) :
nsIntPoint(aDefaultClientPoint->x, aDefaultClientPoint->y));
!static_cast<nsGUIEvent*>(aEvent)->widget) {
return aDefaultClientPoint
? *aDefaultClientPoint
: CSSIntPoint(0, 0);
}
nsPoint pt(0, 0);
nsIPresShell* shell = aPresContext->GetPresShell();
if (!shell) {
return nsIntPoint(0, 0);
return CSSIntPoint(0, 0);
}
nsIFrame* rootFrame = shell->GetRootFrame();
if (rootFrame) {
pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
if (!rootFrame) {
return CSSIntPoint(0, 0);
}
nsPoint pt =
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
nsPresContext::AppUnitsToIntCSSPixels(pt.y));
return CSSIntPoint::FromAppUnitsRounded(pt);
}
static already_AddRefed<nsDOMUIEvent> Constructor(const mozilla::dom::GlobalObject& aGlobal,
@ -141,19 +144,18 @@ public:
protected:
// Internal helper functions
nsIntPoint GetClientPoint();
nsIntPoint GetMovementPoint();
nsIntPoint GetLayerPoint() const;
nsCOMPtr<nsIDOMWindow> mView;
int32_t mDetail;
nsIntPoint mClientPoint;
CSSIntPoint mClientPoint;
// Screenpoint is mEvent->refPoint.
nsIntPoint mLayerPoint;
nsIntPoint mPagePoint;
CSSIntPoint mPagePoint;
nsIntPoint mMovementPoint;
bool mIsPointerLocked;
nsIntPoint mLastClientPoint;
CSSIntPoint mLastClientPoint;
typedef mozilla::widget::Modifiers Modifiers;
static Modifiers ComputeModifierState(const nsAString& aModifiersList);

View File

@ -122,7 +122,7 @@ nsWeakFrame nsEventStateManager::sLastDragOverFrame = nullptr;
nsIntPoint nsEventStateManager::sLastRefPoint = kInvalidRefPoint;
nsIntPoint nsEventStateManager::sLastScreenPoint = nsIntPoint(0,0);
nsIntPoint nsEventStateManager::sSynthCenteringPoint = kInvalidRefPoint;
nsIntPoint nsEventStateManager::sLastClientPoint = nsIntPoint(0,0);
CSSIntPoint nsEventStateManager::sLastClientPoint = CSSIntPoint(0, 0);
bool nsEventStateManager::sIsPointerLocked = false;
// Reference to the pointer locked element.
nsWeakPtr nsEventStateManager::sPointerLockedElement;
@ -1553,7 +1553,7 @@ nsEventStateManager::MapEventCoordinatesForChildProcess(
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(aEvent);
// Then offset all the touch points by that distance, to put them
// in the space where top-left is 0,0.
const nsTArray<nsCOMPtr<nsIDOMTouch> >& touches = touchEvent->touches;
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches;
for (uint32_t i = 0; i < touches.Length(); ++i) {
nsIDOMTouch* touch = touches[i];
if (touch) {
@ -1637,7 +1637,7 @@ nsEventStateManager::HandleCrossProcessEvent(nsEvent *aEvent,
// This loop is similar to the one used in
// PresShell::DispatchTouchEvent().
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(aEvent);
const nsTArray<nsCOMPtr<nsIDOMTouch> >& touches = touchEvent->touches;
const nsTArray< nsRefPtr<Touch> >& touches = touchEvent->touches;
for (uint32_t i = 0; i < touches.Length(); ++i) {
nsIDOMTouch* touch = touches[i];
// NB: the |mChanged| check is an optimization, subprocesses can

View File

@ -23,6 +23,7 @@
#include "nsEventStates.h"
#include "mozilla/TimeStamp.h"
#include "nsIFrame.h"
#include "Units.h"
class nsIPresShell;
class nsIContent;
@ -212,7 +213,7 @@ public:
// Holds the point in client coords of the last mouse event. Used by
// nsDOMEvent::GetClientCoords() to make mouse events' client coords appear
// frozen at the last mouse position while the pointer is locked.
static nsIntPoint sLastClientPoint;
static mozilla::CSSIntPoint sLastClientPoint;
static bool sIsPointerLocked;
static nsWeakPtr sPointerLockedElement;

View File

@ -55,31 +55,16 @@ nsPaintRequest::GetXPCOMReason(nsAString& aResult)
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequestList, mParent)
NS_INTERFACE_TABLE_HEAD(nsPaintRequestList)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsPaintRequestList)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_TABLE1(nsPaintRequestList, nsIDOMPaintRequestList)
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsPaintRequestList)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequestList)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequestList)
JSObject*
nsPaintRequestList::WrapObject(JSContext *cx, JS::Handle<JSObject*> scope)
nsPaintRequestList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
return mozilla::dom::PaintRequestListBinding::Wrap(cx, scope, this);
}
NS_IMETHODIMP
nsPaintRequestList::GetLength(uint32_t* aLength)
{
*aLength = Length();
return NS_OK;
}
NS_IMETHODIMP
nsPaintRequestList::Item(uint32_t aIndex, nsIDOMPaintRequest** aReturn)
{
NS_IF_ADDREF(*aReturn = Item(aIndex));
return NS_OK;
return PaintRequestListBinding::Wrap(aCx, aScope, this);
}

View File

@ -7,7 +7,6 @@
#define NSPAINTREQUEST_H_
#include "nsIDOMPaintRequest.h"
#include "nsIDOMPaintRequestList.h"
#include "nsPresContext.h"
#include "nsIDOMEvent.h"
#include "mozilla/Attributes.h"
@ -53,7 +52,7 @@ private:
nsInvalidateRequestList::Request mRequest;
};
class nsPaintRequestList MOZ_FINAL : public nsIDOMPaintRequestList,
class nsPaintRequestList MOZ_FINAL : public nsISupports,
public nsWrapperCache
{
public:
@ -64,10 +63,9 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPaintRequestList)
NS_DECL_NSIDOMPAINTREQUESTLIST
virtual JSObject* WrapObject(JSContext *cx,
JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
nsISupports* GetParentObject()
{
return mParent;
@ -78,23 +76,6 @@ public:
mArray.AppendElement(aElement);
}
static nsPaintRequestList* FromSupports(nsISupports* aSupports)
{
#ifdef DEBUG
{
nsCOMPtr<nsIDOMPaintRequestList> list_qi = do_QueryInterface(aSupports);
// If this assertion fires the QI implementation for the object in
// question doesn't use the nsIDOMClientRectList pointer as the nsISupports
// pointer. That must be fixed, or we'll crash...
NS_ASSERTION(list_qi == static_cast<nsIDOMPaintRequestList*>(aSupports),
"Uh, fix QI!");
}
#endif
return static_cast<nsPaintRequestList*>(aSupports);
}
uint32_t Length()
{
return mArray.Length();

View File

@ -6,16 +6,15 @@
#include "mozilla/dom/HTMLAnchorElement.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/HTMLAnchorElementBinding.h"
#include "mozilla/MemoryReporting.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "nsGkAtoms.h"
#include "nsIPresShell.h"
#include "nsIDocument.h"
#include "nsPresContext.h"
#include "nsHTMLDNSPrefetch.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Anchor)

View File

@ -8,11 +8,10 @@
#define mozilla_dom_HTMLAnchorElement_h
#include "mozilla/Attributes.h"
#include "mozilla/dom/Link.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsILink.h"
#include "Link.h"
#include "base/compiler_specific.h"
namespace mozilla {
namespace dom {
@ -28,7 +27,7 @@ public:
HTMLAnchorElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, ALLOW_THIS_IN_INITIALIZER_LIST(Link(this))
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
{
SetIsDOMBinding();
}

View File

@ -6,9 +6,9 @@
#include "mozilla/dom/HTMLAreaElement.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/HTMLAreaElementBinding.h"
#include "base/compiler_specific.h"
#include "mozilla/MemoryReporting.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Area)
@ -16,8 +16,8 @@ namespace mozilla {
namespace dom {
HTMLAreaElement::HTMLAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
ALLOW_THIS_IN_INITIALIZER_LIST(Link(this))
: nsGenericHTMLElement(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
{
SetIsDOMBinding();
}

View File

@ -8,12 +8,12 @@
#define mozilla_dom_HTMLAreaElement_h
#include "mozilla/Attributes.h"
#include "nsIDOMHTMLAreaElement.h"
#include "mozilla/dom/Link.h"
#include "nsGenericHTMLElement.h"
#include "nsILink.h"
#include "nsGkAtoms.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsILink.h"
#include "nsIURL.h"
#include "Link.h"
class nsIDocument;

View File

@ -5,25 +5,25 @@
#include "mozilla/dom/HTMLLinkElement.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/HTMLLinkElementBinding.h"
#include "base/compiler_specific.h"
#include "mozilla/MemoryReporting.h"
#include "nsAsyncDOMEvent.h"
#include "nsContentUtils.h"
#include "nsGenericHTMLElement.h"
#include "nsILink.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsIDOMStyleSheet.h"
#include "nsIStyleSheet.h"
#include "nsIStyleSheetLinkingElement.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsIURL.h"
#include "nsNetUtil.h"
#include "nsIDocument.h"
#include "nsIDOMEvent.h"
#include "nsContentUtils.h"
#include "nsIDOMStyleSheet.h"
#include "nsILink.h"
#include "nsIStyleSheet.h"
#include "nsIStyleSheetLinkingElement.h"
#include "nsIURL.h"
#include "nsNetUtil.h"
#include "nsPIDOMWindow.h"
#include "nsAsyncDOMEvent.h"
#include "nsReadableUtils.h"
#include "nsStyleConsts.h"
#include "nsUnicharUtils.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Link)
@ -31,8 +31,8 @@ namespace mozilla {
namespace dom {
HTMLLinkElement::HTMLLinkElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
ALLOW_THIS_IN_INITIALIZER_LIST(Link(this))
: nsGenericHTMLElement(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
{
SetIsDOMBinding();
}

View File

@ -7,11 +7,11 @@
#define mozilla_dom_HTMLLinkElement_h
#include "mozilla/Attributes.h"
#include "mozilla/dom/Link.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLLinkElement.h"
#include "nsILink.h"
#include "nsStyleLinkElement.h"
#include "mozilla/dom/Link.h"
namespace mozilla {
namespace dom {

View File

@ -33,8 +33,6 @@
#include "nsServiceManagerUtils.h"
#include "nsStyleConsts.h"
DOMCI_DATA(HTMLOptionsCollection, mozilla::dom::HTMLOptionsCollection)
namespace mozilla {
namespace dom {

View File

@ -6,12 +6,12 @@
#include "mozilla/dom/HTMLSelectElement.h"
#include "mozAutoDocUpdate.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLOptGroupElement.h"
#include "mozilla/dom/HTMLOptionElement.h"
#include "mozilla/dom/HTMLSelectElementBinding.h"
#include "mozilla/Util.h"
#include "base/compiler_specific.h"
#include "nsContentCreatorFunctions.h"
#include "nsError.h"
#include "nsEventDispatcher.h"
@ -104,7 +104,7 @@ SafeOptionListMutation::~SafeOptionListMutation()
HTMLSelectElement::HTMLSelectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElement(aNodeInfo),
ALLOW_THIS_IN_INITIALIZER_LIST(mOptions(new HTMLOptionsCollection(this))),
mOptions(new HTMLOptionsCollection(MOZ_THIS_IN_INITIALIZER_LIST())),
mIsDoneAddingChildren(!aFromParser),
mDisabledChanged(false),
mMutating(false),

View File

@ -711,6 +711,35 @@ HTMLTableElement::DeleteCaption()
return NS_OK;
}
already_AddRefed<nsGenericHTMLElement>
HTMLTableElement::CreateTBody()
{
nsCOMPtr<nsINodeInfo> nodeInfo =
OwnerDoc()->NodeInfoManager()->GetNodeInfo(nsGkAtoms::tbody, nullptr,
kNameSpaceID_XHTML,
nsIDOMNode::ELEMENT_NODE);
MOZ_ASSERT(nodeInfo);
nsCOMPtr<nsGenericHTMLElement> newBody =
NS_NewHTMLTableSectionElement(nodeInfo.forget());
MOZ_ASSERT(newBody);
nsIContent* referenceNode = nullptr;
for (nsIContent* child = nsINode::GetLastChild();
child;
child = child->GetPreviousSibling()) {
if (child->IsHTML(nsGkAtoms::tbody)) {
referenceNode = child->GetNextSibling();
break;
}
}
ErrorResult rv;
nsINode::InsertBefore(*newBody, referenceNode, rv);
return newBody.forget();
}
already_AddRefed<nsGenericHTMLElement>
HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
{

View File

@ -93,6 +93,9 @@ public:
already_AddRefed<nsGenericHTMLElement> CreateTFoot();
nsIHTMLCollection* TBodies();
already_AddRefed<nsGenericHTMLElement> CreateTBody();
nsIHTMLCollection* Rows();
already_AddRefed<nsGenericHTMLElement> InsertRow(int32_t aIndex,

View File

@ -5,39 +5,38 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/HTMLTextAreaElement.h"
#include "mozAutoDocUpdate.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/HTMLTextAreaElementBinding.h"
#include "mozilla/Util.h"
#include "base/compiler_specific.h"
#include "nsIControllers.h"
#include "nsFocusManager.h"
#include "nsPIDOMWindow.h"
#include "nsAttrValueInlines.h"
#include "nsContentCID.h"
#include "nsContentCreatorFunctions.h"
#include "nsError.h"
#include "nsEventDispatcher.h"
#include "nsFocusManager.h"
#include "nsFormSubmission.h"
#include "nsGUIEvent.h"
#include "nsIComponentManager.h"
#include "nsIConstraintValidation.h"
#include "nsIControllers.h"
#include "nsIDocument.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIFormControlFrame.h"
#include "nsIFormControl.h"
#include "nsIForm.h"
#include "nsFormSubmission.h"
#include "nsAttrValueInlines.h"
#include "nsStyleConsts.h"
#include "nsPresContext.h"
#include "nsMappedAttributes.h"
#include "nsIFormControlFrame.h"
#include "nsITextControlFrame.h"
#include "nsLinebreakConverter.h"
#include "nsIDocument.h"
#include "nsIFrame.h"
#include "nsGUIEvent.h"
#include "nsISupportsPrimitives.h"
#include "nsITextControlFrame.h"
#include "nsLayoutUtils.h"
#include "nsLinebreakConverter.h"
#include "nsMappedAttributes.h"
#include "nsPIDOMWindow.h"
#include "nsPresContext.h"
#include "nsPresState.h"
#include "nsReadableUtils.h"
#include "nsEventDispatcher.h"
#include "nsLayoutUtils.h"
#include "nsError.h"
#include "mozAutoDocUpdate.h"
#include "nsISupportsPrimitives.h"
#include "nsContentCreatorFunctions.h"
#include "nsIConstraintValidation.h"
#include "nsStyleConsts.h"
#include "nsTextEditorState.h"
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
@ -59,7 +58,7 @@ HTMLTextAreaElement::HTMLTextAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo
mDisabledChanged(false),
mCanShowInvalidUI(true),
mCanShowValidUI(true),
ALLOW_THIS_IN_INITIALIZER_LIST(mState(this))
mState(MOZ_THIS_IN_INITIALIZER_LIST())
{
AddMutationObserver(this);

View File

@ -1072,20 +1072,20 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain, ErrorResult& rv)
nsGenericHTMLElement*
nsHTMLDocument::GetBody()
{
Element* body = GetBodyElement();
if (body) {
// There is a body element, return that as the body.
return static_cast<nsGenericHTMLElement*>(body);
Element* html = GetHtmlElement();
if (!html) {
return nullptr;
}
// The document is most likely a frameset document so look for the
// outer most frameset element
nsRefPtr<nsContentList> nodeList =
NS_GetContentList(this, kNameSpaceID_XHTML, NS_LITERAL_STRING("frameset"));
Element* frameset = nodeList->GetElementAt(0);
MOZ_ASSERT(!frameset || frameset->IsHTML());
return static_cast<nsGenericHTMLElement*>(frameset);
for (nsIContent* child = html->GetFirstChild();
child;
child = child->GetNextSibling()) {
if (child->IsHTML(nsGkAtoms::body) || child->IsHTML(nsGkAtoms::frameset)) {
return static_cast<nsGenericHTMLElement*>(child);
}
}
return nullptr;
}
NS_IMETHODIMP

View File

@ -68,7 +68,6 @@ MOCHITEST_FILES = test_bug1682.html \
bug499092.xml \
bug499092.html \
test_bug512367.html \
test_bug571981.html \
test_bug677495.html \
test_bug677495-1.html \
test_bug741266.html \

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