This commit is contained in:
Nick Alexander 2013-09-25 08:47:59 -07:00
Родитель f8b82bf7ff 1785ae83c7
Коммит 2a54591395
977 изменённых файлов: 24362 добавлений и 15426 удалений

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

@ -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.

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

@ -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);

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

@ -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;

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

@ -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()));

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

@ -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>

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

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

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

@ -803,3 +803,6 @@ pref("gfx.canvas.azure.accelerated", true);
// Enable Telephony API
pref("dom.telephony.enabled", true);
// The url of the page used to display network error details.
pref("b2g.neterror.url", "app://system.gaiamobile.org/net_error.html");

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

@ -1,131 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This defines the look-and-feel styling of the error pages.
* (see: netError.xhtml)
*
* Original styling by William Price <bugzilla@mob.rice.edu>
* Updated for mobile by: Wes Johnston <wjohnston@mozilla.com>
*/
body {
margin: 0;
padding: 0 8px 8px;
font-family: "Nokia Sans", Tahoma, sans-serif !important;
}
h1 {
font-size: 22px;
}
h2 {
font-size: 16px;
}
ul {
margin: 0px;
padding: 0px 0px 0px 1em;
}
li {
margin: 0px;
padding: 8px 0px;
}
#errorPage {
background-color: #CEE6F4;
}
#errorPage.certerror {
background-color: #EFD400;
}
#errorPage.blockedsite {
background-color: #BF0000;
}
#errorTitle {
background: url("chrome://browser/content/images/errorpage-warning.png") left center no-repeat;
/* Scaled by .666 of their actual size */
background-size: 40px 40px;
background-origin: content-box;
min-height: 60px;
margin-left: auto;
margin-right: auto;
max-width: 500px;
margin-left: auto;
margin-right: auto;
}
#errorPage.certerror #errorTitle {
background-image: url("chrome://browser/content/images/errorpage-larry-black.png");
}
#errorPage.blockedsite #errorTitle {
background-image: url("chrome://browser/content/images/errorpage-larry-white.png");
color: white;
}
.errorTitleText {
padding: 0px 0px 0px 50px;
display: inline-block;
vertical-align: middle
}
#errorPageContainer {
background-color: white;
border: 1px solid #999999;
border-radius: 6px;
padding: 6px 20px 20px;
font-size: 14px;
max-width: 500px;
margin-left: auto;
margin-right: auto;
}
#errorShortDesc > p:empty {
display: none;
}
#errorShortDesc > p {
overflow: auto;
border-bottom: 1px solid #999999;
padding-bottom: 1em;
}
#errorPage.blockedsite #errorShortDesc > p {
font-weight: bold;
border-bottom: none;
padding-bottom: 0px;
}
#securityOverrideDiv {
padding-top: 10px;
}
div[collapsed] {
padding-left: 15px;
background-image: url("chrome://browser/skin/images/arrowright-16.png");
background-size: 11px 11px;
background-repeat: no-repeat;
background-position: left 0.3em;
}
div[collapsed="true"] {
background-image: url("chrome://browser/skin/images/arrowright-16.png");
}
div[collapsed="false"] {
background-image: url("chrome://browser/skin/images/arrowdown-16.png");
}
div[collapsed="true"] > p,
div[collapsed="true"] > div {
display: none;
}
button {
padding: 0.3em !important;
}

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

