Merge m-c to b2g-i

This commit is contained in:
Wes Kocher 2013-09-24 20:33:48 -07:00
commit 4f43d45377
974 changed files with 24413 additions and 14813 deletions

View File

@ -23,7 +23,7 @@ endif
include $(topsrcdir)/config/config.mk
GARBAGE_DIRS += dist _javagen _profile _tests staticlib
GARBAGE_DIRS += dist _javagen _profile staticlib
DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
config/autoconf.mk \
mozilla-config.h \
@ -81,6 +81,13 @@ install-manifests: install-tests
install-tests: $(install_manifest_depends)
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )_tests _build_manifests/install/tests js/src/_build_manifests/install/tests)
# _tests should be purged during cleaning. However, we don't want it purged
# during PGO builds because it contains some auto-generated files.
ifneq ($(filter-out maybe_clobber_profiledbuild,$(MAKECMDGOALS)),)
GARBAGE_DIRS += _tests
endif
# Windows PGO builds don't perform a clean before the 2nd pass. So, we want
# to preserve content for the 2nd pass on Windows. Everywhere else, we always
# process the install manifests as part of export.

View File

@ -23,7 +23,7 @@ interface nsIAccessibleRelation;
* Mozilla creates the implementations of nsIAccessible on demand.
* See http://www.mozilla.org/projects/ui/accessibility for more information.
*/
[scriptable, uuid(45600c50-b06a-11e1-afa6-0800200c9a66)]
[scriptable, uuid(ee62158b-bb83-424b-a88d-d7d7f9cf460d)]
interface nsIAccessible : nsISupports
{
/**
@ -167,6 +167,7 @@ interface nsIAccessible : nsISupports
* inclusive of the current item
* @param positionInGroup - 1-based, similar to ARIA 'posinset' property
*/
[binaryname(ScriptableGroupPosition)]
void groupPosition(out long aGroupLevel, out long aSimilarItemsInGroup,
out long aPositionInGroup);

View File

@ -1460,9 +1460,9 @@ Accessible::GroupPosition()
}
NS_IMETHODIMP
Accessible::GroupPosition(int32_t* aGroupLevel,
int32_t* aSimilarItemsInGroup,
int32_t* aPositionInGroup)
Accessible::ScriptableGroupPosition(int32_t* aGroupLevel,
int32_t* aSimilarItemsInGroup,
int32_t* aPositionInGroup)
{
NS_ENSURE_ARG_POINTER(aGroupLevel);
*aGroupLevel = 0;

View File

@ -1783,6 +1783,14 @@ DocAccessible::UpdateTree(Accessible* aContainer, nsIContent* aChildNode,
nsINode* containerNode = aContainer->GetNode();
for (uint32_t idx = 0; idx < aContainer->ContentChildCount();) {
Accessible* child = aContainer->ContentChildAt(idx);
// If accessible doesn't have its own content then we assume parent
// will handle its update.
if (!child->HasOwnContent()) {
idx++;
continue;
}
nsINode* childNode = child->GetContent();
while (childNode != aChildNode && childNode != containerNode &&
(childNode = childNode->GetParentNode()));

View File

@ -30,10 +30,20 @@
testStates("plugin-windowless", STATE_UNAVAILABLE);
testAccessibleTree("plugin-windowless", { EMBEDDED_OBJECT: [ ] });
testStates("plugin-windowless-fallback", STATE_UNAVAILABLE);
testAccessibleTree("plugin-windowless-fallback", { EMBEDDED_OBJECT: [ ] });
testStates("plugin-windowed", 0, 0, STATE_UNAVAILABLE);
testAccessibleTree("plugin-windowed", { EMBEDDED_OBJECT: [ { NOTHING: [] } ] });
SimpleTest.finish();
testStates("plugin-windowed-fallback", 0, 0, STATE_UNAVAILABLE);
testAccessibleTree("plugin-windowed-fallback",
{ EMBEDDED_OBJECT: [ { NOTHING: [] } ] });
// make sure we handle content changes under the plugin.
getNode("fallback1").setAttribute("href", "5");
getNode("fallback2").setAttribute("href", "5");
SimpleTest.executeSoon(function () { SimpleTest.finish(); });
}
SimpleTest.waitForExplicitFinish();
@ -49,6 +59,9 @@
<a target="_blank"
title="Embedded object accessibles for inaccessible/windowless plugins should not expose a NULL child"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=816856">Bug 816856</a>
<a target="_blank"
title="Updating accessible tree for plugin with fallback shouldn't crash"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=881636">Bug 881636</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -58,5 +71,9 @@
width="300" height="300"></embed>
<embed id="plugin-windowed" type="application/x-test" wmode="window"
width="300" height="300"></embed>
<embed id="plugin-windowless-fallback" type="application/x-test"
width="300" height="300"><a id="fallback1">foo</a></embed>
<embed id="plugin-windowed-fallback" type="application/x-test" wmode="window"
width="300" height="300"><a id="fallback2">foo</a></embed>
</body>
</html>

View File

@ -71,6 +71,7 @@
}
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
addA11yLoadEvent(waitForPlugin);
</script>
</head>

View File

@ -316,8 +316,21 @@ var gPluginHandler = {
// Hide the in-content UI if it's too big. The crashed plugin handler already did this.
if (eventType != "PluginCrashed" && eventType != "PluginRemoved") {
let overlay = this.getPluginUI(plugin, "main");
if (overlay != null && this.isTooSmall(plugin, overlay))
overlay.style.visibility = "hidden";
if (overlay != null) {
if (!this.isTooSmall(plugin, overlay))
overlay.style.visibility = "visible";
plugin.addEventListener("overflow", function(event) {
overlay.style.visibility = "hidden";
});
plugin.addEventListener("underflow", function(event) {
// this is triggered if only one dimension underflows,
// the other dimension might still overflow
if (!gPluginHandler.isTooSmall(plugin, overlay)) {
overlay.style.visibility = "visible";
}
});
}
}
// Only show the notification after we've done the isTooSmall check, so

View File

@ -4904,17 +4904,16 @@
<method name="_calcMouseTargetRect">
<body><![CDATA[
let alignRight = false;
let container = this.parentNode;
let alignRight = (getComputedStyle(container).direction == "rtl");
let panelRect = this.getBoundingClientRect();
let containerRect = container.getBoundingClientRect();
if (getComputedStyle(document.documentElement).direction == "rtl")
alignRight = !alignRight;
let rect = this.getBoundingClientRect();
this._mouseTargetRect = {
top: rect.top,
bottom: rect.bottom,
left: alignRight ? window.innerWidth - rect.width : 0,
right: alignRight ? window.innerWidth : rect.width
top: panelRect.top,
bottom: panelRect.bottom,
left: alignRight ? containerRect.right - panelRect.width : containerRect.left,
right: alignRight ? containerRect.right : containerRect.left + panelRect.width
};
]]></body>
</method>

View File

@ -0,0 +1,7 @@
# 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/.
MOCHITEST_CHROME_FILES = \
test_aboutCrashed.xul \
$(NULL)

View File

@ -4,11 +4,3 @@
# 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/.
XPCSHELL_TESTS_MANIFESTS += ['bar/xpcshell.ini', 'foo/xpcshell.ini']
XPCSHELL_TESTS_MANIFESTS += ['tans/xpcshell.ini']
if CONFIG['DISABLED_VAR']:
XPCSHELL_TESTS_MANIFESTS += ['disabled_var/xpcshell.ini']
if not CONFIG['DISABLED_VAR']:
XPCSHELL_TESTS_MANIFESTS += ['enabled_var/xpcshell.ini']

View File

@ -0,0 +1,86 @@
<?xml version="1.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/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<iframe type="content" id="frame1"/>
<iframe type="content" id="frame2" onload="doTest()"/>
<script type="application/javascript"><![CDATA[
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
SimpleTest.waitForExplicitFinish();
// Load error pages do not fire "load" events, so let's use a progressListener.
function waitForErrorPage(frame) {
let errorPageDeferred = Promise.defer();
let progressListener = {
onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
frame.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebProgress)
.removeProgressListener(progressListener,
Ci.nsIWebProgress.NOTIFY_LOCATION);
errorPageDeferred.resolve();
}
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
Ci.nsISupportsWeakReference])
};
frame.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebProgress)
.addProgressListener(progressListener,
Ci.nsIWebProgress.NOTIFY_LOCATION);
return errorPageDeferred.promise;
}
function doTest() {
Task.spawn(function test_aboutCrashed() {
let frame1 = document.getElementById("frame1");
let frame2 = document.getElementById("frame2");
let uri1 = Services.io.newURI("http://www.example.com/1", null, null);
let uri2 = Services.io.newURI("http://www.example.com/2", null, null);
let errorPageReady = waitForErrorPage(frame1);
frame1.docShell.chromeEventHandler.setAttribute("crashedPageTitle", "pageTitle");
frame1.docShell.displayLoadError(Components.results.NS_ERROR_CONTENT_CRASHED, uri1, null);
yield errorPageReady;
frame1.docShell.chromeEventHandler.removeAttribute("crashedPageTitle");
SimpleTest.is(frame1.contentDocument.documentURI,
"about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/1&c=UTF-8&d=pageTitle",
"Correct about:tabcrashed displayed for page with title.");
errorPageReady = waitForErrorPage(frame2);
frame2.docShell.displayLoadError(Components.results.NS_ERROR_CONTENT_CRASHED, uri2, null);
yield errorPageReady;
SimpleTest.is(frame2.contentDocument.documentURI,
"about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/2&c=UTF-8&d=%20",
"Correct about:tabcrashed displayed for page with no title.");
SimpleTest.finish();
});
}
]]></script>
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;" />
</window>

View File

@ -192,6 +192,7 @@ MOCHITEST_BROWSER_FILES = \
browser_contextSearchTabPosition.js \
browser_CTP_drag_drop.js \
browser_CTP_data_urls.js \
browser_CTP_resize.js \
browser_ctrlTab.js \
browser_customize_popupNotification.js \
browser_customize.js \
@ -316,6 +317,7 @@ MOCHITEST_BROWSER_FILES = \
plugin_clickToPlayAllow.html \
plugin_clickToPlayDeny.html \
plugin_hidden_to_visible.html \
plugin_small.html \
plugin_test.html \
plugin_test2.html \
plugin_test3.html \

View File

@ -0,0 +1,162 @@
var rootDir = getRootDirectory(gTestPath);
const gTestRoot = rootDir;
const gHttpTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
var gTestBrowser = null;
var gNextTest = null;
var gPluginHost = Components.classes["@mozilla.org/plugin/host;1"].getService(Components.interfaces.nsIPluginHost);
Components.utils.import("resource://gre/modules/Services.jsm");
// This listens for the next opened tab and checks it is of the right url.
// opencallback is called when the new tab is fully loaded
// closecallback is called when the tab is closed
function TabOpenListener(url, opencallback, closecallback) {
this.url = url;
this.opencallback = opencallback;
this.closecallback = closecallback;
gBrowser.tabContainer.addEventListener("TabOpen", this, false);
}
TabOpenListener.prototype = {
url: null,
opencallback: null,
closecallback: null,
tab: null,
browser: null,
handleEvent: function(event) {
if (event.type == "TabOpen") {
gBrowser.tabContainer.removeEventListener("TabOpen", this, false);
this.tab = event.originalTarget;
this.browser = this.tab.linkedBrowser;
gBrowser.addEventListener("pageshow", this, false);
} else if (event.type == "pageshow") {
if (event.target.location.href != this.url)
return;
gBrowser.removeEventListener("pageshow", this, false);
this.tab.addEventListener("TabClose", this, false);
var url = this.browser.contentDocument.location.href;
is(url, this.url, "Should have opened the correct tab");
this.opencallback(this.tab, this.browser.contentWindow);
} else if (event.type == "TabClose") {
if (event.originalTarget != this.tab)
return;
this.tab.removeEventListener("TabClose", this, false);
this.opencallback = null;
this.tab = null;
this.browser = null;
// Let the window close complete
executeSoon(this.closecallback);
this.closecallback = null;
}
}
};
function test() {
waitForExplicitFinish();
registerCleanupFunction(function() {
clearAllPluginPermissions();
Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
});
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
var newTab = gBrowser.addTab();
gBrowser.selectedTab = newTab;
gTestBrowser = gBrowser.selectedBrowser;
gTestBrowser.addEventListener("load", pageLoad, true);
Services.prefs.setBoolPref("plugins.click_to_play", true);
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
prepareTest(runAfterPluginBindingAttached(test1), gHttpTestRoot + "plugin_small.html");
}
function finishTest() {
clearAllPluginPermissions();
gTestBrowser.removeEventListener("load", pageLoad, true);
gBrowser.removeCurrentTab();
window.focus();
finish();
}
function pageLoad() {
// The plugin events are async dispatched and can come after the load event
// This just allows the events to fire before we then go on to test the states
executeSoon(gNextTest);
}
function prepareTest(nextTest, url) {
gNextTest = nextTest;
gTestBrowser.contentWindow.location = url;
}
// Due to layout being async, "PluginBindAttached" may trigger later.
// This wraps a function to force a layout flush, thus triggering it,
// and schedules the function execution so they're definitely executed
// afterwards.
function runAfterPluginBindingAttached(func) {
return function() {
let doc = gTestBrowser.contentDocument;
let elems = doc.getElementsByTagName('embed');
if (elems.length < 1) {
elems = doc.getElementsByTagName('object');
}
elems[0].clientTop;
executeSoon(func);
};
}
// Test that the overlay is hidden for "small" plugin elements and is shown
// once they are resized to a size that can hold the overlay
function test1() {
let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
ok(popupNotification, "Test 1, Should have a click-to-play notification");
let plugin = gTestBrowser.contentDocument.getElementById("test");
let doc = gTestBrowser.contentDocument;
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
ok(overlay, "Test 1, Should have an overlay.");
is(window.getComputedStyle(overlay).visibility, 'hidden', "Test 1, Overlay should be hidden");
plugin.style.width = '300px';
executeSoon(test2);
}
function test2() {
let plugin = gTestBrowser.contentDocument.getElementById("test");
let doc = gTestBrowser.contentDocument;
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
ok(overlay, "Test 2, Should have an overlay.");
is(window.getComputedStyle(overlay).visibility, 'hidden', "Test 2, Overlay should be hidden");
plugin.style.height = '300px';
let condition = () => window.getComputedStyle(overlay).visibility == 'visible';
waitForCondition(condition, test3, "Test 2, Waited too long for overlay to become visible");
}
function test3() {
let plugin = gTestBrowser.contentDocument.getElementById("test");
let doc = gTestBrowser.contentDocument;
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
ok(overlay, "Test 3, Should have an overlay.");
is(window.getComputedStyle(overlay).visibility, 'visible', "Test 3, Overlay should be visible");
plugin.style.width = '10px';
plugin.style.height = '10px';
let condition = () => window.getComputedStyle(overlay).visibility == 'hidden';
waitForCondition(condition, test4, "Test 3, Waited too long for overlay to become hidden");
}
function test4() {
let plugin = gTestBrowser.contentDocument.getElementById("test");
let doc = gTestBrowser.contentDocument;
let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
ok(overlay, "Test 4, Should have an overlay.");
is(window.getComputedStyle(overlay).visibility, 'hidden', "Test 4, Overlay should be hidden");
clearAllPluginPermissions();
finishTest();
}