@ -1,364 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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/. -->
<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % netErrorDTD
SYSTEM "chrome://global/locale/netError.dtd">
%netErrorDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width; user-scalable=false;" />
<title>&loadError.label;</title>
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
<!-- If the location of the favicon is changed here, the FAVICON_ERRORPAGE_URL symbol in
toolkit/components/places/src/nsFaviconService.h should be updated. -->
<link rel="icon" type="image/png" id="favicon" href="chrome://global/skin/icons/warning-16.png"/>
<script type="application/javascript"><![CDATA[
// Error url MUST be formatted like this:
// moz-neterror:page?e=error&u=url&d=desc
//
// or optionally, to specify an alternate CSS class to allow for
// custom styling and favicon:
//
// moz-neterror:page?e=error&u=url&s=classname&d=desc
// Note that this file uses document.documentURI to get
// the URL (with the format from above). This is because
// document.location.href gets the current URI off the docshell,
// which is the URL displayed in the location bar, i.e.
// the URI that the user attempted to load.
function getErrorCode()
{
var url = document.documentURI;
var error = url.search(/e\=/);
var duffUrl = url.search(/\&u\=/);
return decodeURIComponent(url.slice(error + 2, duffUrl));
}
function getCSSClass()
{
var url = document.documentURI;
var matches = url.match(/s\=([^&]+)\&/);
// s is optional, if no match just return nothing
if (!matches || matches.length < 2)
return "";
// parenthetical match is the second entry
return decodeURIComponent(matches[1]);
}
function getDescription()
{
var url = document.documentURI;
var desc = url.search(/d\=/);
// desc == -1 if not found; if so, return an empty string
// instead of what would turn out to be portions of the URI
if (desc == -1)
return "";
return decodeURIComponent(url.slice(desc + 2));
}
function retryThis(buttonEl)
{
// Note: The application may wish to handle switching off "offline mode"
// before this event handler runs, by using a capturing event handler.
// Session history has the URL of the page that failed
// to load, not the one of the error page. So, just call
// reload(), which will also repost POST data correctly.
try {
location.reload();
} catch (e) {
// We probably tried to reload a URI that caused an exception to
// occur; e.g. a nonexistent file.
}
buttonEl.disabled = true;
}
function initPage()
{
var err = getErrorCode();
// if it's an unknown error or there's no title or description
// defined, get the generic message
var errTitle = document.getElementById("et_" + err);
var errDesc = document.getElementById("ed_" + err);
if (!errTitle || !errDesc)
{
errTitle = document.getElementById("et_generic");
errDesc = document.getElementById("ed_generic");
}
var title = document.getElementsByClassName("errorTitleText")[0];
if (title)
{
title.parentNode.replaceChild(errTitle, title);
// change id to the replaced child's id so styling works
errTitle.classList.add("errorTitleText");
}
var sd = document.getElementById("errorShortDescText");
if (sd)
sd.textContent = getDescription();
var ld = document.getElementById("errorLongDesc");
if (ld)
{
ld.parentNode.replaceChild(errDesc, ld);
// change id to the replaced child's id so styling works
errDesc.id = "errorLongDesc";
}
// remove undisplayed errors to avoid bug 39098
var errContainer = document.getElementById("errorContainer");
errContainer.parentNode.removeChild(errContainer);
var className = getCSSClass();
if (className && className != "expertBadCert") {
// Associate a CSS class with the root of the page, if one was passed in,
// to allow custom styling.
// Not "expertBadCert" though, don't want to deal with the favicon
document.documentElement.className = className;
// Also, if they specified a CSS class, they must supply their own
// favicon. In order to trigger the browser to repaint though, we
// need to remove/add the link element.
var favicon = document.getElementById("favicon");
var faviconParent = favicon.parentNode;
faviconParent.removeChild(favicon);
favicon.setAttribute("href", "chrome://global/skin/icons/" + className + "_favicon.png");
faviconParent.appendChild(favicon);
}
if (className == "expertBadCert") {
showSecuritySection();
}
if (err == "remoteXUL") {
// Remove the "Try again" button for remote XUL errors given that
// it is useless.
document.getElementById("errorTryAgain").style.display = "none";
}
if (err == "cspFrameAncestorBlocked") {
// Remove the "Try again" button for CSP frame ancestors violation, since it's
// almost certainly useless. (Bug 553180)
document.getElementById("errorTryAgain").style.display = "none";
}
if (err == "nssBadCert") {
// Remove the "Try again" button for security exceptions, since it's
// almost certainly useless.
document.getElementById("errorTryAgain").style.display = "none";
document.getElementById("errorPage").setAttribute("class", "certerror");
addDomainErrorLink();
}
else {
// Remove the override block for non-certificate errors. CSS-hiding
// isn't good enough here, because of bug 39098
var secOverride = document.getElementById("securityOverrideDiv");
secOverride.parentNode.removeChild(secOverride);
}
}
function showSecuritySection() {
// Swap link out, content in
document.getElementById('securityOverrideContent').style.display = '';
document.getElementById('securityOverrideLink').style.display = 'none';
}
/* In the case of SSL error pages about domain mismatch, see if
we can hyperlink the user to the correct site. We don't want
to do this generically since it allows MitM attacks to redirect
users to a site under attacker control, but in certain cases
it is safe (and helpful!) to do so. Bug 402210
*/
function addDomainErrorLink() {
// Rather than textContent, we need to treat description as HTML
var sd = document.getElementById("errorShortDescText");
if (sd) {
var desc = getDescription();
// sanitize description text - see bug 441169
// First, find the index of the <a> tag we care about, being careful not to
// use an over-greedy regex
var re = /<a id="cert_domain_link" title="([^"]+)">/;
var result = re.exec(desc);
if(!result)
return;
// Remove sd's existing children
sd.textContent = "";
// Everything up to the link should be text content
sd.appendChild(document.createTextNode(desc.slice(0, result.index)));
// Now create the link itself
var anchorEl = document.createElement("a");
anchorEl.setAttribute("id", "cert_domain_link");
anchorEl.setAttribute("title", result[1]);
anchorEl.appendChild(document.createTextNode(result[1]));
sd.appendChild(anchorEl);
// Finally, append text for anything after the closing </a>
sd.appendChild(document.createTextNode(desc.slice(desc.indexOf("</a>") + "</a>".length)));
}
var link = document.getElementById('cert_domain_link');
if (!link)
return;
var okHost = link.getAttribute("title");
var thisHost = document.location.hostname;
var proto = document.location.protocol;
// If okHost is a wildcard domain ("*.example.com") let's
// use "www" instead. "*.example.com" isn't going to
// get anyone anywhere useful. bug 432491
okHost = okHost.replace(/^\*\./, "www.");
/* case #1:
* example.com uses an invalid security certificate.
*
* The certificate is only valid for www.example.com
*
* Make sure to include the "." ahead of thisHost so that
* a MitM attack on paypal.com doesn't hyperlink to "notpaypal.com"
*
* We'd normally just use a RegExp here except that we lack a
* library function to escape them properly (bug 248062), and
* domain names are famous for having '.' characters in them,
* which would allow spurious and possibly hostile matches.
*/
if (endsWith(okHost, "." + thisHost))
link.href = proto + okHost;
/* case #2:
* browser.garage.maemo.org uses an invalid security certificate.
*
* The certificate is only valid for garage.maemo.org
*/
if (endsWith(thisHost, "." + okHost))
link.href = proto + okHost;
}
function endsWith(haystack, needle) {
return haystack.slice(-needle.length) == needle;
}
]]></script>
</head>
<body id="errorPage" dir="&locale.dir;">
<!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
<div id="errorContainer">
<div id="errorTitlesContainer">
<h1 id="et_generic">&generic.title;</h1>
<h1 id="et_dnsNotFound">&dnsNotFound.title;</h1>
<h1 id="et_fileNotFound">&fileNotFound.title;</h1>
<h1 id="et_malformedURI">&malformedURI.title;</h1>
<h1 id="et_protocolNotFound">&protocolNotFound.title;</h1>
<h1 id="et_connectionFailure">&connectionFailure.title;</h1>
<h1 id="et_netTimeout">&netTimeout.title;</h1>
<h1 id="et_redirectLoop">&redirectLoop.title;</h1>
<h1 id="et_unknownSocketType">&unknownSocketType.title;</h1>
<h1 id="et_netReset">&netReset.title;</h1>
<h1 id="et_notCached">&notCached.title;</h1>
<h1 id="et_netOffline">&netOffline.title;</h1>
<h1 id="et_netInterrupt">&netInterrupt.title;</h1>
<h1 id="et_deniedPortAccess">&deniedPortAccess.title;</h1>
<h1 id="et_proxyResolveFailure">&proxyResolveFailure.title;</h1>
<h1 id="et_proxyConnectFailure">&proxyConnectFailure.title;</h1>
<h1 id="et_contentEncodingError">&contentEncodingError.title;</h1>
<h1 id="et_unsafeContentType">&unsafeContentType.title;</h1>
<h1 id="et_nssFailure2">&nssFailure2.title;</h1>
<h1 id="et_nssBadCert">&nssBadCert.title;</h1>
<h1 id="et_cspFrameAncestorBlocked">&cspFrameAncestorBlocked.title;</h1>
<h1 id="et_remoteXUL">&remoteXUL.title;</h1>
<h1 id="et_corruptedContentError">&corruptedContentError.title;</h1>
</div>
<div id="errorDescriptionsContainer">
<div id="ed_generic">&generic.longDesc;</div>
<div id="ed_dnsNotFound">&dnsNotFound.longDesc2;</div>
<div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
<div id="ed_malformedURI">&malformedURI.longDesc;</div>
<div id="ed_protocolNotFound">&protocolNotFound.longDesc;</div>
<div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
<div id="ed_netTimeout">&netTimeout.longDesc;</div>
<div id="ed_redirectLoop">&redirectLoop.longDesc;</div>
<div id="ed_unknownSocketType">&unknownSocketType.longDesc;</div>
<div id="ed_netReset">&netReset.longDesc;</div>
<div id="ed_notCached">&notCached.longDesc;</div>
<div id="ed_netOffline">&netOffline.longDesc2;</div>
<div id="ed_netInterrupt">&netInterrupt.longDesc;</div>
<div id="ed_deniedPortAccess">&deniedPortAccess.longDesc;</div>
<div id="ed_proxyResolveFailure">&proxyResolveFailure.longDesc2;</div>
<div id="ed_proxyConnectFailure">&proxyConnectFailure.longDesc;</div>
<div id="ed_contentEncodingError">&contentEncodingError.longDesc;</div>
<div id="ed_unsafeContentType">&unsafeContentType.longDesc;</div>
<div id="ed_nssFailure2">&nssFailure2.longDesc;</div>
<div id="ed_nssBadCert">&nssBadCert.longDesc2;</div>
<div id="ed_cspFrameAncestorBlocked">&cspFrameAncestorBlocked.longDesc;</div>
<div id="ed_remoteXUL">&remoteXUL.longDesc;</div>
<div id="ed_corruptedContentError">&corruptedContentError.longDesc;</div>
</div>
</div>
<!-- Error Title -->
<div id="errorTitle">
<h1 class="errorTitleText" />
</div>
<!-- PAGE CONTAINER (for styling purposes only) -->
<div id="errorPageContainer">
<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText" />
</div>
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc" />
<!-- Override section - For ssl errors only. Removed on init for other
error types. -->
<div id="securityOverrideDiv">
<a id="securityOverrideLink" href="javascript:showSecuritySection();" >&securityOverride.linkText;</a>
<div id="securityOverrideContent" style="display: none;">&securityOverride.warningContent;</div>
</div>
</div>
<!-- Retry Button -->
<button id="errorTryAgain" onclick="retryThis(this);">&retry.label;</button>
</div>
<!--
- Note: It is important to run the script this way, instead of using
- an onload handler. This is because error pages are loaded as
- LOAD_BACKGROUND, which means that onload handlers will not be executed.
-->
<script type="application/javascript">initPage();</script>
</body>
</html>

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

@ -24,14 +24,10 @@ chrome.jar:
* content/payment.js (content/payment.js)
content/identity.js (content/identity.js)
% override chrome://global/content/netError.xhtml chrome://browser/content/netError.xhtml
% override chrome://global/skin/netError.css chrome://browser/content/netError.css
% override chrome://global/skin/media/videocontrols.css chrome://browser/content/touchcontrols.css
% override chrome://global/content/aboutCertError.xhtml chrome://browser/content/aboutCertError.xhtml
content/ErrorPage.js (content/ErrorPage.js)
content/netError.xhtml (content/netError.xhtml)
content/netError.css (content/netError.css)
content/aboutCertError.xhtml (content/aboutCertError.xhtml)
content/images/errorpage-larry-black.png (content/images/errorpage-larry-black.png)
content/images/errorpage-larry-white.png (content/images/errorpage-larry-white.png)

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

@ -5,16 +5,30 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
function debug(msg) {
//dump("B2GAboutRedirector: " + msg + "\n");
}
function netErrorURL() {
let uri = "app://system.gaiamobile.org/net_error.html";
try {
uri = Services.prefs.getCharPref("b2g.neterror.url");
} catch(e) {}
return uri;
}
let modules = {
certerror: {
uri: "chrome://browser/content/aboutCertError.xhtml",
privileged: false,
hide: true
},
neterror: {
uri: netErrorURL(),
privileged: false,
hide: true
}
};

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