View File

@ -111,6 +111,18 @@ function getTestPlugin(aName) {
return null;
}
// call this to set the test plugin(s) initially expected enabled state.
// it will automatically be reset to it's previous value after the test
// ends
function setTestPluginEnabledState(newEnabledState, pluginName) {
var plugin = getTestPlugin(pluginName);
var oldEnabledState = plugin.enabledState;
plugin.enabledState = newEnabledState;
SimpleTest.registerCleanupFunction(function() {
getTestPlugin(pluginName).enabledState = oldEnabledState;
});
}
// after a test is done using the plugin doorhanger, we should just clear
// any permissions that may have crept in
function clearAllPluginPermissions() {

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<embed id="test" style="width: 10px; height: 10px" type="application/x-test">
</body>
</html>

View File

@ -4,5 +4,5 @@
# 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/.
DIRS += ['general', 'newtab', 'social']
DIRS += ['chrome', 'general', 'newtab', 'social']

View File

@ -1127,7 +1127,7 @@ var ViewMenu = {
* Set up the content of the view menu.
*/
populateSortMenu: function VM_populateSortMenu(event) {
this.fillWithColumns(event, "viewUnsorted", "directionSeparator", "radio", "view.sortBy.");
this.fillWithColumns(event, "viewUnsorted", "directionSeparator", "radio", "view.sortBy.1.");
var sortColumn = this._getSortColumn();
var viewSortAscending = document.getElementById("viewSortAscending");

View File

@ -384,7 +384,7 @@
<treecol label="&col.url.label;" id="placesContentUrl" anonid="url" flex="5"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.lastvisit.label;" id="placesContentDate" anonid="date" flex="1" hidden="true"
<treecol label="&col.mostrecentvisit.label;" id="placesContentDate" anonid="date" flex="1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol label="&col.visitcount.label;" id="placesContentVisitCount" anonid="visitCount" flex="1" hidden="true"

View File

@ -1,7 +1,12 @@
[DEFAULT]
head = head_bookmarks.js
tail =
tail =
firefox-appdir = browser
support-files =
bookmarks.glue.html
bookmarks.glue.json
corruptDB.sqlite
distribution.ini
[test_421483.js]
[test_browserGlue_corrupt.js]

View File

@ -2585,7 +2585,6 @@ let SessionStoreInternal = {
restoreHistory:
function ssi_restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap,
aRestoreImmediately) {
var _this = this;
// if the tab got removed before being completely restored, then skip it
while (aTabs.length > 0 && !(this._canRestoreTabHistory(aTabs[0]))) {
aTabs.shift();
@ -2654,9 +2653,11 @@ let SessionStoreInternal = {
tab.dispatchEvent(event);
// Restore the history in the next tab
aWindow.setTimeout(function(){
_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap,
aRestoreImmediately);
aWindow.setTimeout(() => {
if (!aWindow.closed) {
this.restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap,
aRestoreImmediately);
}
}, 0);
// This could cause us to ignore MAX_CONCURRENT_TAB_RESTORES a bit, but

View File

@ -2,6 +2,7 @@
head = head.js
tail =
firefox-appdir = browser
support-files = data/sessionstore_valid.js
[test_backup.js]
[test_backup_once.js]

View File

@ -61,6 +61,9 @@ let UI = {
this.template = new Template(document.body, this.store, Utils.l10n);
this.template.start();
this._onSimulatorConnected = this._onSimulatorConnected.bind(this);
this._onSimulatorDisconnected = this._onSimulatorDisconnected.bind(this);
},
useFloatingScrollbarsIfNeeded: function() {
@ -136,16 +139,25 @@ let UI = {
this.connection.log("Simulator ready. Connecting.");
this.connection.port = port;
this.connection.host = "localhost";
this.connection.once("connected", () => {
this.connection.log("Connected to simulator.");
this.connection.keepConnecting = false;
});
this.connection.once("connected",
this._onSimulatorConnected);
this.connection.once("disconnected",
this._onSimulatorDisconnected);
this.connection.keepConnecting = true;
this.connection.connect();
});
document.body.classList.remove("show-simulators");
},
_onSimulatorConnected: function() {
this.connection.log("Connected to simulator.");
this.connection.keepConnecting = false;
},
_onSimulatorDisconnected: function() {
this.connection.off("connected", this._onSimulatorConnected);
},
connectToAdbDevice: function(name) {
let device = Devices.getByName(name);
device.connect().then((port) => {

View File

@ -8,6 +8,9 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
function test() {
// Debug test slaves are a bit slow at this test.
requestLongerTimeout(2);
let gTab, gDebuggee, gPanel, gDebugger;
let gEditor, gSources, gBreakpoints;

View File

@ -23,46 +23,44 @@ function test() {
}
function performTest() {
Services.tm.currentThread.dispatch({ run: function() {
ok(gProcess._dbgProcess,
"The remote debugger process wasn't created properly!");
ok(gProcess._dbgProcess.isRunning,
"The remote debugger process isn't running!");
is(typeof gProcess._dbgProcess.pid, "number",
"The remote debugger process doesn't have a pid (?!)");
ok(gProcess._dbgProcess,
"The remote debugger process wasn't created properly!");
ok(gProcess._dbgProcess.isRunning,
"The remote debugger process isn't running!");
is(typeof gProcess._dbgProcess.pid, "number",
"The remote debugger process doesn't have a pid (?!)");
info("process location: " + gProcess._dbgProcess.location);
info("process pid: " + gProcess._dbgProcess.pid);
info("process name: " + gProcess._dbgProcess.processName);
info("process sig: " + gProcess._dbgProcess.processSignature);
info("process location: " + gProcess._dbgProcess.location);
info("process pid: " + gProcess._dbgProcess.pid);
info("process name: " + gProcess._dbgProcess.processName);
info("process sig: " + gProcess._dbgProcess.processSignature);
ok(gProcess._dbgProfile,
"The remote debugger profile wasn't created properly!");
ok(gProcess._dbgProfile.localDir,
"The remote debugger profile doesn't have a localDir...");
ok(gProcess._dbgProfile.rootDir,
"The remote debugger profile doesn't have a rootDir...");
ok(gProcess._dbgProfile.name,
"The remote debugger profile doesn't have a name...");
ok(gProcess._dbgProfile,
"The remote debugger profile wasn't created properly!");
ok(gProcess._dbgProfile.localDir,
"The remote debugger profile doesn't have a localDir...");
ok(gProcess._dbgProfile.rootDir,
"The remote debugger profile doesn't have a rootDir...");
ok(gProcess._dbgProfile.name,
"The remote debugger profile doesn't have a name...");
info("profile localDir: " + gProcess._dbgProfile.localDir.path);
info("profile rootDir: " + gProcess._dbgProfile.rootDir.path);
info("profile name: " + gProcess._dbgProfile.name);
info("profile localDir: " + gProcess._dbgProfile.localDir.path);
info("profile rootDir: " + gProcess._dbgProfile.rootDir.path);
info("profile name: " + gProcess._dbgProfile.name);
let profileService = Cc["@mozilla.org/toolkit/profile-service;1"]
.createInstance(Ci.nsIToolkitProfileService);
let profileService = Cc["@mozilla.org/toolkit/profile-service;1"]
.createInstance(Ci.nsIToolkitProfileService);
let profile = profileService.getProfileByName(gProcess._dbgProfile.name);
let profile = profileService.getProfileByName(gProcess._dbgProfile.name);
ok(profile,
"The remote debugger profile wasn't *actually* created properly!");
is(profile.localDir.path, gProcess._dbgProfile.localDir.path,
"The remote debugger profile doesn't have the correct localDir!");
is(profile.rootDir.path, gProcess._dbgProfile.rootDir.path,
"The remote debugger profile doesn't have the correct rootDir!");
ok(profile,
"The remote debugger profile wasn't *actually* created properly!");
is(profile.localDir.path, gProcess._dbgProfile.localDir.path,
"The remote debugger profile doesn't have the correct localDir!");
is(profile.rootDir.path, gProcess._dbgProfile.rootDir.path,
"The remote debugger profile doesn't have the correct rootDir!");
gProcess.close();
}}, 0);
gProcess.close();
}
function aOnClose() {

View File

@ -46,7 +46,7 @@ function testSetBreakpoint() {
let deferred = promise.defer();
gDebugger.gThreadClient.interrupt(aResponse => {
gDebugger.gThreadClient.setBreakpoint({ url: JS_URL, line: 30, column: 10 }, aResponse => {
gDebugger.gThreadClient.setBreakpoint({ url: JS_URL, line: 30, column: 21 }, aResponse => {
ok(!aResponse.error,
"Should be able to set a breakpoint in a js file.");
ok(!aResponse.actualLocation,

View File

@ -0,0 +1,40 @@
/* 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/. */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
function devtoolsCommandlineHandler() {
}
devtoolsCommandlineHandler.prototype = {
handle: function(cmdLine) {
if (!cmdLine.handleFlag("jsconsole", false)) {
return;
}
Cu.import("resource://gre/modules/Services.jsm");
let window = Services.wm.getMostRecentWindow("devtools:webconsole");
if (!window) {
let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
// Load the browser devtools main module as the loader's main module.
devtools.main("main");
let hudservice = devtools.require("devtools/webconsole/hudservice");
let console = Cu.import("resource://gre/modules/devtools/Console.jsm", {}).console;
hudservice.toggleBrowserConsole().then(null, console.error);
} else {
window.focus(); // the Browser Console was already open
}
if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO) {
cmdLine.preventDefault = true;
}
},
helpInfo : " -jsconsole Open the Browser Console.\n",
classID: Components.ID("{9e9a9283-0ce9-4e4a-8f1c-ba129a032c32}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([devtoolsCommandlineHandler]);

View File

@ -0,0 +1,2 @@
component {9e9a9283-0ce9-4e4a-8f1c-ba129a032c32} devtools-clhandler.js
contract @mozilla.org/toolkit/console-clh;1 {9e9a9283-0ce9-4e4a-8f1c-ba129a032c32}

View File

@ -40,9 +40,6 @@ function OptionsPanel(iframeWindow, toolbox) {
this.toolbox = toolbox;
this.isReady = false;
// Make restart method available from xul
this.panelWin.restart = this.restart;
EventEmitter.decorate(this);
};
@ -57,7 +54,6 @@ OptionsPanel.prototype = {
this.setupToolsList();
this.populatePreferences();
this.prepareRestartPreferences();
this._disableJSClicked = this._disableJSClicked.bind(this);
@ -201,34 +197,6 @@ OptionsPanel.prototype = {
}
},
/**
* Handles checkbox click inside hbox with class "hidden-labels-box". The
* labels inside the hbox are shown again when the user click on the checkbox
* in the box.
*/
prepareRestartPreferences: function() {
let checkboxes = this.panelDoc.querySelectorAll(".hidden-labels-box > checkbox");
for (let checkbox of checkboxes) {
checkbox.addEventListener("command", function(target) {
target.parentNode.classList.toggle("visible");
}.bind(null, checkbox));
}
},
restart: function() {
let canceled = Cc["@mozilla.org/supports-PRBool;1"]
.createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(canceled, "quit-application-requested", "restart");
if (canceled.data) {
return;
}
// restart
Cc['@mozilla.org/toolkit/app-startup;1']
.getService(Ci.nsIAppStartup)
.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
},
/**
* Disables JavaScript for the currently loaded tab. We force a page refresh
* here because setting docShell.allowJavascript to true fails to block JS

View File

@ -74,21 +74,11 @@
<checkbox label="&options.enableChrome.label3;"
tooltiptext="&options.enableChrome.tooltip;"
data-pref="devtools.chrome.enabled"/>
<label class="options-citation-label"
value="&options.context.requiresRestart2;"/>
<label class="text-link"
onclick="restart()"
value="&options.restartButton.label;"/>
</hbox>
<hbox class="hidden-labels-box">
<checkbox label="&options.enableRemote.label3;"
tooltiptext="&options.enableRemote.tooltip;"
data-pref="devtools.debugger.remote-enabled"/>
<label class="options-citation-label"
value="&options.context.requiresRestart2;"/>
<label class="text-link"
onclick="restart()"
value="&options.restartButton.label;"/>
</hbox>
</vbox>
</vbox>

View File

@ -168,7 +168,7 @@ InspectorPanel.prototype = {
// as default selected, else set documentElement
return walker.getRootNode().then(aRootNode => {
rootNode = aRootNode;
return walker.querySelector(aRootNode, this.selectionCssSelector);
return walker.querySelector(rootNode, this.selectionCssSelector);
}).then(front => {
if (front) {
return front;
@ -729,15 +729,6 @@ InspectorPanel.prototype = {
}
},
/**
* Trigger a high-priority layout change for things that need to be
* updated immediately
*/
immediateLayoutChange: function Inspector_immediateLayoutChange()
{
this.emit("layout-change");
},
/**
* Schedule a low-priority change event for things like paint
* and resize.

View File

@ -43,5 +43,7 @@ MOCHITEST_BROWSER_FILES := \
browser_inspector_select_last_selected.html \
browser_inspector_select_last_selected2.html \
browser_inspector_basic_highlighter.js \
browser_inspector_dead_node_exception.html \
browser_inspector_dead_node_exception.js \
head.js \
$(NULL)

View File

@ -17,7 +17,7 @@ function test() {
}
function getInspectorComputedProp(aName)
function getInspectorProp(aName)
{
let computedview = inspector.sidebar.getWindowForTab("computedview").computedview.view;
for each (let view in computedview.propertyViews) {
@ -27,18 +27,6 @@ function test() {
}
return null;
}
function getInspectorRuleProp(aName)
{
let ruleview = inspector.sidebar.getWindowForTab("ruleview").ruleview.view;
let inlineStyles = ruleview._elementStyle.rules[0];
for each (let prop in inlineStyles.textProps) {
if (prop.name == aName) {
return prop;
}
}
return null;
}
function runInspectorTests(aInspector)
{
@ -52,93 +40,50 @@ function test() {
testDiv.style.fontSize = "10px";
// Start up the style inspector panel...
inspector.once("computed-view-refreshed", computedStylePanelTests);
inspector.once("computed-view-refreshed", stylePanelTests);
inspector.selection.setNode(testDiv);
});
}
function computedStylePanelTests()
function stylePanelTests()
{
let computedview = inspector.sidebar.getWindowForTab("computedview").computedview;
ok(computedview, "Style Panel has a cssHtmlTree");
let propView = getInspectorComputedProp("font-size");
let propView = getInspectorProp("font-size");
is(propView.value, "10px", "Style inspector should be showing the correct font size.");
inspector.once("computed-view-refreshed", computedStylePanelAfterChange);
inspector.once("computed-view-refreshed", stylePanelAfterChange);
testDiv.style.cssText = "font-size: 15px; color: red;";
testDiv.style.fontSize = "15px";
inspector.emit("layout-change");
}
function computedStylePanelAfterChange()
function stylePanelAfterChange()
{
let propView = getInspectorComputedProp("font-size");
let propView = getInspectorProp("font-size");
is(propView.value, "15px", "Style inspector should be showing the new font size.");
let propView = getInspectorComputedProp("color");
is(propView.value, "#F00", "Style inspector should be showing the new color.");
computedStylePanelNotActive();
stylePanelNotActive();
}
function computedStylePanelNotActive()
function stylePanelNotActive()
{
// Tests changes made while the style panel is not active.
inspector.sidebar.select("ruleview");
testDiv.style.fontSize = "20px";
testDiv.style.color = "blue";
testDiv.style.textAlign = "center";
inspector.once("computed-view-refreshed", computedStylePanelAfterSwitch);
inspector.sidebar.select("computedview");
executeSoon(function() {
inspector.once("computed-view-refreshed", stylePanelAfterSwitch);
testDiv.style.fontSize = "20px";
inspector.sidebar.select("computedview");
});
}
function computedStylePanelAfterSwitch()
function stylePanelAfterSwitch()
{
let propView = getInspectorComputedProp("font-size");
is(propView.value, "20px", "Style inspector should be showing the new font size.");
let propView = getInspectorComputedProp("color");
is(propView.value, "#00F", "Style inspector should be showing the new color.");
let propView = getInspectorComputedProp("text-align");
is(propView.value, "center", "Style inspector should be showing the new text align.");
rulePanelTests();
}
function rulePanelTests()
{
inspector.sidebar.select("ruleview");
let ruleview = inspector.sidebar.getWindowForTab("ruleview").ruleview;
ok(ruleview, "Style Panel has a ruleview");
let propView = getInspectorRuleProp("text-align");
is(propView.value, "center", "Style inspector should be showing the new text align.");
testDiv.style.textAlign = "right";
testDiv.style.color = "lightgoldenrodyellow";
testDiv.style.fontSize = "3em";
testDiv.style.textTransform = "uppercase";
inspector.once("rule-view-refreshed", rulePanelAfterChange);
}
function rulePanelAfterChange()
{
let propView = getInspectorRuleProp("text-align");
is(propView.value, "right", "Style inspector should be showing the new text align.");
let propView = getInspectorRuleProp("color");
is(propView.value, "#FAFAD2", "Style inspector should be showing the new color.")
let propView = getInspectorRuleProp("font-size");
is(propView.value, "3em", "Style inspector should be showing the new font size.");
let propView = getInspectorRuleProp("text-transform");
is(propView.value, "uppercase", "Style inspector should be showing the new text transform.");
let propView = getInspectorProp("font-size");
is(propView.value, "20px", "Style inspector should be showing the newest font size.");
finishTest();
}

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>iframe creation/deletion test</title>
</head>
<body>
<div id="yay"></div>
<script type="text/javascript">
var yay = document.querySelector("#yay");
yay.textContent = "nothing";
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
iframe.parentNode.removeChild(iframe);
yay.textContent = "before events";
document.addEventListener("DOMContentLoaded", function() {
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
iframe.parentNode.removeChild(iframe);
yay.textContent = "DOMContentLoaded";
});
window.addEventListener("load", function() {
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
iframe.parentNode.removeChild(iframe);
yay.textContent = "load";
});
</script>
</body>
</html>

View File

@ -0,0 +1,56 @@
/* Any copyright", " is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
let contentTab, contentDoc, inspector;
waitForExplicitFinish();
// Create a tab
contentTab = gBrowser.selectedTab = gBrowser.addTab();
// Open the toolbox's inspector first
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, "inspector").then(function(toolbox) {
inspector = toolbox.getCurrentPanel();
inspector.selection.setNode(content.document.querySelector("body"));
inspector.once("inspector-updated", () => {
is(inspector.selection.node.tagName, "BODY", "Inspector displayed");
// Then load our test page
gBrowser.selectedBrowser.addEventListener("load", function onload() {
gBrowser.selectedBrowser.removeEventListener("load", onload, true);
contentDoc = content.document;
// The content doc contains a script that creates an iframe and deletes
// it immediately after. This is what used to make the inspector go
// blank when navigating to that page.
var iframe = contentDoc.createElement("iframe");
contentDoc.body.appendChild(iframe);
iframe.parentNode.removeChild(iframe);
is(contentDoc.querySelector("iframe"), null, "Iframe has been removed");
inspector.once("markuploaded", () => {
// Assert that the markup-view is displayed and works
is(contentDoc.querySelector("iframe"), null, "Iframe has been removed");
is(contentDoc.getElementById("yay").textContent, "load", "Load event fired");
inspector.selection.setNode(contentDoc.getElementById("yay"));
inspector.once("inspector-updated", () => {
ok(inspector.selection.node, "Inspector still displayed");
// Clean up and go
contentTab, contentDoc, inspector = null;
gBrowser.removeTab(contentTab);
finish();
});
});
}, true);
content.location = "http://mochi.test:8888/browser/browser/devtools/" +
"inspector/test/browser_inspector_dead_node_exception.html";
});
});
}

View File

@ -397,7 +397,6 @@ MarkupView.prototype = {
*/
_mutationObserver: function MT__mutationObserver(aMutations)
{
let requiresLayoutChange = false;
for (let mutation of aMutations) {
let type = mutation.type;
let target = mutation.target;
@ -420,11 +419,6 @@ MarkupView.prototype = {
}
if (type === "attributes" || type === "characterData") {
container.update(false);
// Auto refresh style properties on selected node when they change.
if (type === "attributes" && container.selected) {
requiresLayoutChange = true;
}
} else if (type === "childList") {
container.childrenDirty = true;
// Update the children to take care of changes in the DOM
@ -433,10 +427,6 @@ MarkupView.prototype = {
this._updateChildren(container, {flash: true});
}
}
if (requiresLayoutChange) {
this._inspector.immediateLayoutChange();
}
this._waitForChildren().then(() => {
this._flashMutatedNodes(aMutations);
this._inspector.emit("markupmutation");

View File

@ -24,3 +24,8 @@ DIRS += [
'fontinspector',
'app-manager',
]
EXTRA_COMPONENTS += [
'devtools-clhandler.js',
'devtools-clhandler.manifest',
]

View File

@ -1283,13 +1283,13 @@ CssRuleView.prototype = {
{
// Ignore refreshes during editing or when no element is selected.
if (this.isEditing || !this._elementStyle) {
return;
return promise.resolve(null);
}
this._clearRules();
// Repopulate the element style.
this._populate();
return this._populate();
},
_populate: function() {

View File

@ -7,7 +7,6 @@ let doc;
let inspector;
let ruleView;
let testElement;
let rule;
function startTest(aInspector, aRuleView)
{
@ -44,29 +43,25 @@ function testRuleChanges()
is(selectors[2].textContent.indexOf(".testclass"), 0, "Third item is class rule.");
// Change the id and refresh.
inspector.once("rule-view-refreshed", testRuleChange1);
testElement.setAttribute("id", "differentid");
}
promiseDone(ruleView.nodeChanged().then(() => {
let selectors = ruleView.doc.querySelectorAll(".ruleview-selector");
is(selectors.length, 2, "Two rules visible.");
is(selectors[0].textContent.indexOf("element"), 0, "First item is inline style.");
is(selectors[1].textContent.indexOf(".testclass"), 0, "Second item is class rule.");
function testRuleChange1()
{
let selectors = ruleView.doc.querySelectorAll(".ruleview-selector");
is(selectors.length, 2, "Two rules visible.");
is(selectors[0].textContent.indexOf("element"), 0, "First item is inline style.");
is(selectors[1].textContent.indexOf(".testclass"), 0, "Second item is class rule.");
testElement.setAttribute("id", "testid");
return ruleView.nodeChanged();
}).then(() => {
// Put the id back.
let selectors = ruleView.doc.querySelectorAll(".ruleview-selector");
is(selectors.length, 3, "Three rules visible.");
is(selectors[0].textContent.indexOf("element"), 0, "First item is inline style.");
is(selectors[1].textContent.indexOf("#testid"), 0, "Second item is id rule.");
is(selectors[2].textContent.indexOf(".testclass"), 0, "Third item is class rule.");
inspector.once("rule-view-refreshed", testRuleChange2);
testElement.setAttribute("id", "testid");
}
function testRuleChange2()
{
let selectors = ruleView.doc.querySelectorAll(".ruleview-selector");
is(selectors.length, 3, "Three rules visible.");
is(selectors[0].textContent.indexOf("element"), 0, "First item is inline style.");
is(selectors[1].textContent.indexOf("#testid"), 0, "Second item is id rule.");
is(selectors[2].textContent.indexOf(".testclass"), 0, "Third item is class rule.");
testPropertyChanges();
testPropertyChanges();
}));
}
function validateTextProp(aProp, aEnabled, aName, aValue, aDesc)
@ -82,86 +77,65 @@ function validateTextProp(aProp, aEnabled, aName, aValue, aDesc)
function testPropertyChanges()
{
rule = ruleView._elementStyle.rules[0];
let ruleEditor = ruleView._elementStyle.rules[0].editor;
inspector.once("rule-view-refreshed", testPropertyChange0);
// Add a second margin-top value, just to make things interesting.
let rule = ruleView._elementStyle.rules[0];
let ruleEditor = ruleView._elementStyle.rules[0].editor;
ruleEditor.addProperty("margin-top", "5px", "");
}
promiseDone(expectRuleChange(rule).then(() => {
// Set the element style back to a 1px margin-top.
testElement.setAttribute("style", "margin-top: 1px; padding-top: 5px");
return ruleView.nodeChanged();
}).then(() => {
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[0], true, "margin-top", "1px", "First margin property re-enabled");
validateTextProp(rule.textProps[2], false, "margin-top", "5px", "Second margin property disabled");
function testPropertyChange0()
{
validateTextProp(rule.textProps[0], false, "margin-top", "1px", "Original margin property active");
// Now set it back to 5px, the 5px value should be re-enabled.
testElement.setAttribute("style", "margin-top: 5px; padding-top: 5px;");
return ruleView.nodeChanged();
inspector.once("rule-view-refreshed", testPropertyChange1);
testElement.setAttribute("style", "margin-top: 1px; padding-top: 5px");
}
function testPropertyChange1()
{
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[0], true, "margin-top", "1px", "First margin property re-enabled");
validateTextProp(rule.textProps[2], false, "margin-top", "5px", "Second margin property disabled");
}).then(() => {
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[0], false, "margin-top", "1px", "First margin property re-enabled");
validateTextProp(rule.textProps[2], true, "margin-top", "5px", "Second margin property disabled");
inspector.once("rule-view-refreshed", testPropertyChange2);
// Set the margin property to a value that doesn't exist in the editor.
// Should reuse the currently-enabled element (the second one.)
testElement.setAttribute("style", "margin-top: 15px; padding-top: 5px;");
return ruleView.nodeChanged();
}).then(() => {
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[0], false, "margin-top", "1px", "First margin property re-enabled");
validateTextProp(rule.textProps[2], true, "margin-top", "15px", "Second margin property disabled");
// Now set it back to 5px, the 5px value should be re-enabled.
testElement.setAttribute("style", "margin-top: 5px; padding-top: 5px;");
}
function testPropertyChange2()
{
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[0], false, "margin-top", "1px", "First margin property re-enabled");
validateTextProp(rule.textProps[2], true, "margin-top", "5px", "Second margin property disabled");
// Remove the padding-top attribute. Should disable the padding property but not remove it.
testElement.setAttribute("style", "margin-top: 5px;");
return ruleView.nodeChanged();
}).then(() => {
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[1], false, "padding-top", "5px", "Padding property disabled");
inspector.once("rule-view-refreshed", testPropertyChange3);
// Put the padding-top attribute back in, should re-enable the padding property.
testElement.setAttribute("style", "margin-top: 5px; padding-top: 25px");
return ruleView.nodeChanged();
}).then(() => {
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[1], true, "padding-top", "25px", "Padding property enabled");
// Set the margin property to a value that doesn't exist in the editor.
// Should reuse the currently-enabled element (the second one.)
testElement.setAttribute("style", "margin-top: 15px; padding-top: 5px;");
}
function testPropertyChange3()
{
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[0], false, "margin-top", "1px", "First margin property re-enabled");
validateTextProp(rule.textProps[2], true, "margin-top", "15px", "Second margin property disabled");
// Add an entirely new property.
testElement.setAttribute("style", "margin-top: 5px; padding-top: 25px; padding-left: 20px;");
return ruleView.nodeChanged();
}).then(() => {
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 4, "Added a property");
validateTextProp(rule.textProps[3], true, "padding-left", "20px", "Padding property enabled");
inspector.once("rule-view-refreshed", testPropertyChange4);
// Remove the padding-top attribute. Should disable the padding property but not remove it.
testElement.setAttribute("style", "margin-top: 5px;");
}
function testPropertyChange4()
{
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[1], false, "padding-top", "5px", "Padding property disabled");
inspector.once("rule-view-refreshed", testPropertyChange5);
// Put the padding-top attribute back in, should re-enable the padding property.
testElement.setAttribute("style", "margin-top: 5px; padding-top: 25px");
}
function testPropertyChange5()
{
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 3, "Correct number of properties");
validateTextProp(rule.textProps[1], true, "padding-top", "25px", "Padding property enabled");
inspector.once("rule-view-refreshed", testPropertyChange6);
// Add an entirely new property
testElement.setAttribute("style", "margin-top: 5px; padding-top: 25px; padding-left: 20px;");
}
function testPropertyChange6()
{
is(rule.editor.element.querySelectorAll(".ruleview-property").length, 4, "Added a property");
validateTextProp(rule.textProps[3], true, "padding-left", "20px", "Padding property enabled");
finishTest();
finishTest();
}));
}
function finishTest()
{
inspector = ruleView = rule = null;
inspector = ruleView = null;
doc = null;
gBrowser.removeCurrentTab();
finish();

View File

@ -254,13 +254,14 @@ HUD_SERVICE.prototype =
return deferred.promise;
}
connect().then(getTarget).then(openWindow).then((aWindow) =>
connect().then(getTarget).then(openWindow).then((aWindow) => {
this.openBrowserConsole(target, aWindow, aWindow)
.then((aBrowserConsole) => {
this._browserConsoleID = aBrowserConsole.hudId;
this._browserConsoleDefer.resolve(aBrowserConsole);
this._browserConsoleDefer = null;
}));
})
}, console.error);
return this._browserConsoleDefer.promise;
},

View File

@ -62,7 +62,7 @@ function consoleOpened(hud)
let text = output.textContent;
chromeConsole = text.indexOf("bug587757a");
contentConsole = text.indexOf("bug587757b");
execValue = text.indexOf("browser.xul");
execValue = text.indexOf("webconsole.xul");
exception = text.indexOf("foobarExceptionBug587757");
xhrRequest = text.indexOf("test-console.html");
}

View File

@ -24,7 +24,10 @@ function test()
ok(hud, "browser console opened");
hud.jsterm.clearOutput();
hud.jsterm.execute("foobarzTezt = content.document", onAddVariable);
hud.jsterm.execute("Cu = Components.utils;" +
"Cu.import('resource://gre/modules/Services.jsm');" +
"chromeWindow = Services.wm.getMostRecentWindow('navigator:browser');" +
"foobarzTezt = chromeWindow.content.document", onAddVariable);
}
function onAddVariable()

View File

@ -52,15 +52,6 @@
- -->
<!ENTITY options.defaultColorUnit.name "Color Names">
<!-- LOCALIZATION NOTE (options.context.requiresRestart2): This is the requires
- restart label at right of settings that require a browser restart to be
- effective. -->
<!ENTITY options.context.requiresRestart2 "Requires browser restart">
<!-- LOCALIZATION NOTE (options.restartButton.label): This is the label for the
- restart button next to options.context.requiresRestart2 label. -->
<!ENTITY options.restartButton.label "Restart now">
<!-- LOCALIZATION NOTE (options.context.triggersPageRefresh2): This is the
- triggers page refresh label next to the settings in the advanced settings
- group in the options panel which trigger page reload. -->

View File

@ -81,7 +81,7 @@
<!ENTITY col.name.label "Name">
<!ENTITY col.tags.label "Tags">
<!ENTITY col.url.label "Location">
<!ENTITY col.lastvisit.label "Visit Date">
<!ENTITY col.mostrecentvisit.label "Most Recent Visit">
<!ENTITY col.visitcount.label "Visit Count">
<!ENTITY col.keyword.label "Keyword">
<!ENTITY col.description.label "Description">

View File

@ -25,24 +25,28 @@ menuOpenLivemarkOrigin.label=Open "%S"
sortByName=Sort '%S' by Name
sortByNameGeneric=Sort by Name
view.sortBy.name.label=Sort by Name
view.sortBy.name.accesskey=N
view.sortBy.url.label=Sort by Location
view.sortBy.url.accesskey=L
view.sortBy.date.label=Sort by Visit Date
view.sortBy.date.accesskey=V
view.sortBy.visitCount.label=Sort by Visit Count
view.sortBy.visitCount.accesskey=C
view.sortBy.keyword.label=Sort by Keyword
view.sortBy.keyword.accesskey=K
view.sortBy.description.label=Sort by Description
view.sortBy.description.accesskey=D
view.sortBy.dateAdded.label=Sort by Added
view.sortBy.dateAdded.accesskey=e
view.sortBy.lastModified.label=Sort by Last Modified
view.sortBy.lastModified.accesskey=M
view.sortBy.tags.label=Sort by Tags
view.sortBy.tags.accesskey=T
# LOCALIZATION NOTE (view.sortBy.1.name.label): sortBy properties are versioned.
# When any of these changes, all of the properties must be bumped, and the
# change must be annotated here. Both label and accesskey must be updated.
# - version 1: changed view.sortBy.1.date.
view.sortBy.1.name.label=Sort by Name
view.sortBy.1.name.accesskey=N
view.sortBy.1.url.label=Sort by Location
view.sortBy.1.url.accesskey=L
view.sortBy.1.date.label=Sort by Most Recent Visit
view.sortBy.1.date.accesskey=V
view.sortBy.1.visitCount.label=Sort by Visit Count
view.sortBy.1.visitCount.accesskey=C
view.sortBy.1.keyword.label=Sort by Keyword
view.sortBy.1.keyword.accesskey=K
view.sortBy.1.description.label=Sort by Description
view.sortBy.1.description.accesskey=D
view.sortBy.1.dateAdded.label=Sort by Added
view.sortBy.1.dateAdded.accesskey=e
view.sortBy.1.lastModified.label=Sort by Last Modified
view.sortBy.1.lastModified.accesskey=M
view.sortBy.1.tags.label=Sort by Tags
view.sortBy.1.tags.accesskey=T
searchBookmarks=Search Bookmarks
searchHistory=Search History

View File

@ -77,6 +77,13 @@ var ContentAreaObserver = {
return this._deckTransitioning;
},
get viewstate() {
if (this.width < Services.prefs.getIntPref("browser.ui.snapped.maxWidth")) {
return "snapped";
}
return (this.height > this.width) ? "portrait" : "landscape";
},
/*
* Public apis
*/
@ -122,6 +129,8 @@ var ContentAreaObserver = {
this.styles["window-height"].height = newHeight + "px";
this.styles["window-height"].maxHeight = newHeight + "px";
this._updateViewState();
this.updateContentArea(newWidth, this._getContentHeightForWindow(newHeight));
this._disatchBrowserEvent("SizeChanged");
},
@ -280,6 +289,15 @@ var ContentAreaObserver = {
* Internal helpers
*/
_updateViewState: function (aState) {
let oldViewstate = Elements.windowState.getAttribute("viewstate");
let viewstate = aState || this.viewstate;
if (viewstate != oldViewstate) {
Elements.windowState.setAttribute("viewstate", viewstate);
Services.obs.notifyObservers(null, "metro_viewstate_changed", viewstate);
}
},
_shiftBrowserDeck: function _shiftBrowserDeck(aAmount) {
if (aAmount == 0) {
this._deckTransitioning = false;

View File

@ -102,7 +102,6 @@ var BrowserUI = {
window.addEventListener("MozImprecisePointer", this, true);
Services.prefs.addObserver("browser.cache.disk_cache_ssl", this, false);
Services.obs.addObserver(this, "metro_viewstate_changed", false);
// Init core UI modules
ContextUI.init();
@ -112,9 +111,6 @@ var BrowserUI = {
SettingsCharm.init();
NavButtonSlider.init();
// show the right toolbars, awesomescreen, etc for the os viewstate
BrowserUI._adjustDOMforViewState();
// We can delay some initialization until after startup. We wait until
// the first page is shown, then dispatch a UIReadyDelayed event.
messageManager.addMessageListener("pageshow", function onPageShow() {
@ -178,6 +174,7 @@ var BrowserUI = {
messageManager.removeMessageListener("Browser:MozApplicationManifest", OfflineApps);
PanelUI.uninit();
FlyoutPanelsUI.uninit();
Downloads.uninit();
SettingsCharm.uninit();
messageManager.removeMessageListener("Content:StateChange", this);
@ -592,13 +589,6 @@ var BrowserUI = {
this.changeDebugPort(Services.prefs.getIntPref(aData));
break;
}
break;
case "metro_viewstate_changed":
this._adjustDOMforViewState(aData);
if (aData == "snapped") {
FlyoutPanelsUI.hide();
}
break;
}
},
@ -638,28 +628,6 @@ var BrowserUI = {
pullDesktopControlledPrefType(Ci.nsIPrefBranch.PREF_STRING, "setCharPref");
},
_adjustDOMforViewState: function(aState) {
let currViewState = aState;
if (!currViewState && Services.metro.immersive) {
switch (Services.metro.snappedState) {
case Ci.nsIWinMetroUtils.fullScreenLandscape:
currViewState = "landscape";
break;
case Ci.nsIWinMetroUtils.fullScreenPortrait:
currViewState = "portrait";
break;
case Ci.nsIWinMetroUtils.filled:
currViewState = "filled";
break;
case Ci.nsIWinMetroUtils.snapped:
currViewState = "snapped";
break;
}
}
Elements.windowState.setAttribute("viewstate", currViewState);
},
_titleChanged: function(aBrowser) {
let url = this.getDisplayURI(aBrowser);

View File

@ -130,14 +130,7 @@ var Browser = {
window.controllers.appendController(this);
window.controllers.appendController(BrowserUI);
let os = Services.obs;
os.addObserver(SessionHistoryObserver, "browser:purge-session-history", false);
os.addObserver(ActivityObserver, "application-background", false);
os.addObserver(ActivityObserver, "application-foreground", false);
os.addObserver(ActivityObserver, "system-active", false);
os.addObserver(ActivityObserver, "system-idle", false);
os.addObserver(ActivityObserver, "system-display-on", false);
os.addObserver(ActivityObserver, "system-display-off", false);
Services.obs.addObserver(SessionHistoryObserver, "browser:purge-session-history", false);
window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess();
@ -247,14 +240,7 @@ var Browser = {
messageManager.removeMessageListener("Browser:PluginClickToPlayClicked", this);
messageManager.removeMessageListener("Browser:TapOnSelection", this);
var os = Services.obs;
os.removeObserver(SessionHistoryObserver, "browser:purge-session-history");
os.removeObserver(ActivityObserver, "application-background");
os.removeObserver(ActivityObserver, "application-foreground");
os.removeObserver(ActivityObserver, "system-active");
os.removeObserver(ActivityObserver, "system-idle");
os.removeObserver(ActivityObserver, "system-display-on");
os.removeObserver(ActivityObserver, "system-display-off");
Services.obs.removeObserver(SessionHistoryObserver, "browser:purge-session-history");
window.controllers.removeController(this);
window.controllers.removeController(BrowserUI);
@ -1394,37 +1380,6 @@ var SessionHistoryObserver = {
}
};
var ActivityObserver = {
_inBackground : false,
_notActive : false,
_isDisplayOff : false,
_timeoutID: 0,
observe: function ao_observe(aSubject, aTopic, aData) {
if (aTopic == "application-background") {
this._inBackground = true;
} else if (aTopic == "application-foreground") {
this._inBackground = false;
} else if (aTopic == "system-idle") {
this._notActive = true;
} else if (aTopic == "system-active") {
this._notActive = false;
} else if (aTopic == "system-display-on") {
this._isDisplayOff = false;
} else if (aTopic == "system-display-off") {
this._isDisplayOff = true;
}
let activeTabState = !this._inBackground && !this._notActive && !this._isDisplayOff;
if (this._timeoutID)
clearTimeout(this._timeoutID);
if (Browser.selectedTab.active != activeTabState) {
// On Maemo all backgrounded applications getting portrait orientation
// so if browser had landscape mode then we need timeout in order
// to finish last rotate/paint operation and have nice lookine browser in TS
this._timeoutID = setTimeout(function() { Browser.selectedTab.active = activeTabState; }, activeTabState ? 0 : kSetInactiveStateTimeout);
}
}
};
function getNotificationBox(aBrowser) {
return Browser.getNotificationBox(aBrowser);
}

View File

@ -172,6 +172,7 @@
<stack id="stack" flex="1">
<observes element="bcast_urlbarState" attribute="*"/>
<observes element="bcast_windowState" attribute="*"/>
<!-- Page Area -->
<vbox id="page">
<vbox id="tray" class="tray-toolbar" observes="bcast_windowState" >

View File

@ -36,6 +36,12 @@ let FlyoutPanelsUI = {
return sandbox[name];
});
});
Services.obs.addObserver(this, "metro_viewstate_changed", false);
},
uninit: function () {
Services.obs.removeObserver(this, "metro_viewstate_changed");
},
show: function(aToShow) {
@ -73,6 +79,16 @@ let FlyoutPanelsUI = {
return this._currentFlyout ? true : false;
},
observe: function (aSubject, aTopic, aData) {
switch (aTopic) {
case "metro_viewstate_changed":
if (aData == "snapped") {
this.hide();
}
break;
}
},
dispatchEvent: function(aEvent) {
if (this._currentFlyout) {
this._currentFlyout._topmostElement.dispatchEvent(aEvent);

View File

@ -95,6 +95,7 @@ var TouchModule = {
window.addEventListener("CancelTouchSequence", this, true);
window.addEventListener("dblclick", this, true);
window.addEventListener("keydown", this, true);
window.addEventListener("MozMouseHittest", this, true);
// bubble phase
window.addEventListener("contextmenu", this, false);
@ -160,6 +161,13 @@ var TouchModule = {
case "keydown":
this._handleKeyDown(aEvent);
break;
case "MozMouseHittest":
// Used by widget to hit test chrome vs content
if (aEvent.target.ownerDocument == document) {
aEvent.preventDefault();
}
aEvent.stopPropagation();
break;
}
}
}

View File

@ -13,8 +13,8 @@
* @param aRoot Bookmark root to show in the view.
*/
function BookmarksView(aSet, aLimit, aRoot, aFilterUnpinned) {
this._set = aSet;
this._set.controller = this;
View.call(this, aSet);
this._inBatch = false; // batch up grid updates to avoid redundant arrangeItems calls
this._limit = aLimit;
@ -25,12 +25,10 @@ function BookmarksView(aSet, aLimit, aRoot, aFilterUnpinned) {
this._changes = new BookmarkChangeListener(this);
this._pinHelper = new ItemPinHelper("metro.bookmarks.unpinned");
this._bookmarkService.addObserver(this._changes, false);
Services.obs.addObserver(this, "metro_viewstate_changed", false);
StartUI.chromeWin.addEventListener('MozAppbarDismissing', this, false);
StartUI.chromeWin.addEventListener('BookmarksNeedsRefresh', this, false);
window.addEventListener("TabClose", this, true);
this._adjustDOMforViewState();
this.root = aRoot;
}
@ -62,11 +60,11 @@ BookmarksView.prototype = Util.extend(Object.create(View.prototype), {
destruct: function bv_destruct() {
this._bookmarkService.removeObserver(this._changes);
Services.obs.removeObserver(this, "metro_viewstate_changed");
if (StartUI.chromeWin) {
StartUI.chromeWin.removeEventListener('MozAppbarDismissing', this, false);
StartUI.chromeWin.removeEventListener('BookmarksNeedsRefresh', this, false);
}
View.prototype.destruct.call(this);
},
handleItemClick: function bv_handleItemClick(aItem) {
@ -275,15 +273,6 @@ BookmarksView.prototype = Util.extend(Object.create(View.prototype), {
this._sendNeedsRefresh();
},
// nsIObservers
observe: function (aSubject, aTopic, aState) {
switch(aTopic) {
case "metro_viewstate_changed":
this.onViewStateChange(aState);
break;
}
},
handleEvent: function bv_handleEvent(aEvent) {
switch (aEvent.type){
case "MozAppbarDismissing":

View File

@ -5,8 +5,8 @@
'use strict';
function HistoryView(aSet, aLimit, aFilterUnpinned) {
this._set = aSet;
this._set.controller = this;
View.call(this, aSet);
this._inBatch = 0;
this._limit = aLimit;
@ -16,12 +16,9 @@ function HistoryView(aSet, aLimit, aFilterUnpinned) {
this._pinHelper = new ItemPinHelper("metro.history.unpinned");
this._historyService.addObserver(this, false);
Services.obs.addObserver(this, "metro_viewstate_changed", false);
StartUI.chromeWin.addEventListener('MozAppbarDismissing', this, false);
StartUI.chromeWin.addEventListener('HistoryNeedsRefresh', this, false);
window.addEventListener("TabClose", this, true);
this._adjustDOMforViewState();
}
HistoryView.prototype = Util.extend(Object.create(View.prototype), {
@ -30,11 +27,11 @@ HistoryView.prototype = Util.extend(Object.create(View.prototype), {
destruct: function destruct() {
this._historyService.removeObserver(this);
Services.obs.removeObserver(this, "metro_viewstate_changed");
if (StartUI.chromeWin) {
StartUI.chromeWin.removeEventListener('MozAppbarDismissing', this, false);
StartUI.chromeWin.removeEventListener('HistoryNeedsRefresh', this, false);
}
View.prototype.destruct.call(this);
},
handleItemClick: function tabview_handleItemClick(aItem) {
@ -223,15 +220,6 @@ HistoryView.prototype = Util.extend(Object.create(View.prototype), {
}
},
// nsIObservers
observe: function (aSubject, aTopic, aState) {
switch(aTopic) {
case "metro_viewstate_changed":
this.onViewStateChange(aState);
break;
}
},
// nsINavHistoryObserver & helpers
onBeginUpdateBatch: function() {

View File

@ -20,8 +20,8 @@ Components.utils.import("resource://services-sync/main.js");
* You may only have one UI access point at this time.
*/
function RemoteTabsView(aSet, aSetUIAccessList) {
this._set = aSet;
this._set.controller = this;
View.call(this, aSet);
this._uiAccessElements = aSetUIAccessList;
// Sync uses special voodoo observers.
@ -29,15 +29,12 @@ function RemoteTabsView(aSet, aSetUIAccessList) {
Weave.Svc.Obs.add("weave:service:sync:finish", this);
Weave.Svc.Obs.add("weave:service:start-over", this);
Services.obs.addObserver(this, "metro_viewstate_changed", false);
if (this.isSyncEnabled() ) {
this.populateGrid();
}
else {
this.setUIAccessVisible(false);
}
this._adjustDOMforViewState();
}
RemoteTabsView.prototype = Util.extend(Object.create(View.prototype), {
@ -51,9 +48,6 @@ RemoteTabsView.prototype = Util.extend(Object.create(View.prototype), {
observe: function(subject, topic, data) {
switch (topic) {
case "metro_viewstate_changed":
this.onViewStateChange(data);
break;
case "weave:service:sync:finish":
this.populateGrid();
break;
@ -102,9 +96,9 @@ RemoteTabsView.prototype = Util.extend(Object.create(View.prototype), {
},
destruct: function destruct() {
Services.obs.removeObserver(this, "metro_viewstate_changed");
Weave.Svc.Obs.remove("weave:engine:sync:finish", this);
Weave.Svc.Obs.remove("weave:service:logout:start-over", this);
View.prototype.destruct.call(this);
},
isSyncEnabled: function isSyncEnabled() {

View File

@ -26,7 +26,7 @@ var StartUI = {
document.getElementById("bcast_preciseInput").setAttribute("input",
this.chromeWin.InputSourceHelper.isPrecise ? "precise" : "imprecise");
this._adjustDOMforViewState();
this._adjustDOMforViewState(this.chromeWin.ContentAreaObserver.viewstate);
TopSitesStartView.init();
BookmarksStartView.init();
@ -81,6 +81,10 @@ var StartUI = {
section.setAttribute("expanded", "true");
},
_adjustDOMforViewState: function(aState) {
document.getElementById("bcast_windowState").setAttribute("viewstate", aState);
},
handleEvent: function handleEvent(aEvent) {
switch (aEvent.type) {
case "MozPrecisePointer":
@ -106,33 +110,6 @@ var StartUI = {
}
},
_adjustDOMforViewState: function(aState) {
let currViewState = aState;
if (!currViewState && Services.metro.immersive) {
switch (Services.metro.snappedState) {
case Ci.nsIWinMetroUtils.fullScreenLandscape:
currViewState = "landscape";
break;
case Ci.nsIWinMetroUtils.fullScreenPortrait:
currViewState = "portrait";
break;
case Ci.nsIWinMetroUtils.filled:
currViewState = "filled";
break;
case Ci.nsIWinMetroUtils.snapped:
currViewState = "snapped";
break;
}
}
document.getElementById("bcast_windowState").setAttribute("viewstate", currViewState);
if (currViewState == "snapped") {
document.getElementById("start-topsites-grid").removeAttribute("tiletype");
} else {
document.getElementById("start-topsites-grid").setAttribute("tiletype", "thumbnail");
}
},
observe: function (aSubject, aTopic, aData) {
switch (aTopic) {
case "metro_viewstate_changed":

View File

@ -11,8 +11,8 @@ Cu.import("resource://gre/modules/PageThumbs.jsm");
Cu.import("resource:///modules/colorUtils.jsm");
function TopSitesView(aGrid, aMaxSites) {
this._set = aGrid;
this._set.controller = this;
View.call(this, aGrid);
this._topSitesMax = aMaxSites;
// clean up state when the appbar closes
@ -23,9 +23,6 @@ function TopSitesView(aGrid, aMaxSites) {
PageThumbs.addExpirationFilter(this);
Services.obs.addObserver(this, "Metro:RefreshTopsiteThumbnail", false);
Services.obs.addObserver(this, "metro_viewstate_changed", false);
this._adjustDOMforViewState();
NewTabUtils.allPages.register(this);
TopSites.prepareCache().then(function(){
@ -43,12 +40,12 @@ TopSitesView.prototype = Util.extend(Object.create(View.prototype), {
destruct: function destruct() {
Services.obs.removeObserver(this, "Metro:RefreshTopsiteThumbnail");
Services.obs.removeObserver(this, "metro_viewstate_changed");
PageThumbs.removeExpirationFilter(this);
NewTabUtils.allPages.unregister(this);
if (StartUI.chromeWin) {
StartUI.chromeWin.removeEventListener('MozAppbarDismissing', this, false);
}
View.prototype.destruct.call(this);
},
handleItemClick: function tabview_handleItemClick(aItem) {
@ -137,6 +134,7 @@ TopSitesView.prototype = Util.extend(Object.create(View.prototype), {
case "MozAppbarDismissing":
// clean up when the context appbar is dismissed - we don't remember selections
this._lastSelectedSites = null;
break;
}
},
@ -234,6 +232,13 @@ TopSitesView.prototype = Util.extend(Object.create(View.prototype), {
View.prototype._adjustDOMforViewState.call(this, aState);
// Don't show thumbnails in snapped view.
if (aState == "snapped") {
document.getElementById("start-topsites-grid").removeAttribute("tiletype");
} else {
document.getElementById("start-topsites-grid").setAttribute("tiletype", "thumbnail");
}
// propogate tiletype changes down to tile children
let tileType = this._set.getAttribute("tiletype");
for (let item of this._set.children) {
@ -251,9 +256,6 @@ TopSitesView.prototype = Util.extend(Object.create(View.prototype), {
case "Metro:RefreshTopsiteThumbnail":
this.forceReloadOfThumbnail(aState);
break;
case "metro_viewstate_changed":
this.onViewStateChange(aState);
break;
}
},

View File

@ -111,7 +111,7 @@ gTests.push({
},
tearDown: function() {
BookmarksTestHelper.restore();
restoreViewstate();
yield restoreViewstate();
}
});
@ -160,6 +160,6 @@ gTests.push({
tearDown: function() {
BookmarksTestHelper.restore();
HistoryTestHelper.restore();
restoreViewstate();
yield restoreViewstate();
}
});

View File

@ -47,7 +47,7 @@ const mochitestPath = splitPath.join('/') + '/';
function isLandscapeMode()
{
return (Services.metro.snappedState == Ci.nsIWinMetroUtils.fullScreenLandscape);
return Elements.windowState.getAttribute("viewstate") == "landscape";
}
function setDevPixelEqualToPx()

View File

@ -20,7 +20,7 @@ function setSnappedViewstate() {
browser.style.borderRight = padding + "px solid gray";
// Communicate viewstate change
Services.obs.notifyObservers(null, 'metro_viewstate_changed', 'snapped');
ContentAreaObserver._updateViewState("snapped");
// Make sure it renders the new mode properly
yield waitForMs(0);
@ -36,16 +36,15 @@ function setPortraitViewstate() {
browser.style.borderRight = padding + "px solid gray";
Services.obs.notifyObservers(null, 'metro_viewstate_changed', 'portrait');
ContentAreaObserver._updateViewState("portrait");
// Make sure it renders the new mode properly
yield waitForMs(0);
}
function restoreViewstate() {
ok(isLandscapeMode(), "restoreViewstate expects landscape mode to work.");
Services.obs.notifyObservers(null, 'metro_viewstate_changed', 'landscape');
ContentAreaObserver._updateViewState("landscape");
ok(isLandscapeMode(), "restoreViewstate should restore landscape mode.");
Browser.selectedBrowser.style.removeProperty("border-right");

View File

@ -2,6 +2,7 @@
head =
tail =
firefox-appdir = metro
support-files = blank.xhtml
[test_util_extend.js]
[test_util_populateFragmentFromString.js]

View File

@ -6,10 +6,7 @@
{"index":1,"title":"@firefox_about@", "type":"text/x-moz-place", "uri":"http://www.mozilla.org/@AB_CD@/about/",
"iconUri":"chrome://branding/content/favicon32.png"
},
{"index":2,"title":"@getting_started@", "type":"text/x-moz-place", "uri":"http://www.mozilla.org/@AB_CD@/firefox/central/",
"iconUri":"chrome://branding/content/favicon32.png"
},
{"index":3,"title":"@firefox_community@", "type":"text/x-moz-place", "uri":"http://www.mozilla.org/@AB_CD@/contribute/",
{"index":2,"title":"@firefox_community@", "type":"text/x-moz-place", "uri":"http://www.mozilla.org/@AB_CD@/contribute/",
"iconUri":"chrome://branding/content/favicon32.png"
}
]

View File

@ -23,10 +23,23 @@ function makeURI(aURL, aOriginCharset, aBaseURI) {
// --------------------------------
// View prototype for shared functionality
function View() {
function View(aSet) {
this._set = aSet;
this._set.controller = this;
this.viewStateObserver = {
observe: (aSubject, aTopic, aData) => this._adjustDOMforViewState(aData)
};
Services.obs.addObserver(this.viewStateObserver, "metro_viewstate_changed", false);
this._adjustDOMforViewState();
}
View.prototype = {
destruct: function () {
Services.obs.removeObserver(this.viewStateObserver, "metro_viewstate_changed");
},
_adjustDOMforViewState: function _adjustDOMforViewState(aState) {
if (this._set) {
if (undefined == aState)
@ -44,10 +57,6 @@ View.prototype = {
}
},
onViewStateChange: function (aState) {
this._adjustDOMforViewState(aState);
},
_updateFavicon: function pv__updateFavicon(aItem, aUri) {
if ("string" == typeof aUri) {
aUri = makeURI(aUri);

View File

@ -37,6 +37,8 @@ pref("layers.offmainthreadcomposition.enabled", true);
pref("layers.async-pan-zoom.enabled", true);
pref("layers.componentalpha.enabled", false);
pref("gfx.azpc.touch_start_tolerance", "0.1"); // dpi * tolerance = pixel threshold
pref("gfx.azpc.pan_repaint_interval", "50"); // prefer 20 fps
pref("gfx.azpc.fling_repaint_interval", "50"); // prefer 20 fps
pref("gfx.axis.fling_friction", "0.002");
// Enable Microsoft TSF support by default for imes.
@ -375,6 +377,9 @@ pref("geo.wifi.uri", "https://www.googleapis.com/geolocation/v1/geolocate?key=%G
// JS error console
pref("devtools.errorconsole.enabled", false);
// snapped view
pref("browser.ui.snapped.maxWidth", 600);
// kinetic tweakables
pref("browser.ui.kinetic.updateInterval", 16);
pref("browser.ui.kinetic.exponentialC", 1400);

View File

@ -375,6 +375,7 @@ documenttab[selected] .documenttab-selection {
background-position: left 6px center;
}
#stack[viewstate="snapped"] > .overlay-button,
#stack[keyboardVisible] > .overlay-button,
#stack[autocomplete] > .overlay-button,
#stack[fullscreen] > .overlay-button,

View File

@ -64,6 +64,9 @@ this.TabCrashReporter = {
},
onAboutTabCrashedLoad: function (aBrowser) {
if (!this.childMap)
return;
let dumpID = this.childMap.get(this.browserMap.get(aBrowser));
if (!dumpID)
return;

View File

@ -2,7 +2,7 @@
head = head.js
tail =
firefox-appdir = browser
support-files = blocklist.xml
[test_social.js]
[test_socialDisabledStartup.js]

View File

@ -294,7 +294,7 @@ case "$target" in
# The build tools got moved around to different directories in
# SDK Tools r22. Try to locate them.
android_build_tools=""
for suffix in android-4.3 18.0.1 18.0.0 17.0.0 android-4.2.2; do
for suffix in android-4.3 18.1.0 18.0.1 18.0.0 17.0.0 android-4.2.2; do
tools_directory="$android_sdk/../../build-tools/$suffix"
if test -d "$tools_directory" ; then
android_build_tools="$tools_directory"

View File

@ -18,6 +18,7 @@ import mdn_theme
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.graphviz',
'sphinx.ext.todo',
]
templates_path = ['_templates']

View File

@ -20,6 +20,7 @@ Important Concepts
Profile Guided Optimization <pgo>
slow
environment-variables
test_manifests
mozbuild
========

View File

@ -0,0 +1,153 @@
.. _test_manifests:
==============
Test Manifests
==============
Many test suites have their test metadata defined in files called
**test manifests**.
Test manifests are divided into two flavors: :ref:`manifest_destiny_manifests`
and :ref:`reftest_manifests`.
.. _manifest_destiny_manifests:
Manifest Destiny Manifests
==========================
Manifest destiny manifests are essentially ini files that conform to a basic
set of assumptions.
The `reference documentation <http://mozbase.readthedocs.org/en/latest/manifestdestiny.html>`_
for manifest destiny manifests describes the basic format of test manifests.
In summary, manifests are ini files with section names describing test files::
[test_foo.js]
[test_bar.js]
Keys under sections can hold metadata about each test::
[test_foo.js]
skip-if = os == win
There is a special **DEFAULT** section whose keys/metadata apply to all
sections/tests::
[DEFAULT]
property = value
[test_foo.js]
In the above example, **test_foo.js** inherits the metadata **property = value**
from the **DEFAULT** section.
Recognized Metadata
-------------------
Test manifests can define some common keys/metadata to influence behavior.
Those keys are as follows:
head
List of files that will be executed before the test file. (Used in
xpcshell tests.)
tail
List of files that will be executed after the test file. (Used in
xpcshell tests.)
support-files
List of additional files required to run tests. This is typically
defined in the **DEFAULT** section.
Unlike other file lists, *support-files* supports a globbing mechanism
to facilitate pulling in many files with minimal typing. This globbing
mechanism is activated if an entry in this value contains a ``*``
character. A single ``*`` will wildcard match all files in a directory.
A double ``**`` will descend into child directories. For example,
``data/*`` will match ``data/foo`` but not ``data/subdir/bar`` where
``data/**`` will match ``data/foo`` and ``data/subdir/bar``.
generated-files
List of files that are generated as part of the build and don't exist in
the source tree.
The build system assumes that each manifest file, test file, and file
listed in **head**, **tail**, and **support-files** is static and
provided by the source tree (and not automatically generated as part
of the build). This variable tells the build system not to make this
assumption.
This variable will likely go away sometime once all generated files are
accounted for in the build config.
If a generated file is not listed in this key, a clobber build will
likely fail.
dupe-manifest
Record that this manifest duplicates another manifest.
The common scenario is two manifest files will include a shared
manifest file via the ``[include:file]`` special section. The build
system enforces that each test file is only provided by a single
manifest. Having this key present bypasses that check.
The value of this key is ignored.
run-if
Run this test only if the specified condition is true.
See :ref:`manifest_filter_language`.
skip-if
Skip this test if the specified condition is true.
See :ref:`manifest_filter_language`.
fail-if
Expect test failure if the specified condition is true.
See :ref:`manifest_filter_language`.
run-sequentially
If present, the test should not be run in parallel with other tests.
Some test harnesses support parallel test execution on separate processes
and/or threads (behavior varies by test harness). If this key is present,
the test harness should not attempt to run this test in parallel with any
other test.
By convention, the value of this key is a string describing why the test
can't be run in parallel.
.. _manifest_filter_language:
Manifest Filter Language
------------------------
Some manifest keys accept a special filter syntax as their values. These
values are essentially boolean expressions that are evaluated at test
execution time.
See
`the source <https://hg.mozilla.org/mozilla-central/file/default/testing/mozbase/manifestdestiny/manifestparser/manifestparser.py>`_.
.. todo::
Document manifest filter language.
.. _manifest_file_installation:
File Installation
-----------------
Files referenced by manifests are automatically installed into the object
directory into paths defined in
:py:func:`mozbuild.frontend.emitter.TreeMetadataEmitter._process_test_manifest`.
Referenced files in the manifest not in the same directory tree as the manifest
file are **not** installed.
.. _reftest_manifests:
Reftest Manifests
=================
See `MDN <https://developer.mozilla.org/en-US/docs/Creating_reftest-based_unit_tests>`_.

View File

@ -1,6 +1,7 @@
if [ -d "/c/Program Files (x86)/Microsoft Visual Studio 10.0" ]; then
_VSPATH="/c/Program Files (x86)/Microsoft Visual Studio 10.0"
if [ -d "/c/PROGRA~2/MICROS~2.0" ]; then
# /c/Program Files (x86)/Microsoft Visual Studio 10.0
_VSPATH="/c/PROGRA~2/MICROS~2.0"
else
_VSPATH="/c/tools/msvs10"
fi

View File

@ -1,6 +1,7 @@
if [ -d "/c/Program Files (x86)/Microsoft Visual Studio 10.0" ]; then
_VSPATH="/c/Program Files (x86)/Microsoft Visual Studio 10.0"
if [ -d "/c/PROGRA~2/MICROS~2.0" ]; then
# /c/Program Files (x86)/Microsoft Visual Studio 10.0
_VSPATH="/c/PROGRA~2/MICROS~2.0"
else
_VSPATH="/c/tools/msvs10"
fi
@ -20,7 +21,7 @@ export PATH="/c/Program Files (x86)/Windows Kits/8.0/bin/x64:${_VSPATH}/Common7/
# Use 32bit linker for PGO crash bug.
# https://connect.microsoft.com/VisualStudio/feedback/details/686117/
export LD=c:/tools/msvs10/VC/BIN/x86_amd64/link.exe
export LD="${_VSPATH}/VC/BIN/x86_amd64/link.exe"
. $topsrcdir/build/mozconfig.vs2010-common

View File

@ -1,6 +1,7 @@
[DEFAULT]
head = head_crtestutils.js
tail =
tail =
support-files = data/**
[test_abi.js]
[test_bug292789.js]

View File

@ -1,137 +0,0 @@
# -*- makefile -*-
# vim:set ts=8 sw=8 sts=8 noet:
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
ifndef INCLUDED_TESTS_XPCSHELL_MK #{
ifdef XPCSHELL_TESTS #{
ifndef relativesrcdir
$(error Must define relativesrcdir when defining XPCSHELL_TESTS.)
endif
define _INSTALL_TESTS
$(call install_cmd, $(filter-out %~,$(wildcard $(srcdir)/$(dir)/*)) $(testxpcobjdir)/$(relativesrcdir)/$(dir))
endef # do not remove the blank line!
SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
testxpcsrcdir = $(topsrcdir)/testing/xpcshell
libs:: libs-xpcshell-tests
###########################################################################
libs-xpcshell-tests:
$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
ifndef NO_XPCSHELL_MANIFEST_CHECK #{
$(call py_action,xpccheck,$(topsrcdir) $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS)))
endif #} NO_XPCSHELL_MANIFEST_CHECK
###########################################################################
# Execute all tests in the $(XPCSHELL_TESTS) directories.
# See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
xpcshell-tests:
$(info Please consider running xpcshell tests via |mach xpcshell-test|. mach is more powerful, easier to use, and will be the only supported way to run tests in the future. Consider switching to mach today!)
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
-I$(DEPTH)/build \
-I$(topsrcdir)/build \
-I$(DEPTH)/_tests/mozbase/mozinfo \
$(testxpcsrcdir)/runxpcshelltests.py \
--symbols-path=$(DIST)/crashreporter-symbols \
--build-info-json=$(DEPTH)/mozinfo.json \
--tests-root-dir=$(testxpcobjdir) \
--testing-modules-dir=$(DEPTH)/_tests/modules \
--xunit-file=$(testxpcobjdir)/$(relativesrcdir)/results.xml \
--xunit-suite-name=xpcshell \
--test-plugin-path=$(DIST)/plugins \
$(EXTRA_TEST_ARGS) \
$(LIBXUL_DIST)/bin/xpcshell \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
xpcshell-tests-remote: DM_TRANS?=adb
xpcshell-tests-remote:
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
-I$(DEPTH)/build \
$(topsrcdir)/testing/xpcshell/remotexpcshelltests.py \
--symbols-path=$(DIST)/crashreporter-symbols \
--build-info-json=$(DEPTH)/mozinfo.json \
--testing-modules-dir=$(DEPTH)/_tests/modules \
$(EXTRA_TEST_ARGS) \
--dm_trans=$(DM_TRANS) \
--deviceIP=${TEST_DEVICE} \
--objdir=$(DEPTH) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
###########################################################################
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
# start the test. Instead, present the xpcshell prompt so the user can
# attach a debugger and then start the test.
check-interactive:
$(info Please consider running xpcshell tests via mach: |mach xpcshell-test --interactive path/to/test|.)
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
-I$(DEPTH)/build \
-I$(topsrcdir)/build \
-I$(DEPTH)/_tests/mozbase/mozinfo \
$(testxpcsrcdir)/runxpcshelltests.py \
--symbols-path=$(DIST)/crashreporter-symbols \
--build-info-json=$(DEPTH)/mozinfo.json \
--test-path=$(SOLO_FILE) \
--testing-modules-dir=$(DEPTH)/_tests/modules \
--profile-name=$(MOZ_APP_NAME) \
--test-plugin-path=$(DIST)/plugins \
--interactive \
$(LIBXUL_DIST)/bin/xpcshell \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
# Execute a single test, specified in $(SOLO_FILE)
check-one:
$(info Please consider running xpcshell tests via mach: |mach xpcshell-test path/to/test|.)
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
-I$(DEPTH)/build \
-I$(topsrcdir)/build \
-I$(DEPTH)/_tests/mozbase/mozinfo \
$(testxpcsrcdir)/runxpcshelltests.py \
--symbols-path=$(DIST)/crashreporter-symbols \
--build-info-json=$(DEPTH)/mozinfo.json \
--test-path=$(SOLO_FILE) \
--testing-modules-dir=$(DEPTH)/_tests/modules \
--profile-name=$(MOZ_APP_NAME) \
--test-plugin-path=$(DIST)/plugins \
--verbose \
$(EXTRA_TEST_ARGS) \
$(LIBXUL_DIST)/bin/xpcshell \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
check-one-remote: DM_TRANS?=adb
check-one-remote:
$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
-I$(DEPTH)/build \
-I$(topsrcdir)/build \
-I$(topsrcdir)/build/mobile \
-I$(topsrcdir)/testing/mozbase/mozdevice/mozdevice \
$(testxpcsrcdir)/remotexpcshelltests.py \
--symbols-path=$(DIST)/crashreporter-symbols \
--build-info-json=$(DEPTH)/mozinfo.json \
--test-path=$(SOLO_FILE) \
--testing-modules-dir=$(DEPTH)/_tests/modules \
--profile-name=$(MOZ_APP_NAME) \
--verbose \
$(EXTRA_TEST_ARGS) \
--dm_trans=$(DM_TRANS) \
--deviceIP=${TEST_DEVICE} \
--objdir=$(DEPTH) \
--noSetup \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(relativesrcdir)/$(dir))
.PHONY: xpcshell-tests check-interactive check-one libs-xpcshell-tests
endif #} XPCSHELL_TESTS
INCLUDED_TESTS_XPCSHELL_MK = 1
endif #} INCLUDED_TESTS_XPCSHELL_MK

View File

@ -32,12 +32,14 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
HOST_CSRCS \
HOST_LIBRARY_NAME \
IS_COMPONENT \
JS_MODULES_PATH \
LIBRARY_NAME \
LIBXUL_LIBRARY \
MODULE \
MSVC_ENABLE_PGO \
NO_DIST_INSTALL \
PARALLEL_DIRS \
SDK_HEADERS \
SIMPLE_PROGRAMS \
TEST_DIRS \
TIERS \
@ -104,11 +106,6 @@ endif
endif
endif
ifdef SDK_HEADERS
_EXTRA_EXPORTS := $(filter-out $(EXPORTS),$(SDK_HEADERS))
EXPORTS += $(_EXTRA_EXPORTS)
endif
ifdef REBUILD_CHECK
ifdef .PYMAKE
REPORT_BUILD = @%rebuild_check rebuild_check $@ $^
@ -166,10 +163,6 @@ ifdef ENABLE_TESTS
# locally against non-current test code.
DIRS += $(TEST_DIRS)
ifndef INCLUDED_TESTS_XPCSHELL_MK #{
include $(topsrcdir)/config/makefiles/xpcshell.mk
endif #}
ifndef INCLUDED_TESTS_MOCHITEST_MK #{
include $(topsrcdir)/config/makefiles/mochitest.mk
endif #}

View File

@ -33,8 +33,8 @@
#include "mozilla/dom/Attr.h"
#include "nsISMILAttr.h"
#include "nsClientRect.h"
#include "nsEvent.h"
#include "nsAttrValue.h"
#include "mozilla/EventForwards.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "Units.h"

View File

@ -21,6 +21,7 @@
#include "js/TypeDecls.h"
#include "js/RootingAPI.h"
#include "mozilla/Assertions.h"
#include "mozilla/EventForwards.h"
#include "mozilla/GuardObjects.h"
#include "mozilla/TimeStamp.h"
#include "nsContentListDeclarations.h"
@ -34,8 +35,6 @@ class imgIRequest;
class imgLoader;
class imgRequestProxy;
class nsAutoScriptBlockerSuppressNodeRemoved;
class nsDragEvent;
class nsEvent;
class nsEventListenerManager;
class nsHtml5StringParser;
class nsIChannel;
@ -84,7 +83,6 @@ class nsIWidget;
class nsIWordBreaker;
class nsIXPConnect;
class nsIXPConnectJSObjectHolder;
class nsKeyEvent;
class nsNodeInfoManager;
class nsPIDOMWindow;
class nsPresContext;

View File

@ -170,7 +170,7 @@ public:
bool IsRootOfNativeAnonymousSubtree() const
{
NS_ASSERTION(!HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT) ||
(HasFlag(NODE_IS_ANONYMOUS) &&
(HasFlag(NODE_IS_ANONYMOUS_ROOT) &&
HasFlag(NODE_IS_IN_ANONYMOUS_SUBTREE)),
"Some flags seem to be missing!");
return HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT);
@ -186,9 +186,9 @@ public:
* Makes this content anonymous
* @see nsIAnonymousContentCreator
*/
void SetNativeAnonymous()
void SetIsNativeAnonymousRoot()
{
SetFlags(NODE_IS_ANONYMOUS | NODE_IS_IN_ANONYMOUS_SUBTREE |
SetFlags(NODE_IS_ANONYMOUS_ROOT | NODE_IS_IN_ANONYMOUS_SUBTREE |
NODE_IS_NATIVE_ANONYMOUS_ROOT);
}
@ -210,7 +210,7 @@ public:
"to binding parent");
NS_ASSERTION(!GetParent() ||
((GetBindingParent() == GetParent()) ==
HasFlag(NODE_IS_ANONYMOUS)) ||
HasFlag(NODE_IS_ANONYMOUS_ROOT)) ||
// Unfortunately default content for XBL insertion points is
// anonymous content that is bound with the parent of the
// insertion point as the parent but the bound element for the
@ -218,10 +218,10 @@ public:
// the assert a bit here.
(GetBindingParent() &&
(GetBindingParent() == GetParent()->GetBindingParent()) ==
HasFlag(NODE_IS_ANONYMOUS)),
HasFlag(NODE_IS_ANONYMOUS_ROOT)),
"For nodes with parent, flag and GetBindingParent() check "
"should match");
return HasFlag(NODE_IS_ANONYMOUS);
return HasFlag(NODE_IS_ANONYMOUS_ROOT);
}
/**

View File

@ -83,7 +83,7 @@ enum {
// XBL-generated ones, will do. This flag is set-once: once a node has it,
// it must not be removed.
// NOTE: Should only be used on nsIContent nodes
NODE_IS_ANONYMOUS = NODE_FLAG_BIT(2),
NODE_IS_ANONYMOUS_ROOT = NODE_FLAG_BIT(2),
// Whether the node has some ancestor, possibly itself, that is native
// anonymous. This includes ancestors crossing XBL scopes, in cases when an
@ -802,7 +802,7 @@ public:
using mozilla::dom::EventTarget::RemoveEventListener;
using nsIDOMEventTarget::AddEventListener;
virtual void AddEventListener(const nsAString& aType,
nsIDOMEventListener* aListener,
mozilla::dom::EventListener* aListener,
bool aUseCapture,
const mozilla::dom::Nullable<bool>& aWantsUntrusted,
mozilla::ErrorResult& aRv) MOZ_OVERRIDE;
@ -910,7 +910,7 @@ public:
void SetFlags(uint32_t aFlagsToSet)
{
NS_ASSERTION(!(aFlagsToSet & (NODE_IS_ANONYMOUS |
NS_ASSERTION(!(aFlagsToSet & (NODE_IS_ANONYMOUS_ROOT |
NODE_IS_NATIVE_ANONYMOUS_ROOT |
NODE_IS_IN_ANONYMOUS_SUBTREE |
NODE_ATTACH_BINDING_ON_POSTCREATE |
@ -925,7 +925,7 @@ public:
void UnsetFlags(uint32_t aFlagsToUnset)
{
NS_ASSERTION(!(aFlagsToUnset &
(NODE_IS_ANONYMOUS |
(NODE_IS_ANONYMOUS_ROOT |
NODE_IS_IN_ANONYMOUS_SUBTREE |
NODE_IS_NATIVE_ANONYMOUS_ROOT)),
"Trying to unset write-only flags");

View File

@ -13,12 +13,12 @@ interface nsINode;
%{C++
class nsIFrame;
struct nsTextRangeStyle;
struct nsPoint;
struct ScrollAxis;
template<class T> class nsTArray;
#include "nsDirection.h"
#include "nsIPresShell.h" // TODO: Remove this include
#include "mozilla/EventForwards.h"
%}
[ptr] native nsIFrame(nsIFrame);

View File

@ -10,6 +10,7 @@
#include "mozilla/dom/Attr.h"
#include "mozilla/dom/AttrBinding.h"
#include "mozilla/dom/Element.h"
#include "mozilla/MutationEvent.h"
#include "nsContentCreatorFunctions.h"
#include "nsINameSpaceManager.h"
#include "nsError.h"
@ -25,7 +26,6 @@
#include "nsEventListenerManager.h"
#include "nsTextNode.h"
#include "mozAutoDocUpdate.h"
#include "nsMutationEvent.h"
#include "nsAsyncDOMEvent.h"
#include "nsWrapperCacheInlines.h"

View File

@ -48,7 +48,7 @@
#include "nsDOMString.h"
#include "nsIScriptSecurityManager.h"
#include "nsIDOMMutationEvent.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsNodeUtils.h"
#include "mozilla/dom/DirectionalityUtils.h"
#include "nsDocument.h"
@ -2213,7 +2213,7 @@ Element::PostHandleEventForLinks(nsEventChainPostVisitor& aVisitor)
break;
case NS_MOUSE_CLICK:
if (NS_IS_MOUSE_LEFT_CLICK(aVisitor.mEvent)) {
if (aVisitor.mEvent->IsLeftClickEvent()) {
nsInputEvent* inputEvent = static_cast<nsInputEvent*>(aVisitor.mEvent);
if (inputEvent->IsControl() || inputEvent->IsMeta() ||
inputEvent->IsAlt() ||inputEvent->IsShift()) {

View File

@ -51,7 +51,7 @@
#include "nsDOMString.h"
#include "nsIScriptSecurityManager.h"
#include "nsIDOMMutationEvent.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsNodeUtils.h"
#include "nsDocument.h"
#include "nsAttrValueOrString.h"

View File

@ -38,6 +38,7 @@
#include "mozilla/dom/HTMLTemplateElement.h"
#include "mozilla/dom/TextDecoder.h"
#include "mozilla/Likely.h"
#include "mozilla/MutationEvent.h"
#include "mozilla/Preferences.h"
#include "mozilla/Selection.h"
#include "mozilla/Util.h"
@ -144,7 +145,6 @@
#include "nsIXPConnect.h"
#include "nsJSUtils.h"
#include "nsLWBrkCIID.h"
#include "nsMutationEvent.h"
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsNodeInfoManager.h"

View File

@ -120,7 +120,7 @@
#include "nsDateTimeFormatCID.h"
#include "nsIDateTimeFormat.h"
#include "nsEventDispatcher.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsDOMCID.h"
#include "jsapi.h"

View File

@ -17,7 +17,7 @@
#include "nsEventListenerManager.h"
#include "nsIDOMDocument.h"
#include "nsReadableUtils.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsINameSpaceManager.h"
#include "nsIURI.h"
#include "nsIDOMEvent.h"

View File

@ -16,6 +16,7 @@
#include "mozilla/CORSMode.h"
#include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/MutationEvent.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Util.h"
#include "nsAsyncDOMEvent.h"
@ -76,7 +77,6 @@
#include "nsIWebNavigation.h"
#include "nsIWidget.h"
#include "nsLayoutUtils.h"
#include "nsMutationEvent.h"
#include "nsNetUtil.h"
#include "nsNodeInfoManager.h"
#include "nsNodeUtils.h"
@ -1048,7 +1048,7 @@ nsINode::AddEventListener(const nsAString& aType,
void
nsINode::AddEventListener(const nsAString& aType,
nsIDOMEventListener* aListener,
EventListener* aListener,
bool aUseCapture,
const Nullable<bool>& aWantsUntrusted,
ErrorResult& aRv)
@ -1180,7 +1180,7 @@ nsINode::GetOwnerGlobal()
bool
nsINode::UnoptimizableCCNode() const
{
const uintptr_t problematicFlags = (NODE_IS_ANONYMOUS |
const uintptr_t problematicFlags = (NODE_IS_ANONYMOUS_ROOT |
NODE_IS_IN_ANONYMOUS_SUBTREE |
NODE_IS_NATIVE_ANONYMOUS_ROOT |
NODE_MAY_BE_IN_BINDING_MNGR);

View File

@ -9,7 +9,7 @@
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
#include "mozilla/dom/Element.h"
#include "nsMutationEvent.h"
#include "mozilla/MutationEvent.h"
#include "nsDOMCSSDeclaration.h"
#include "nsDOMCSSAttrDeclaration.h"
#include "nsServiceManagerUtils.h"

View File

@ -1,6 +1,24 @@
[DEFAULT]
head = head_utilities.js
tail =
tail =
support-files =
1_original.xml
1_result.xml
2_original.xml
2_result_1.xml
2_result_2.xml
2_result_3.xml
2_result_4.xml
3_original.xml
3_result.xml
3_result_2.xml
4_original.xml
4_result_1.xml
4_result_2.xml
4_result_3.xml
4_result_4.xml
4_result_5.xml
4_result_6.xml
[test_bug553888.js]
[test_bug558431.js]

View File

@ -1078,7 +1078,7 @@ CanvasRenderingContext2D::GetInputStream(const char *aMimeType,
new gfxImageSurface(imageBuffer.get(),
gfxIntSize(mWidth, mHeight),
mWidth * 4,
gfxASurface::ImageFormatARGB32);
gfxImageFormatARGB32);
if (!imgsurf || imgsurf->CairoStatus()) {
return NS_ERROR_FAILURE;
@ -3258,7 +3258,7 @@ CanvasRenderingContext2D::DrawWindow(nsIDOMWindow* window, double x,
} else {
drawSurf =
gfxPlatform::GetPlatform()->CreateOffscreenSurface(gfxIntSize(ceil(sw), ceil(sh)),
gfxASurface::CONTENT_COLOR_ALPHA);
GFX_CONTENT_COLOR_ALPHA);
if (!drawSurf) {
error.Throw(NS_ERROR_FAILURE);
return;
@ -3678,7 +3678,7 @@ CanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w
}
nsRefPtr<gfxImageSurface> imgsurf = new gfxImageSurface(gfxIntSize(w, h),
gfxASurface::ImageFormatARGB32,
gfxImageFormatARGB32,
false);
if (!imgsurf || imgsurf->CairoStatus()) {
return NS_ERROR_FAILURE;

View File

@ -71,7 +71,7 @@ DocumentRendererChild::RenderDocument(nsIDOMWindow *window,
new gfxImageSurface(reinterpret_cast<uint8_t*>(data.BeginWriting()),
gfxIntSize(renderSize.width, renderSize.height),
4 * renderSize.width,
gfxASurface::ImageFormatARGB32);
gfxImageFormatARGB32);
nsRefPtr<gfxContext> ctx = new gfxContext(surf);
ctx->SetMatrix(transform);

View File

@ -32,7 +32,7 @@ void DocumentRendererParent::DrawToCanvas(const nsIntSize& aSize,
new gfxImageSurface(reinterpret_cast<uint8_t*>(const_cast<nsCString&>(aData).BeginWriting()),
gfxIntSize(aSize.width, aSize.height),
aSize.width * 4,
gfxASurface::ImageFormatARGB32);
gfxImageFormatARGB32);
nsRefPtr<gfxPattern> pat = new gfxPattern(surf);
gfxRect rect(gfxPoint(0, 0), gfxSize(aSize.width, aSize.height));

View File

@ -601,7 +601,7 @@ WebGLContext::Render(gfxContext *ctx, gfxPattern::GraphicsFilter f, uint32_t aFl
return NS_OK;
nsRefPtr<gfxImageSurface> surf = new gfxImageSurface(gfxIntSize(mWidth, mHeight),
gfxASurface::ImageFormatARGB32);
gfxImageFormatARGB32);
if (surf->CairoStatus() != 0)
return NS_ERROR_FAILURE;
@ -731,7 +731,7 @@ WebGLContext::GetInputStream(const char* aMimeType,
return NS_ERROR_FAILURE;
nsRefPtr<gfxImageSurface> surf = new gfxImageSurface(gfxIntSize(mWidth, mHeight),
gfxASurface::ImageFormatARGB32);
gfxImageFormatARGB32);
if (surf->CairoStatus() != 0)
return NS_ERROR_FAILURE;

View File

@ -2532,7 +2532,7 @@ WebGLContext::SurfaceFromElementResultToImageSurface(nsLayoutUtils::SurfaceFromE
{
if (!res.mSurface)
return NS_ERROR_FAILURE;
if (res.mSurface->GetType() != gfxASurface::SurfaceTypeImage) {
if (res.mSurface->GetType() != gfxSurfaceTypeImage) {
// SurfaceFromElement lied!
return NS_ERROR_FAILURE;
}
@ -2578,16 +2578,16 @@ WebGLContext::SurfaceFromElementResultToImageSurface(nsLayoutUtils::SurfaceFromE
*imageOut = surf;
switch (surf->Format()) {
case gfxASurface::ImageFormatARGB32:
case gfxImageFormatARGB32:
*format = WebGLTexelConversions::BGRA8; // careful, our ARGB means BGRA
break;
case gfxASurface::ImageFormatRGB24:
case gfxImageFormatRGB24:
*format = WebGLTexelConversions::BGRX8; // careful, our RGB24 is not tightly packed. Whence BGRX8.
break;
case gfxASurface::ImageFormatA8:
case gfxImageFormatA8:
*format = WebGLTexelConversions::A8;
break;
case gfxASurface::ImageFormatRGB16_565:
case gfxImageFormatRGB16_565:
*format = WebGLTexelConversions::RGB565;
break;
default:

View File

@ -40,12 +40,12 @@ public:
using nsIDOMEventTarget::RemoveEventListener;
using nsIDOMEventTarget::DispatchEvent;
virtual void AddEventListener(const nsAString& aType,
nsIDOMEventListener* aCallback,
EventListener* aCallback,
bool aCapture,
const Nullable<bool>& aWantsUntrusted,
ErrorResult& aRv) = 0;
virtual void RemoveEventListener(const nsAString& aType,
nsIDOMEventListener* aCallback,
EventListener* aCallback,
bool aCapture,
ErrorResult& aRv);
bool DispatchEvent(nsDOMEvent& aEvent, ErrorResult& aRv);

View File

@ -3,19 +3,22 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsMutationEvent_h__
#define nsMutationEvent_h__
#ifndef mozilla_MutationEvent_h__
#define mozilla_MutationEvent_h__
#include "nsGUIEvent.h"
#include "nsIDOMNode.h"
#include "mozilla/BasicEvents.h"
#include "nsCOMPtr.h"
#include "nsIAtom.h"
#include "nsIDOMNode.h"
class nsMutationEvent : public nsEvent
namespace mozilla {
class InternalMutationEvent : public WidgetEvent
{
public:
nsMutationEvent(bool isTrusted, uint32_t msg)
: nsEvent(isTrusted, msg, NS_MUTATION_EVENT),
mAttrChange(0)
InternalMutationEvent(bool aIsTrusted, uint32_t aMessage) :
WidgetEvent(aIsTrusted, aMessage, NS_MUTATION_EVENT),
mAttrChange(0)
{
mFlags.mCancelable = false;
}
@ -26,7 +29,8 @@ public:
nsCOMPtr<nsIAtom> mNewAttrValue;
unsigned short mAttrChange;
void AssignMutationEventData(const nsMutationEvent& aEvent, bool aCopyTargets)
void AssignMutationEventData(const InternalMutationEvent& aEvent,
bool aCopyTargets)
{
AssignEventData(aEvent, aCopyTargets);
@ -38,16 +42,6 @@ public:
}
};
#define NS_MUTATION_START 1800
#define NS_MUTATION_SUBTREEMODIFIED (NS_MUTATION_START)
#define NS_MUTATION_NODEINSERTED (NS_MUTATION_START+1)
#define NS_MUTATION_NODEREMOVED (NS_MUTATION_START+2)
#define NS_MUTATION_NODEREMOVEDFROMDOCUMENT (NS_MUTATION_START+3)
#define NS_MUTATION_NODEINSERTEDINTODOCUMENT (NS_MUTATION_START+4)
#define NS_MUTATION_ATTRMODIFIED (NS_MUTATION_START+5)
#define NS_MUTATION_CHARACTERDATAMODIFIED (NS_MUTATION_START+6)
#define NS_MUTATION_END (NS_MUTATION_START+6)
// Bits are actually checked to optimize mutation event firing.
// That's why I don't number from 0x00. The first event should
// always be 0x01.
@ -59,4 +53,9 @@ public:
#define NS_EVENT_BITS_MUTATION_ATTRMODIFIED 0x20
#define NS_EVENT_BITS_MUTATION_CHARACTERDATAMODIFIED 0x40
#endif // nsMutationEvent_h__
} // namespace mozilla
// TODO: Remove following typedef
typedef mozilla::InternalMutationEvent nsMutationEvent;
#endif // mozilla_MutationEvent_h__

View File

@ -20,10 +20,13 @@ EXPORTS += [
'nsEventStates.h',
'nsIPrivateTextEvent.h',
'nsIPrivateTextRange.h',
'nsMutationEvent.h',
'nsVKList.h',
]
EXPORTS.mozilla += [
'MutationEvent.h',
]
EXPORTS.mozilla.dom += [
'EventTarget.h',
]

View File

@ -7,8 +7,8 @@
#ifndef nsEventDispatcher_h___
#define nsEventDispatcher_h___
#include "mozilla/EventForwards.h"
#include "nsCOMPtr.h"
#include "nsEvent.h"
class nsEventTargetChainItem;
class nsIDOMEvent;
@ -220,7 +220,7 @@ public:
*
* If aTargets is non-null, event target chain will be created, but
* event won't be handled. In this case aEvent->message should be
* NS_EVENT_TYPE_NULL.
* NS_EVENT_NULL.
* @note Use this method when dispatching an nsEvent.
*/
static nsresult Dispatch(nsISupports* aTarget,

View File

@ -154,11 +154,11 @@ EVENT(abort,
EVENT(canplay,
NS_CANPLAY,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(canplaythrough,
NS_CANPLAYTHROUGH,
EventNameType_HTML,
NS_EVENT_NULL )
NS_EVENT)
EVENT(change,
NS_FORM_CHANGE,
EventNameType_HTMLXUL,
@ -208,15 +208,15 @@ EVENT(drop,
EVENT(durationchange,
NS_DURATIONCHANGE,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(emptied,
NS_EMPTIED,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(ended,
NS_ENDED,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(input,
NS_FORM_INPUT,
EventNameType_HTMLXUL,
@ -240,15 +240,15 @@ EVENT(keyup,
EVENT(loadeddata,
NS_LOADEDDATA,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(loadedmetadata,
NS_LOADEDMETADATA,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(loadstart,
NS_LOADSTART,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(mousedown,
NS_MOUSE_BUTTON_DOWN,
EventNameType_All,
@ -280,41 +280,41 @@ EVENT(mouseup,
EVENT(mozfullscreenchange,
NS_FULLSCREENCHANGE,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(mozfullscreenerror,
NS_FULLSCREENERROR,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(mozpointerlockchange,
NS_POINTERLOCKCHANGE,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(mozpointerlockerror,
NS_POINTERLOCKERROR,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
// Not supported yet; probably never because "wheel" is a better idea.
// EVENT(mousewheel)
EVENT(pause,
NS_PAUSE,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(play,
NS_PLAY,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(playing,
NS_PLAYING,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(progress,
NS_PROGRESS,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(ratechange,
NS_RATECHANGE,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(reset,
NS_FORM_RESET,
EventNameType_HTMLXUL,
@ -322,11 +322,11 @@ EVENT(reset,
EVENT(seeked,
NS_SEEKED,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(seeking,
NS_SEEKING,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(select,
NS_FORM_SELECTED,
EventNameType_HTMLXUL,
@ -338,7 +338,7 @@ EVENT(show,
EVENT(stalled,
NS_STALLED,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(submit,
NS_FORM_SUBMIT,
EventNameType_HTMLXUL,
@ -346,19 +346,19 @@ EVENT(submit,
EVENT(suspend,
NS_SUSPEND,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(timeupdate,
NS_TIMEUPDATE,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(volumechange,
NS_VOLUMECHANGE,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(waiting,
NS_WAITING,
EventNameType_HTML,
NS_EVENT_NULL)
NS_EVENT)
EVENT(wheel,
NS_WHEEL_WHEEL,
EventNameType_All,
@ -404,7 +404,7 @@ FORWARDED_EVENT(load,
FORWARDED_EVENT(scroll,
NS_SCROLL_EVENT,
(EventNameType_HTMLXUL | EventNameType_SVGSVG),
NS_EVENT_NULL)
NS_EVENT)
WINDOW_EVENT(afterprint,
NS_AFTERPRINT,
@ -448,7 +448,7 @@ WINDOW_EVENT(pageshow,
WINDOW_EVENT(popstate,
NS_POPSTATE,
EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
NS_EVENT_NULL)
NS_EVENT)
// Not supported yet
// WINDOW_EVENT(redo)
WINDOW_EVENT(resize,
@ -530,7 +530,7 @@ TOUCH_EVENT(touchcancel,
DOCUMENT_ONLY_EVENT(readystatechange,
NS_READYSTATECHANGE,
EventNameType_HTMLXUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(MozMouseHittest,
NS_MOUSE_MOZHITTEST,
@ -616,7 +616,7 @@ NON_IDL_EVENT(warning,
NON_IDL_EVENT(text,
NS_TEXT_TEXT,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(compositionstart,
NS_COMPOSITION_START,
EventNameType_XUL,
@ -636,31 +636,31 @@ NON_IDL_EVENT(command,
NON_IDL_EVENT(close,
NS_XUL_CLOSE,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(popupshowing,
NS_XUL_POPUP_SHOWING,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(popupshown,
NS_XUL_POPUP_SHOWN,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(popuphiding,
NS_XUL_POPUP_HIDING,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(popuphidden,
NS_XUL_POPUP_HIDDEN,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(broadcast,
NS_XUL_BROADCAST,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(commandupdate,
NS_XUL_COMMAND_UPDATE,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(dragexit,
NS_DRAGDROP_EXIT_SYNTH,
EventNameType_XUL,
@ -676,11 +676,11 @@ NON_IDL_EVENT(draggesture,
NON_IDL_EVENT(overflow,
NS_SCROLLPORT_OVERFLOW,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(underflow,
NS_SCROLLPORT_UNDERFLOW,
EventNameType_XUL,
NS_EVENT_NULL)
NS_EVENT)
// Various SVG events
NON_IDL_EVENT(SVGLoad,
@ -719,14 +719,14 @@ NON_IDL_EVENT(SVGZoom,
NON_IDL_EVENT(zoom,
NS_SVG_ZOOM,
EventNameType_SVGSVG,
NS_EVENT_NULL)
NS_EVENT)
#endif
// Only map the ID to the real event name when ID_TO_EVENT is defined.
#ifndef ID_TO_EVENT
NON_IDL_EVENT(begin,
NS_SMIL_BEGIN,
EventNameType_SMIL,
NS_EVENT_NULL)
NS_EVENT)
#endif
NON_IDL_EVENT(beginEvent,
NS_SMIL_BEGIN,
@ -737,7 +737,7 @@ NON_IDL_EVENT(beginEvent,
NON_IDL_EVENT(end,
NS_SMIL_END,
EventNameType_SMIL,
NS_EVENT_NULL)
NS_EVENT)
#endif
NON_IDL_EVENT(endEvent,
NS_SMIL_END,
@ -748,7 +748,7 @@ NON_IDL_EVENT(endEvent,
NON_IDL_EVENT(repeat,
NS_SMIL_REPEAT,
EventNameType_SMIL,
NS_EVENT_NULL)
NS_EVENT)
#endif
NON_IDL_EVENT(repeatEvent,
NS_SMIL_REPEAT,
@ -758,7 +758,7 @@ NON_IDL_EVENT(repeatEvent,
NON_IDL_EVENT(MozAudioAvailable,
NS_MOZAUDIOAVAILABLE,
EventNameType_None,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(MozAfterPaint,
NS_AFTERPAINT,
EventNameType_None,
@ -773,23 +773,23 @@ NON_IDL_EVENT(MozScrolledAreaChanged,
NON_IDL_EVENT(gamepadbuttondown,
NS_GAMEPAD_BUTTONDOWN,
EventNameType_None,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(gamepadbuttonup,
NS_GAMEPAD_BUTTONUP,
EventNameType_None,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(gamepadaxismove,
NS_GAMEPAD_AXISMOVE,
EventNameType_None,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(gamepadconnected,
NS_GAMEPAD_CONNECTED,
EventNameType_None,
NS_EVENT_NULL)
NS_EVENT)
NON_IDL_EVENT(gamepaddisconnected,
NS_GAMEPAD_DISCONNECTED,
EventNameType_None,
NS_EVENT_NULL)
NS_EVENT)
#endif
// Simple gesture events

View File

@ -6,7 +6,6 @@
#ifndef nsIPrivateTextEvent_h__
#define nsIPrivateTextEvent_h__
#include "nsEvent.h"
#include "nsISupports.h"
#include "nsIPrivateTextRange.h"

View File

@ -9,7 +9,7 @@
#include "nsISupports.h"
#include "nsString.h"
#include "nsCOMPtr.h"
#include "nsGUIEvent.h"
#include "mozilla/EventForwards.h"
#define NS_IPRIVATETEXTRANGE_IID \
{ 0xf795a44d, 0x413a, 0x4c63, \

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