@ -69,6 +69,7 @@ contract @mozilla.org/recovery-service;1 {b3caca5d-0bb0-48c6-912b-6be6cbf08832}
# B2GAboutRedirector
component {920400b1-cf8f-4760-a9c4-441417b15134} B2GAboutRedirector.js
contract @mozilla.org/network/protocol/about;1?what=certerror {920400b1-cf8f-4760-a9c4-441417b15134}
contract @mozilla.org/network/protocol/about;1?what=neterror {920400b1-cf8f-4760-a9c4-441417b15134}
# FilePicker.js
component {436ff8f9-0acc-4b11-8ec7-e293efba3141} FilePicker.js

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

@ -1,4 +1,4 @@
{
"revision": "e03c317f861e6c01078b358321ef8f576ca81377",
"revision": "44efe8a2b5ce1abc18fb4da92fe774d08290bd31",
"repo_path": "/integration/gaia-central"
}

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

@ -1,176 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY loadError.label "Problem loading page">
<!ENTITY retry.label "Try Again">
<!-- Specific error messages -->
<!ENTITY connectionFailure.title "Unable to connect">
<!ENTITY connectionFailure.longDesc "&sharedLongDesc2;">
<!ENTITY deniedPortAccess.title "This address is restricted">
<!ENTITY deniedPortAccess.longDesc "">
<!ENTITY dnsNotFound.title "Server not found">
<!ENTITY dnsNotFound.longDesc2 "
<ul>
<li>Check the address for typing errors such as
<strong>ww</strong>.example.com instead of
<strong>www</strong>.example.com</li>
<li>If you are unable to load any pages, check your device's data or Wi-Fi connection.</li>
</ul>
">
<!ENTITY fileNotFound.title "File not found">
<!ENTITY fileNotFound.longDesc "
<ul>
<li>Check the file name for capitalization or other typing errors.</li>
<li>Check to see if the file was moved, renamed or deleted.</li>
</ul>
">
<!ENTITY generic.title "Oops.">
<!ENTITY generic.longDesc "
<p>&brandShortName; can't load this page for some reason.</p>
">
<!ENTITY malformedURI.title "The address isn't valid">
<!ENTITY malformedURI.longDesc "
<ul>
<li>Web addresses are usually written like
<strong>http://www.example.com/</strong></li>
<li>Make sure that you're using forward slashes (i.e.
<strong>/</strong>).</li>
</ul>
">
<!ENTITY netInterrupt.title "The connection was interrupted">
<!ENTITY netInterrupt.longDesc "&sharedLongDesc2;">
<!ENTITY notCached.title "Document Expired">
<!ENTITY notCached.longDesc "<p>The requested document is not available in &brandShortName;'s cache.</p><ul><li>As a security precaution, &brandShortName; does not automatically re-request sensitive documents.</li><li>Click Try Again to re-request the document from the website.</li></ul>">
<!ENTITY netOffline.title "Offline mode">
<!ENTITY netOffline.longDesc2 "
<ul>
<li>Try again. &brandShortName; will attempt to open a connection and reload the page.</li>
</ul>
">
<!ENTITY contentEncodingError.title "Content Encoding Error">
<!ENTITY contentEncodingError.longDesc "
<ul>
<li>Please contact the website owners to inform them of this problem.</li>
</ul>
">
<!ENTITY unsafeContentType.title "Unsafe File Type">
<!ENTITY unsafeContentType.longDesc "
<ul>
<li>Please contact the website owners to inform them of this problem.</li>
</ul>
">
<!ENTITY netReset.title "The connection was reset">
<!ENTITY netReset.longDesc "&sharedLongDesc2;">
<!ENTITY netTimeout.title "The connection has timed out">
<!ENTITY netTimeout.longDesc "&sharedLongDesc2;">
<!ENTITY protocolNotFound.title "The address wasn't understood">
<!ENTITY protocolNotFound.longDesc "
<ul>
<li>You might need to install other software to open this address.</li>
</ul>
">
<!ENTITY proxyConnectFailure.title "The proxy server is refusing connections">
<!ENTITY proxyConnectFailure.longDesc "
<ul>
<li>Check the proxy settings to make sure that they are correct.</li>
<li>Contact your network administrator to make sure the proxy server is
working.</li>
</ul>
">
<!ENTITY proxyResolveFailure.title "Unable to find the proxy server">
<!ENTITY proxyResolveFailure.longDesc2 "
<ul>
<li>Check the proxy settings to make sure that they are correct.</li>
<li>Check to make sure your device has a working data or Wi-Fi connection.</li>
</ul>
">
<!ENTITY redirectLoop.title "The page isn't redirecting properly">
<!ENTITY redirectLoop.longDesc "
<ul>
<li>This problem can sometimes be caused by disabling or refusing to accept
cookies.</li>
</ul>
">
<!ENTITY unknownSocketType.title "Unexpected response from server">
<!ENTITY unknownSocketType.longDesc "
<ul>
<li>Check to make sure your system has the Personal Security Manager
installed.</li>
<li>This might be due to a non-standard configuration on the server.</li>
</ul>
">
<!ENTITY nssFailure2.title "Secure Connection Failed">
<!ENTITY nssFailure2.longDesc "
<ul>
<li>The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.</li>
<li>Please contact the website owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.</li>
</ul>
">
<!ENTITY nssBadCert.title "Secure Connection Failed">
<!ENTITY nssBadCert.longDesc2 "
<ul>
<li>This could be a problem with the server's configuration, or it could be
someone trying to impersonate the server.</li>
<li>If you have connected to this server successfully in the past, the error may
be temporary, and you can try again later.</li>
</ul>
">
<!ENTITY sharedLongDesc2 "
<ul>
<li>The site could be temporarily unavailable or too busy. Try again in a few moments.</li>
<li>If you are unable to load any pages, check your mobile device's data or Wi-Fi connection.</li>
</ul>
">
<!ENTITY cspFrameAncestorBlocked.title "Blocked by Content Security Policy">
<!ENTITY cspFrameAncestorBlocked.longDesc "<p>&brandShortName; prevented this page from loading in this way because the page has a content security policy that disallows it.</p>">
<!ENTITY corruptedContentError.title "Corrupted Content Error">
<!ENTITY corruptedContentError.longDesc "<p>The page you are trying to view cannot be shown because an error in the data transmission was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
<!ENTITY securityOverride.linkText "Or you can add an exception…">
<!ENTITY securityOverride.getMeOutOfHereButton "Get me out of here!">
<!ENTITY securityOverride.exceptionButtonLabel "Add Exception…">
<!-- LOCALIZATION NOTE (securityOverride.warningContent) - Do not translate the
contents of the <xul:button> tags. The only language content is the label= field,
which uses strings already defined above. The button is included here (instead of
netError.xhtml) because it exposes functionality specific to firefox. -->
<!ENTITY securityOverride.warningContent "
<p>You should not add an exception if you are using an internet connection that you do not trust completely or if you are not used to seeing a warning for this server.</p>
<button id='getMeOutOfHereButton'>&securityOverride.getMeOutOfHereButton;</button>
<button id='exceptionDialogButton'>&securityOverride.exceptionButtonLabel;</button>
">
<!ENTITY remoteXUL.title "Remote XUL">
<!ENTITY remoteXUL.longDesc "<p><ul><li>Please contact the website owners to inform them of this problem.</li></ul></p>">

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

@ -7,10 +7,8 @@
@AB_CD@.jar:
% locale b2g-l10n @AB_CD@ %locale/@AB_CD@/b2g-l10n/
% override chrome://global/locale/netError.dtd chrome://b2g-l10n/locale/netError.dtd
% override chrome://global/locale/aboutCertError.dtd chrome://b2g-l10n/locale/aboutCertError.dtd
% override chrome://global/locale/appstrings.properties chrome://b2g-l10n/locale/appstrings.properties
* locale/@AB_CD@/b2g-l10n/netError.dtd (%chrome/overrides/netError.dtd)
* locale/@AB_CD@/b2g-l10n/aboutCertError.dtd (%chrome/overrides/aboutCertError.dtd)
* locale/@AB_CD@/b2g-l10n/appstrings.properties (%chrome/overrides/appstrings.properties)

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

@ -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

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

@ -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>

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

@ -194,6 +194,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 \
@ -318,6 +319,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 \

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

@ -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();
}

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

@ -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() {

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

@ -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>

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

@ -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");

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

@ -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"

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

@ -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]

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

@ -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

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

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

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

@ -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) => {

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

@ -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;

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

@ -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() {

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

@ -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,

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

@ -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]);

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

@ -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}

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

@ -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.

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

@ -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)

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

@ -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();
}

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

@ -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>

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

@ -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";
});
});
}

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

@ -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");

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

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

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

@ -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() {

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

@ -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();

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

@ -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;
},

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

@ -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");
}

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

@ -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()

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

@ -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">

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

@ -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

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

@ -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;

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

@ -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);

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

@ -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);
}

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

@ -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" >

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

@ -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);

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

@ -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;
}
}
}

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

@ -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":

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

@ -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() {

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

@ -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() {

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

@ -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":

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

@ -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;
}
},

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

@ -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();
}
});

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

@ -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()

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

@ -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");

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

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

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

@ -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"
}
]

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

@ -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);

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

@ -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);

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

@ -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,

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

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

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

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

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

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

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

@ -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>`_.

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

@ -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

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

@ -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,12 @@ 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
if [ -f /c/PROGRA~2/MICROS~2.0/VC/BIN/x86_amd64/link.exe ]; then
# /c/Program Files (x86)/Microsoft Visual Studio 10.0
export LD=c:/PROGRA~2/MICROS~2.0/VC/BIN/x86_amd64/link.exe
else
export LD=c:/tools/msvs10/VC/BIN/x86_amd64/link.exe
fi
. $topsrcdir/build/mozconfig.vs2010-common

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

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

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

@ -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

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

@ -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 #}

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

@ -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"

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

@ -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;

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

@ -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);
}
/**

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

@ -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");

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

@ -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);

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

@ -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"

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

@ -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()) {

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

@ -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"

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

@ -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"

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

@ -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"

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

@ -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"

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

@ -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);

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

@ -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"

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

@ -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]

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

@ -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;

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

@ -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);

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

@ -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));

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

@ -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;

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

@ -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:

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

@ -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);

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

@ -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__

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

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

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

@ -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,

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

@ -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

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

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

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

@ -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, \

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