Merge autoland to mozilla-central. a=merge

This commit is contained in:
Bogdan Tara 2019-12-21 11:44:53 +02:00
Родитель 6b324ee442 955de670f0
Коммит 8d04c3f533
366 изменённых файлов: 8813 добавлений и 14884 удалений

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

@ -1047,10 +1047,6 @@ pref("dom.ipc.shims.enabledWarnings", false);
// Start the Mac sandbox early during child process startup instead
// of when messaged by the parent after the message loop is running.
pref("security.sandbox.content.mac.earlyinit", true);
// Remove this pref once RDD early init is stable on Release.
pref("security.sandbox.rdd.mac.earlyinit", true);
// Remove this pref once GMP early init is stable on Release.
pref("security.sandbox.gmp.mac.earlyinit", true);
// This pref is discussed in bug 1083344, the naming is inspired from its
// Windows counterpart, but on Mac it's an integer which means:

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

@ -99,11 +99,7 @@ add_task(async function testExceptionAddition() {
private: true,
});
browser = privateWin.gBrowser;
let tab = await BrowserTestUtils.openNewForegroundTab({
gBrowser: browser,
waitForLoad: true,
waitForStateStop: true,
});
let tab = await BrowserTestUtils.openNewForegroundTab(browser);
gProtectionsHandler = browser.ownerGlobal.gProtectionsHandler;
ok(gProtectionsHandler, "CB is attached to the private window");
@ -147,11 +143,7 @@ add_task(async function testExceptionPersistence() {
private: true,
});
browser = privateWin.gBrowser;
let tab = await BrowserTestUtils.openNewForegroundTab({
gBrowser: browser,
waitForLoad: true,
waitForStateStop: true,
});
let tab = await BrowserTestUtils.openNewForegroundTab(browser);
gProtectionsHandler = browser.ownerGlobal.gProtectionsHandler;
ok(gProtectionsHandler, "CB is attached to the private window");

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

@ -19,11 +19,6 @@ ChromeUtils.defineModuleGetter(
"CustomizableUI",
"resource:///modules/CustomizableUI.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"E10SUtils",
"resource://gre/modules/E10SUtils.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"ExtensionParent",
@ -292,7 +287,7 @@ class BasePopup {
if (this.extension.remote) {
browser.setAttribute("remote", "true");
browser.setAttribute("remoteType", E10SUtils.EXTENSION_REMOTE_TYPE);
browser.setAttribute("remoteType", this.extension.remoteType);
}
// We only need flex sizing for the sake of the slide-in sub-views of the

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

@ -123,7 +123,6 @@ class ChildDevToolsPanel extends ExtensionCommon.EventEmitter {
}
close() {
this.conduit.close();
this._panelContext = null;
this.context = null;
}
@ -154,8 +153,7 @@ class ChildDevToolsInspectorSidebar extends ExtensionCommon.EventEmitter {
}
close() {
this.conduit.close();
this.content = null;
this.context = null;
}
recvInspectorSidebarShown() {

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

@ -1 +1 @@
8.16
8.17.0

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

@ -2,7 +2,7 @@ language: node_js
node_js:
# when changing this, be sure to edit .nvrmc and package.json too
- 8
- 8.17.*
python:
- "2.7"

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

@ -32,8 +32,7 @@
a {
&:hover {
// text-decoration: underline; didn't quite match comps.
border-bottom: 1px solid var(--newtab-link-primary-color);
text-decoration: underline;
&:active {
border-bottom: 1px solid $blue-70;

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

@ -2469,7 +2469,7 @@ main {
.ds-navigation ul li:last-child::after {
content: none; }
.ds-navigation ul li a:hover {
border-bottom: 1px solid var(--newtab-link-primary-color); }
text-decoration: underline; }
.ds-navigation ul li a:hover:active {
border-bottom: 1px solid #003EAA; }
.ds-navigation ul li a:active {

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

@ -2472,7 +2472,7 @@ main {
.ds-navigation ul li:last-child::after {
content: none; }
.ds-navigation ul li a:hover {
border-bottom: 1px solid var(--newtab-link-primary-color); }
text-decoration: underline; }
.ds-navigation ul li a:hover:active {
border-bottom: 1px solid #003EAA; }
.ds-navigation ul li a:active {

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

@ -2469,7 +2469,7 @@ main {
.ds-navigation ul li:last-child::after {
content: none; }
.ds-navigation ul li a:hover {
border-bottom: 1px solid var(--newtab-link-primary-color); }
text-decoration: underline; }
.ds-navigation ul li a:hover:active {
border-bottom: 1px solid #003EAA; }
.ds-navigation ul li a:active {

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

@ -77,8 +77,8 @@
"engines": {
"firefox": ">=45.0 <=*",
"//": "when changing node versions, also edit .travis.yml and .nvmrc",
"node": "8.*",
"npm": "6.9"
"node": ">=8.17.0 <9.0",
"npm": "6.13.4"
},
"homepage": "https://github.com/mozilla/activity-stream",
"keywords": [

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

@ -663,9 +663,9 @@
container.orient = "horizontal";
arrowbox.orient = "vertical";
if (position.indexOf("_after") > 0) {
arrowbox.pack = "end";
arrowbox.setAttribute("pack", "end");
} else {
arrowbox.pack = "start";
arrowbox.setAttribute("pack", "start");
}
arrowbox.style.transform = "translate(0, " + -offset + "px)";
@ -686,9 +686,9 @@
container.orient = "";
arrowbox.orient = "";
if (position.indexOf("_end") > 0) {
arrowbox.pack = "end";
arrowbox.setAttribute("pack", "end");
} else {
arrowbox.pack = "start";
arrowbox.setAttribute("pack", "start");
}
arrowbox.style.transform = "translate(" + -offset + "px, 0)";

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

@ -0,0 +1,25 @@
/* 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/. */
"use strict";
/* globals browser */
let AVAILABLE_PIP_OVERRIDES;
{
// See PictureInPictureTogglePolicy.jsm for these values.
// eslint-disable-next-line no-unused-vars
const TOGGLE_POLICIES = browser.pictureInPictureChild.getPolicies();
AVAILABLE_PIP_OVERRIDES = {
// The keys of this object are match patterns for URLs, as documented in
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns
//
// Example:
//
// "https://*.youtube.com/*": TOGGLE_POLICIES.THREE_QUARTERS,
// "https://*.twitch.tv/mikeconley_dot_ca/*": TOGGLE_POLICIES.TOP,
};
}

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

@ -0,0 +1,75 @@
/* 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/. */
"use strict";
/* global ChromeUtils, ExtensionAPI, Services */
ChromeUtils.defineModuleGetter(
this,
"Services",
"resource://gre/modules/Services.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"TOGGLE_POLICIES",
"resource://gre/modules/PictureInPictureTogglePolicy.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"AppConstants",
"resource://gre/modules/AppConstants.jsm"
);
const TOGGLE_ENABLED_PREF =
"media.videocontrols.picture-in-picture.video-toggle.enabled";
/**
* This API is expected to be running in the parent process.
*/
this.pictureInPictureParent = class extends ExtensionAPI {
getAPI(context) {
return {
pictureInPictureParent: {
setOverrides(overrides) {
// The Picture-in-Picture toggle is only implemented for Desktop, so make
// this a no-op for non-Desktop builds.
if (AppConstants.platform == "android") {
return;
}
Services.ppmm.sharedData.set(
"PictureInPicture:ToggleOverrides",
overrides
);
},
},
};
}
};
/**
* This API is expected to be running in a content process - specifically,
* the WebExtension content process that the background scripts run in. We
* split these out so that they can return values synchronously to the
* background scripts.
*/
this.pictureInPictureChild = class extends ExtensionAPI {
getAPI(context) {
return {
pictureInPictureChild: {
getPolicies() {
// The Picture-in-Picture toggle is only implemented for Desktop, so make
// this return nothing for non-Desktop builds.
if (AppConstants.platform == "android") {
return {};
}
return Cu.cloneInto(TOGGLE_POLICIES, context.cloneScope);
},
},
};
}
};

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

@ -0,0 +1,39 @@
[
{
"namespace": "pictureInPictureParent",
"description": "Parent process methods for controlling the Picture-in-Picture feature.",
"functions": [
{
"name": "setOverrides",
"type": "function",
"description": "Set Picture-in-Picture toggle position overrides",
"parameters": [
{
"name": "overrides",
"type": "object",
"additionalProperties": { "type": "any" },
"description": "The Picture-in-Picture toggle position overrides to set"
}
]
}
]
},
{
"namespace": "pictureInPictureChild",
"description": "WebExtension process methods for querying the Picture-in-Picture feature.",
"functions": [
{
"name": "getPolicies",
"type": "function",
"description": "Get the Picture-in-Picture toggle position override constants",
"parameters": [],
"returns": {
"type": "object",
"properties": {},
"additionalProperties": { "type": "any" },
"description": "The Picture-in-Picture toggle position override constants"
}
}
]
}
]

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

@ -0,0 +1,17 @@
/* 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/. */
"use strict";
/* globals browser, module */
class PictureInPictureOverrides {
constructor(availableOverrides) {
this._availableOverrides = availableOverrides;
}
bootup() {
browser.pictureInPictureParent.setOverrides(this._availableOverrides);
}
}

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

@ -36,6 +36,22 @@
"paths": [["experiments"]]
}
},
"pictureInPictureChild": {
"schema": "experiment-apis/pictureInPicture.json",
"child": {
"scopes": ["addon_child"],
"script": "experiment-apis/pictureInPicture.js",
"paths": [["pictureInPictureChild"]]
}
},
"pictureInPictureParent": {
"schema": "experiment-apis/pictureInPicture.json",
"parent": {
"scopes": ["addon_parent"],
"script": "experiment-apis/pictureInPicture.js",
"paths": [["pictureInPictureParent"]]
}
},
"sharedPreferences": {
"schema": "experiment-apis/sharedPreferences.json",
"parent": {
@ -59,10 +75,12 @@
"lib/module_shim.js",
"lib/google.js",
"data/injections.js",
"data/picture_in_picture_overrides.js",
"data/ua_overrides.js",
"lib/about_compat_broker.js",
"lib/custom_functions.js",
"lib/injections.js",
"lib/picture_in_picture_overrides.js",
"lib/ua_overrides.js",
"run.js"
]

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

@ -24,6 +24,7 @@ FINAL_TARGET_FILES.features['webcompat@mozilla.org']['about-compat'] += [
FINAL_TARGET_FILES.features['webcompat@mozilla.org']['data'] += [
'data/injections.js',
'data/picture_in_picture_overrides.js',
'data/ua_overrides.js',
]
@ -32,6 +33,8 @@ FINAL_TARGET_FILES.features['webcompat@mozilla.org']['experiment-apis'] += [
'experiment-apis/aboutConfigPrefs.json',
'experiment-apis/experiments.js',
'experiment-apis/experiments.json',
'experiment-apis/pictureInPicture.js',
'experiment-apis/pictureInPicture.json',
'experiment-apis/sharedPreferences.js',
'experiment-apis/sharedPreferences.json',
]
@ -74,6 +77,7 @@ FINAL_TARGET_FILES.features['webcompat@mozilla.org']['lib'] += [
'lib/google.js',
'lib/injections.js',
'lib/module_shim.js',
'lib/picture_in_picture_overrides.js',
'lib/ua_overrides.js',
]

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

@ -5,10 +5,12 @@
"use strict";
/* globals AVAILABLE_INJECTIONS, AVAILABLE_UA_OVERRIDES, AboutCompatBroker,
Injections, UAOverrides, CUSTOM_FUNCTIONS */
Injections, UAOverrides, CUSTOM_FUNCTIONS, AVAILABLE_PIP_OVERRIDES,
PictureInPictureOverrides */
const injections = new Injections(AVAILABLE_INJECTIONS, CUSTOM_FUNCTIONS);
const uaOverrides = new UAOverrides(AVAILABLE_UA_OVERRIDES);
const pipOverrides = new PictureInPictureOverrides(AVAILABLE_PIP_OVERRIDES);
const aboutCompatBroker = new AboutCompatBroker({
injections,
@ -18,3 +20,4 @@ const aboutCompatBroker = new AboutCompatBroker({
aboutCompatBroker.bootup();
injections.bootup();
uaOverrides.bootup();
pipOverrides.bootup();

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

@ -105,6 +105,9 @@
@BINPATH@/@DLL_PREFIX@mozwayland@DLL_SUFFIX@
#endif
#endif
#ifdef MOZ_WASM_SANDBOXING_GRAPHITE
@BINPATH@/@DLL_PREFIX@graphitewasm@DLL_SUFFIX@
#endif
; We don't have a complete view of which dlls to expect when doing an artifact
; build because we haven't run the relevant parts of configure, so we guess

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

@ -243,8 +243,7 @@ def lto(value, c_compiler, ld64_known_good, target, instrumented_build):
if target.os == 'WINNT':
ldflags.append('-mllvm:-import-instr-limit=10');
elif target.os == 'OSX':
# Until OSX gets PGO, too small of a limit will cause slowdowns.
ldflags.append('-Wl,-mllvm,-import-instr-limit=40');
ldflags.append('-Wl,-mllvm,-import-instr-limit=10');
elif c_compiler.type == 'clang':
ldflags.append('-Wl,-plugin-opt=-import-instr-limit=10');

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

@ -259,7 +259,7 @@ const browsingContextTargetPrototype = {
// Flag eventually overloaded by sub classes in order to watch new docshells
// Used by the ParentProcessTargetActor to list all frames in the Browser Toolbox
this.listenForNewDocShells = false;
this.watchNewDocShells = false;
let canRewind = false;
if (isReplaying) {
@ -626,9 +626,7 @@ const browsingContextTargetPrototype = {
_watchDocshells() {
// In child processes, we watch all docshells living in the process.
if (this.listenForNewDocShells) {
Services.obs.addObserver(this, "webnavigation-create");
}
Services.obs.addObserver(this, "webnavigation-create");
Services.obs.addObserver(this, "webnavigation-destroy");
// We watch for all child docshells under the current document,
@ -775,7 +773,11 @@ const browsingContextTargetPrototype = {
// In child processes, we have new root docshells,
// let's watch them and all their child docshells.
if (this._isRootDocShell(docShell)) {
this._progressListener.watch(docShell);
if (this.watchNewDocShells) {
this._progressListener.watch(docShell);
}
} else if (this._progressListener.isParentWatched(docShell)) {
docShell.watchedByDevtools = true;
}
this._notifyDocShellsUpdate([docShell]);
});
@ -945,9 +947,7 @@ const browsingContextTargetPrototype = {
this._originalWindow = null;
// Removes the observers being set in _watchDocShells
if (this.listenForNewDocShells) {
Services.obs.removeObserver(this, "webnavigation-create");
}
Services.obs.removeObserver(this, "webnavigation-create");
Services.obs.removeObserver(this, "webnavigation-destroy");
}
@ -1556,7 +1556,12 @@ DebuggerProgressListener.prototype = {
this._knownWindowIDs.set(getWindowID(win), win);
}
// The watchedByDevtools flag is set on each docshell this target is
// associated with. This enables Gecko behavior tied to this flag, such as
// reporting the contents of HTML loaded in the docshells, or capturing
// stacks for the network monitor.
docShell.watchedByDevtools = true;
getChildDocShells(docShell).forEach(d => (d.watchedByDevtools = true));
},
unwatch(docShell) {
@ -1564,6 +1569,7 @@ DebuggerProgressListener.prototype = {
if (!this._watchedDocShells.has(docShellWindow)) {
return;
}
this._watchedDocShells.delete(docShellWindow);
const webProgress = docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
@ -1589,6 +1595,18 @@ DebuggerProgressListener.prototype = {
}
docShell.watchedByDevtools = false;
getChildDocShells(docShell).forEach(d => (d.watchedByDevtools = false));
},
isParentWatched(docShell) {
let parent = docShell.parent;
while (parent) {
if (this._watchedDocShells.has(parent.domWindow)) {
return true;
}
parent = parent.parent;
}
return false;
},
_getWindowsInDocShell(docShell) {

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

@ -59,7 +59,7 @@ parentProcessTargetPrototype.initialize = function(connection, window) {
});
// Ensure catching the creation of any new content docshell
this.listenForNewDocShells = true;
this.watchNewDocShells = true;
// Defines the default docshell selected for the target actor
if (!window) {

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

@ -26,6 +26,8 @@
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/IdleDeadline.h"
#include "mozilla/dom/JSWindowActorService.h"
#include "mozilla/dom/MediaControlUtils.h"
#include "mozilla/dom/MediaControlService.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ReportingHeader.h"
#include "mozilla/dom/UnionTypes.h"
@ -1173,5 +1175,15 @@ void ChromeUtils::PrivateNoteIntentionalCrash(const GlobalObject& aGlobal,
aError.Throw(NS_ERROR_NOT_IMPLEMENTED);
}
/* static */
void ChromeUtils::GenerateMediaControlKeysTestEvent(
const GlobalObject& aGlobal, MediaControlKeysTestEvent aEvent) {
RefPtr<MediaControlService> service = MediaControlService::GetService();
if (service) {
service->GenerateMediaControlKeysTestEvent(
ConvertMediaControlKeysTestEventToMediaControlKeysEvent(aEvent));
}
}
} // namespace dom
} // namespace mozilla

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

@ -198,6 +198,9 @@ class ChromeUtils {
static void PrivateNoteIntentionalCrash(const GlobalObject& aGlobal,
ErrorResult& aError);
static void GenerateMediaControlKeysTestEvent(
const GlobalObject& aGlobal, MediaControlKeysTestEvent aEvent);
};
} // namespace dom

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

@ -21,6 +21,7 @@ class nsIRadioVisitor;
class nsWindowSizes;
namespace mozilla {
class ErrorResult;
class StyleSheet;
class ErrorResult;

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

@ -1,17 +1,21 @@
<html class="reftest-wait">
<script>
document.fonts.onloadingdone = () => {
document.forms[1].submit();
};
window.onload = () => {
document.forms[0].submit();
setTimeout(() => {
document.documentElement.removeAttribute("class");
}, 1000);
};
if (location.search == "?x=") {
setTimeout(() => window.close(), 1000);
} else {
document.fonts.onloadingdone = () => {
document.forms[1].submit();
};
window.onload = () => {
document.forms[0].submit();
setTimeout(() => {
document.documentElement.removeAttribute("class");
}, 1000);
};
}
</script>
<body>
<form target="x"></form>
<form target="x"></form>
<form target="bug1588259"><input name="x"></form>
<form target="bug1588259"><input name="x"></form>
</body>
</html>

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

@ -2328,7 +2328,7 @@ CallState nsGlobalWindowInner::ShouldReportForServiceWorkerScopeInternal(
// The current window doesn't care about this service worker, but maybe
// one of our child frames does.
return CallOnChildren(
return CallOnInProcessChildren(
&nsGlobalWindowInner::ShouldReportForServiceWorkerScopeInternal, aScope,
aResultOut);
}
@ -2465,7 +2465,6 @@ void nsPIDOMWindowInner::TryToCacheTopInnerWindow() {
}
}
void nsPIDOMWindowInner::UpdateActiveIndexedDBDatabaseCount(int32_t aDelta) {
MOZ_ASSERT(NS_IsMainThread());
@ -5114,7 +5113,7 @@ void nsGlobalWindowInner::Suspend() {
// All children are also suspended. This ensure mSuspendDepth is
// set properly and the timers are properly canceled for each child.
CallOnChildren(&nsGlobalWindowInner::Suspend);
CallOnInProcessChildren(&nsGlobalWindowInner::Suspend);
mSuspendDepth += 1;
if (mSuspendDepth != 1) {
@ -5162,7 +5161,7 @@ void nsGlobalWindowInner::Resume() {
// Resume all children. This restores timers recursively canceled
// in Suspend() and ensures all children have the correct mSuspendDepth.
CallOnChildren(&nsGlobalWindowInner::Resume);
CallOnInProcessChildren(&nsGlobalWindowInner::Resume);
MOZ_ASSERT(mSuspendDepth != 0);
mSuspendDepth -= 1;
@ -5219,7 +5218,7 @@ void nsGlobalWindowInner::FreezeInternal() {
MOZ_DIAGNOSTIC_ASSERT(IsCurrentInnerWindow());
MOZ_DIAGNOSTIC_ASSERT(IsSuspended());
CallOnChildren(&nsGlobalWindowInner::FreezeInternal);
CallOnInProcessChildren(&nsGlobalWindowInner::FreezeInternal);
mFreezeDepth += 1;
MOZ_ASSERT(mSuspendDepth >= mFreezeDepth);
@ -5254,7 +5253,7 @@ void nsGlobalWindowInner::ThawInternal() {
MOZ_DIAGNOSTIC_ASSERT(IsCurrentInnerWindow());
MOZ_DIAGNOSTIC_ASSERT(IsSuspended());
CallOnChildren(&nsGlobalWindowInner::ThawInternal);
CallOnInProcessChildren(&nsGlobalWindowInner::ThawInternal);
MOZ_ASSERT(mFreezeDepth != 0);
mFreezeDepth -= 1;
@ -5330,7 +5329,8 @@ void nsGlobalWindowInner::SyncStateFromParentWindow() {
}
template <typename Method, typename... Args>
CallState nsGlobalWindowInner::CallOnChildren(Method aMethod, Args&... aArgs) {
CallState nsGlobalWindowInner::CallOnInProcessChildren(Method aMethod,
Args&... aArgs) {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(IsCurrentInnerWindow());
@ -5341,22 +5341,11 @@ CallState nsGlobalWindowInner::CallOnChildren(Method aMethod, Args&... aArgs) {
return state;
}
int32_t childCount = 0;
docShell->GetInProcessChildCount(&childCount);
BrowsingContext::Children children;
GetBrowsingContext()->GetChildren(children);
// Take a copy of the current children so that modifications to
// the child list don't affect to the iteration.
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> children;
for (int32_t i = 0; i < childCount; ++i) {
nsCOMPtr<nsIDocShellTreeItem> childShell;
docShell->GetInProcessChildAt(i, getter_AddRefs(childShell));
if (childShell) {
children.AppendElement(childShell);
}
}
for (nsCOMPtr<nsIDocShellTreeItem> childShell : children) {
nsCOMPtr<nsPIDOMWindowOuter> pWin = childShell->GetWindow();
for (const RefPtr<BrowsingContext>& bc : children) {
nsCOMPtr<nsPIDOMWindowOuter> pWin = bc->GetDOMWindow();
if (!pWin) {
continue;
}
@ -7192,7 +7181,7 @@ void nsGlobalWindowInner::ClearActiveStoragePrincipal() {
doc->ClearActiveStoragePrincipal();
}
CallOnChildren(&nsGlobalWindowInner::ClearActiveStoragePrincipal);
CallOnInProcessChildren(&nsGlobalWindowInner::ClearActiveStoragePrincipal);
}
bool nsPIDOMWindowInner::HasStorageAccessGranted(

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

@ -1038,7 +1038,7 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
// CallState returned by the last child method invocation is returned or
// CallState::Continue if the method returns void.
template <typename Method, typename... Args>
mozilla::CallState CallOnChildren(Method aMethod, Args&... aArgs);
mozilla::CallState CallOnInProcessChildren(Method aMethod, Args&... aArgs);
// Helper to convert a void returning child method into an implicit
// CallState::Continue value.

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

@ -1779,6 +1779,51 @@ DOMInterfaces = {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestPrefConstructorForInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestConstructorForPrefInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestPrefConstructorForDifferentPrefInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestConstructorForSCInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestSCConstructorForInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestConstructorForFuncInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestFuncConstructorForInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestFuncConstructorForDifferentFuncInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestPrefChromeOnlySCFuncConstructorForInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
}
# These are temporary, until they've been converted to use new DOM bindings

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

@ -1860,15 +1860,17 @@ class CGClassConstructor(CGAbstractStaticMethod):
""",
name=self.descriptor.name)
# [ChromeOnly] interfaces may only be constructed by chrome.
chromeOnlyCheck = ""
if isChromeOnly(self._ctor):
chromeOnlyCheck = dedent("""
if (!nsContentUtils::ThreadsafeIsSystemCaller(cx)) {
return ThrowingConstructor(cx, argc, vp);
}
# If the interface is already SecureContext, notify getConditionList to skip that check,
# because the constructor won't be exposed in non-secure contexts to start with.
alreadySecureContext = self.descriptor.interface.getExtendedAttribute("SecureContext")
""")
# We want to throw if any of the conditions returned by getConditionList are false.
conditionsCheck = ""
rawConditions = getRawConditionList(self._ctor, "cx", "obj", alreadySecureContext)
if len(rawConditions) > 0:
notConditions = " ||\n".join("!" + cond for cond in rawConditions)
failedCheckAction = CGGeneric("return ThrowingConstructor(cx, argc, vp);\n")
conditionsCheck = CGIfWrapper(failedCheckAction, notConditions).define() + "\n"
# Additionally, we want to throw if a caller does a bareword invocation
# of a constructor without |new|.
@ -1887,7 +1889,7 @@ class CGClassConstructor(CGAbstractStaticMethod):
"""
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::Rooted<JSObject*> obj(cx, &args.callee());
$*{chromeOnlyCheck}
$*{conditionsCheck}
if (!args.isConstructing()) {
return ThrowConstructorWithoutNew(cx, "${ctorName}");
}
@ -1900,7 +1902,7 @@ class CGClassConstructor(CGAbstractStaticMethod):
return false;
}
""",
chromeOnlyCheck=chromeOnlyCheck,
conditionsCheck=conditionsCheck,
ctorName=ctorName,
name=self.descriptor.name)
@ -3444,7 +3446,7 @@ class CGGetNamedPropertiesObjectMethod(CGAbstractStaticMethod):
nativeType=self.descriptor.nativeType)
def getConditionList(idlobj, cxName, objName):
def getRawConditionList(idlobj, cxName, objName, ignoreSecureContext = False):
"""
Get the list of conditions for idlobj (to be used in "is this enabled"
checks). This will be returned as a CGList with " &&\n" as the separator,
@ -3453,22 +3455,33 @@ def getConditionList(idlobj, cxName, objName):
objName is the name of the object that we're working with, because some of
our test functions want that.
The return value is a possibly-empty CGList of conditions.
ignoreSecureContext is used only for constructors in which the WebIDL interface
itself is already marked as [SecureContext]. There is no need to do the work twice.
"""
conditions = []
pref = idlobj.getExtendedAttribute("Pref")
if pref:
assert isinstance(pref, list) and len(pref) == 1
conditions.append("StaticPrefs::%s()" % prefIdentifier(pref[0]))
if idlobj.getExtendedAttribute("ChromeOnly"):
if isChromeOnly(idlobj):
conditions.append("nsContentUtils::ThreadsafeIsSystemCaller(%s)" % cxName)
func = idlobj.getExtendedAttribute("Func")
if func:
assert isinstance(func, list) and len(func) == 1
conditions.append("%s(%s, %s)" % (func[0], cxName, objName))
if idlobj.getExtendedAttribute("SecureContext"):
if not ignoreSecureContext and idlobj.getExtendedAttribute("SecureContext"):
conditions.append("mozilla::dom::IsSecureContextOrObjectIsFromSecureContext(%s, %s)" % (cxName, objName))
return conditions
def getConditionList(idlobj, cxName, objName, ignoreSecureContext = False):
"""
Get the list of conditions from getRawConditionList
See comment on getRawConditionList above for more info about arguments.
The return value is a possibly-empty conjunctive CGList of conditions.
"""
conditions = getRawConditionList(idlobj, cxName, objName, ignoreSecureContext)
return CGList((CGGeneric(cond) for cond in conditions), " &&\n")
@ -15114,9 +15127,10 @@ class CGBindingRoot(CGThing):
"""
obj might be a dictionary member or an interface.
"""
pref = PropertyDefiner.getStringAttr(obj, "Pref")
if pref:
bindingHeaders[prefHeader(pref)] = True
if obj is not None:
pref = PropertyDefiner.getStringAttr(obj, "Pref")
if pref:
bindingHeaders[prefHeader(pref)] = True
def addPrefHeadersForDictionary(bindingHeaders, dictionary):
while dictionary:
@ -15127,7 +15141,9 @@ class CGBindingRoot(CGThing):
for d in dictionaries:
addPrefHeadersForDictionary(bindingHeaders, d)
for d in descriptors:
addPrefHeaderForObject(bindingHeaders, d.interface)
interface = d.interface
addPrefHeaderForObject(bindingHeaders, interface)
addPrefHeaderForObject(bindingHeaders, interface.ctor())
bindingHeaders["mozilla/dom/WebIDLPrefs.h"] = any(
descriptorHasPrefDisabler(d) for d in descriptors)

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

@ -5488,7 +5488,9 @@ class IDLConstructor(IDLMethod):
identifier == "ChromeOnly" or
identifier == "NewObject" or
identifier == "SecureContext" or
identifier == "Throws"):
identifier == "Throws" or
identifier == "Func" or
identifier == "Pref"):
IDLMethod.handleExtendedAttribute(self, attr)
elif identifier == "HTMLConstructor":
if not attr.noArguments():

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

@ -11,9 +11,9 @@ def WebIDLTest(parser, harness):
harness.check(argument.variadic, variadic, "Argument has the right variadic value")
def checkMethod(method, QName, name, signatures,
static=True, getter=False, setter=False,
deleter=False, legacycaller=False, stringifier=False,
chromeOnly=False, htmlConstructor=False):
static=True, getter=False, setter=False, deleter=False,
legacycaller=False, stringifier=False, chromeOnly=False,
htmlConstructor=False, secureContext=False, pref=None, func=None):
harness.ok(isinstance(method, WebIDL.IDLMethod),
"Should be an IDLMethod")
harness.ok(method.isMethod(), "Method is a method")
@ -30,6 +30,9 @@ def WebIDLTest(parser, harness):
harness.check(method.getExtendedAttribute("ChromeOnly") is not None, chromeOnly, "Method has the correct value for ChromeOnly")
harness.check(method.isHTMLConstructor(), htmlConstructor, "Method has the correct htmlConstructor value")
harness.check(len(method.signatures()), len(signatures), "Method has the correct number of signatures")
harness.check(method.getExtendedAttribute("Pref"), pref, "Method has the correct pref value")
harness.check(method.getExtendedAttribute("Func"), func, "Method has the correct func value")
harness.check(method.getExtendedAttribute("SecureContext") is not None, secureContext, "Method has the correct SecureContext value")
sigpairs = zip(method.signatures(), signatures)
for (gotSignature, expectedSignature) in sigpairs:
@ -88,6 +91,21 @@ def WebIDLTest(parser, harness):
results = parser.finish()
checkResults(results)
parser = parser.reset()
parser.parse("""
interface TestPrefConstructor {
[Pref="dom.webidl.test1"] constructor();
};
""")
results = parser.finish()
harness.check(len(results), 1, "Should be one production")
harness.ok(isinstance(results[0], WebIDL.IDLInterface),
"Should be an IDLInterface")
checkMethod(results[0].ctor(), "::TestPrefConstructor::constructor",
"constructor", [("TestPrefConstructor (Wrapper)", [])],
pref=["dom.webidl.test1"])
parser = parser.reset()
parser.parse("""
interface TestChromeOnlyConstructor {
@ -103,6 +121,53 @@ def WebIDLTest(parser, harness):
"constructor", [("TestChromeOnlyConstructor (Wrapper)", [])],
chromeOnly=True)
parser = parser.reset()
parser.parse("""
interface TestSCConstructor {
[SecureContext] constructor();
};
""")
results = parser.finish()
harness.check(len(results), 1, "Should be one production")
harness.ok(isinstance(results[0], WebIDL.IDLInterface),
"Should be an IDLInterface")
checkMethod(results[0].ctor(), "::TestSCConstructor::constructor",
"constructor", [("TestSCConstructor (Wrapper)", [])],
secureContext=True)
parser = parser.reset()
parser.parse("""
interface TestFuncConstructor {
[Func="Document::IsWebAnimationsEnabled"] constructor();
};
""")
results = parser.finish()
harness.check(len(results), 1, "Should be one production")
harness.ok(isinstance(results[0], WebIDL.IDLInterface),
"Should be an IDLInterface")
checkMethod(results[0].ctor(), "::TestFuncConstructor::constructor",
"constructor", [("TestFuncConstructor (Wrapper)", [])],
func=["Document::IsWebAnimationsEnabled"])
parser = parser.reset()
parser.parse("""
interface TestPrefChromeOnlySCFuncConstructor {
[ChromeOnly, Pref="dom.webidl.test1", SecureContext, Func="Document::IsWebAnimationsEnabled"]
constructor();
};
""")
results = parser.finish()
harness.check(len(results), 1, "Should be one production")
harness.ok(isinstance(results[0], WebIDL.IDLInterface),
"Should be an IDLInterface")
checkMethod(results[0].ctor(), "::TestPrefChromeOnlySCFuncConstructor::constructor",
"constructor", [("TestPrefChromeOnlySCFuncConstructor (Wrapper)", [])],
func=["Document::IsWebAnimationsEnabled"], pref=["dom.webidl.test1"],
chromeOnly=True, secureContext=True)
parser = parser.reset()
parser.parse("""
interface TestHTMLConstructor {

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

@ -1578,6 +1578,114 @@ class TestAttributesOnTypes : public nsISupports, public nsWrapperCache {
void ArgWithAttr(uint8_t arg1, const Optional<uint8_t>& arg2);
};
class TestPrefConstructorForInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// Since only the constructor is under a pref,
// the generated constructor should check for the pref.
static already_AddRefed<TestPrefConstructorForInterface> Constructor(
const GlobalObject&);
};
class TestConstructorForPrefInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// Since the interface itself is under a Pref, there should be no
// check for the pref in the generated constructor.
static already_AddRefed<TestConstructorForPrefInterface> Constructor(
const GlobalObject&);
};
class TestPrefConstructorForDifferentPrefInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// Since the constructor's pref is different than the interface pref
// there should still be a check for the pref in the generated constructor.
static already_AddRefed<TestPrefConstructorForDifferentPrefInterface>
Constructor(const GlobalObject&);
};
class TestConstructorForSCInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// Since the interface itself is SecureContext, there should be no
// check for SecureContext in the constructor.
static already_AddRefed<TestConstructorForSCInterface> Constructor(
const GlobalObject&);
};
class TestSCConstructorForInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// Since the interface context is unspecified but the constructor is
// SecureContext, the generated constructor should check for SecureContext.
static already_AddRefed<TestSCConstructorForInterface> Constructor(
const GlobalObject&);
};
class TestConstructorForFuncInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// Since the interface has a Func attribute, but the constructor does not,
// the generated constructor should not check for the Func.
static already_AddRefed<TestConstructorForFuncInterface> Constructor(
const GlobalObject&);
};
class TestFuncConstructorForInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// Since the constructor has a Func attribute, but the interface does not,
// the generated constructor should check for the Func.
static already_AddRefed<TestFuncConstructorForInterface> Constructor(
const GlobalObject&);
};
class TestFuncConstructorForDifferentFuncInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// Since the constructor has a different Func attribute from the interface,
// the generated constructor should still check for its conditional func.
static already_AddRefed<TestFuncConstructorForDifferentFuncInterface>
Constructor(const GlobalObject&);
};
class TestPrefChromeOnlySCFuncConstructorForInterface : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_ISUPPORTS
virtual nsISupports* GetParentObject();
// There should be checks for all Pref/ChromeOnly/SecureContext/Func
// in the generated constructor.
static already_AddRefed<TestPrefChromeOnlySCFuncConstructorForInterface>
Constructor(const GlobalObject&);
};
} // namespace dom
} // namespace mozilla

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

@ -1392,3 +1392,69 @@ interface TestAttributesOnTypes {
// There aren't any argument-only attributes that we can test here,
// TreatNonCallableAsNull isn't compatible with Clamp-able types
};
[Exposed=Window]
interface TestPrefConstructorForInterface {
// Since only the constructor is under a pref,
// the generated constructor should check for the pref.
[Pref="dom.webidl.test1"] constructor();
};
[Exposed=Window, Pref="dom.webidl.test1"]
interface TestConstructorForPrefInterface {
// Since the interface itself is under a Pref, there should be no
// check for the pref in the generated constructor.
constructor();
};
[Exposed=Window, Pref="dom.webidl.test1"]
interface TestPrefConstructorForDifferentPrefInterface {
// Since the constructor's pref is different than the interface pref
// there should still be a check for the pref in the generated constructor.
[Pref="dom.webidl.test2"] constructor();
};
[Exposed=Window, SecureContext]
interface TestConstructorForSCInterface {
// Since the interface itself is SecureContext, there should be no
// runtime check for SecureContext in the generated constructor.
constructor();
};
[Exposed=Window]
interface TestSCConstructorForInterface {
// Since the interface context is unspecified but the constructor is
// SecureContext, the generated constructor should check for SecureContext.
[SecureContext] constructor();
};
[Exposed=Window, Func="Document::IsWebAnimationsEnabled"]
interface TestConstructorForFuncInterface {
// Since the interface has a Func attribute, but the constructor does not,
// the generated constructor should not check for the Func.
constructor();
};
[Exposed=Window]
interface TestFuncConstructorForInterface {
// Since the constructor has a Func attribute, but the interface does not,
// the generated constructor should check for the Func.
[Func="Document::IsWebAnimationsEnabled"]
constructor();
};
[Exposed=Window, Func="Document::AreWebAnimationsTimelinesEnabled"]
interface TestFuncConstructorForDifferentFuncInterface {
// Since the constructor has a different Func attribute from the interface,
// the generated constructor should still check for its conditional func.
[Func="Document::IsWebAnimationsEnabled"]
constructor();
};
[Exposed=Window]
interface TestPrefChromeOnlySCFuncConstructorForInterface {
[Pref="dom.webidl.test1", ChromeOnly, SecureContext, Func="Document::IsWebAnimationsEnabled"]
// There should be checks for all Pref/ChromeOnly/SecureContext/Func
// in the generated constructor.
constructor();
};

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

@ -23,5 +23,13 @@ JSObject* WrapperCachedNonISupportsTestInterface::WrapObject(
aGivenProto);
}
already_AddRefed<WrapperCachedNonISupportsTestInterface>
WrapperCachedNonISupportsTestInterface::Constructor(
const GlobalObject& aGlobalObject) {
RefPtr<WrapperCachedNonISupportsTestInterface> result =
new WrapperCachedNonISupportsTestInterface();
return result.forget();
}
} // namespace dom
} // namespace mozilla

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

@ -27,6 +27,8 @@ class WrapperCachedNonISupportsTestInterface final : public nsWrapperCache {
public:
WrapperCachedNonISupportsTestInterface() {}
static already_AddRefed<WrapperCachedNonISupportsTestInterface> Constructor(const GlobalObject& aGlobalObject);
protected:
~WrapperCachedNonISupportsTestInterface() {}

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

@ -37,6 +37,8 @@ support-files =
[test_integers.html]
[test_interfaceName.html]
[test_interfaceToString.html]
[test_prefOnConstructor.html]
skip-if = debug == false
[test_exceptions_from_jsimplemented.html]
tags = webrtc
[test_lenientThis.html]

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

@ -0,0 +1,57 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1604340
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1604340</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/* global WrapperCachedNonISupportsTestInterface */
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, go);
async function go() {
await SpecialPowers.pushPrefEnv({set: [["dom.webidl.test1", false]]});
let result = null;
let constructorThrew = false;
try {
result = new WrapperCachedNonISupportsTestInterface();
} catch {
constructorThrew = true;
}
is(result, null, "The result value should remain null if the constructor threw an exception as intended.");
ok(constructorThrew, "The constructor should throw an exception if its pref is not set to true.");
await SpecialPowers.pushPrefEnv({set: [["dom.webidl.test1", true]]});
result = null;
constructorThrew = false;
try {
result = new WrapperCachedNonISupportsTestInterface();
} catch {
constructorThrew = true;
}
isnot(result, null, "Constructor should have executed successfully.");
ok(!constructorThrew, "The constructor should not throw an exception if its pref is set.");
SimpleTest.finish();
}
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1604340">Mozilla Bug 1604340</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

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

@ -441,6 +441,10 @@ partial namespace ChromeUtils {
*/
[ChromeOnly, Throws]
void privateNoteIntentionalCrash();
// This is used to generate fake media control keys event in testing.
[ChromeOnly]
void generateMediaControlKeysTestEvent(MediaControlKeysTestEvent aEvent);
};
/*
@ -675,3 +679,15 @@ enum PopupBlockerState {
"openAbused",
"openOverridden",
};
// Keep this in sync with MediaControlKeysEvent in MediaControlKeysEvent.h!
enum MediaControlKeysTestEvent {
"play",
"pause",
"playPause",
"prevTrack",
"nextTrack",
"seekBackward",
"seekForward",
"stop",
};

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

@ -73,6 +73,7 @@
#include "mozilla/ipc/FileDescriptorSetChild.h"
#include "mozilla/ipc/FileDescriptorUtils.h"
#include "mozilla/ipc/GeckoChildProcessHost.h"
#include "mozilla/ipc/LibrarySandboxPreload.h"
#include "mozilla/ipc/ProcessChild.h"
#include "mozilla/ipc/PChildToParentStreamChild.h"
#include "mozilla/ipc/PParentToChildStreamChild.h"
@ -1802,6 +1803,11 @@ mozilla::ipc::IPCResult ContentChild::RecvSetProcessSandbox(
// We may want to move the sandbox initialization somewhere else
// at some point; see bug 880808.
#if defined(MOZ_SANDBOX)
# ifdef MOZ_USING_WASM_SANDBOXING
mozilla::ipc::PreloadSandboxedDynamicLibraries();
# endif
bool sandboxEnabled = true;
# if defined(XP_LINUX)
// On Linux, we have to support systems that can't use any sandboxing.

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

@ -6,6 +6,11 @@
#include "LSSnapshot.h"
#include "ActorsChild.h"
#include "LocalStorageCommon.h"
#include "LSDatabase.h"
#include "LSWriteOptimizer.h"
#include "mozilla/dom/PBackgroundLSSnapshot.h"
#include "nsContentUtils.h"
namespace mozilla {

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

@ -9,6 +9,15 @@
#include "LSValue.h"
#include "nsCOMPtr.h"
#include "nsDataHashtable.h"
#include "nsIRunnable.h"
#include "nsHashKeys.h"
#include "nsIRunnable.h"
#include "nsTHashtable.h"
class nsITimer;
namespace mozilla {
namespace dom {
@ -19,6 +28,9 @@ class LSSnapshotInitInfo;
class LSWriteAndNotifyInfo;
class SnapshotWriteOptimizer;
template <typename> class Optional;
class LSSnapshot final : public nsIRunnable {
public:
/**

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

@ -8,9 +8,14 @@
#define mozilla_dom_localstorage_LSValue_h
#include "SnappyUtils.h"
#include "nsString.h"
class mozIStorageStatement;
namespace IPC {
template <typename> struct ParamTraits;
}
namespace mozilla {
namespace dom {

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

@ -8,6 +8,7 @@
#define mozilla_dom_localstorage_LSWriteOptimizer_h
#include "mozilla/CheckedInt.h"
#include "nsClassHashtable.h"
namespace mozilla {
namespace dom {

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

@ -7,6 +7,8 @@
#ifndef mozilla_dom_localstorage_SnappyUtils_h
#define mozilla_dom_localstorage_SnappyUtils_h
#include "nsStringFwd.h"
namespace mozilla {
namespace dom {

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

@ -26,11 +26,6 @@
#include "mozilla/Algorithm.h"
#include "mozilla/ipc/CrashReporterClient.h"
#include "mozilla/ipc/ProcessChild.h"
#if defined(MOZ_SANDBOX)
# if defined(XP_MACOSX)
# include "mozilla/Sandbox.h"
# endif
#endif
#include "mozilla/TextUtils.h"
#include "nsDebugImpl.h"
#include "nsExceptionHandler.h"
@ -156,73 +151,6 @@ static bool GetPluginPaths(const nsAString& aPluginPath,
return true;
}
static bool GetAppPaths(nsCString& aAppPath, nsCString& aAppBinaryPath) {
nsAutoCString appPath;
nsAutoCString appBinaryPath(
(CommandLine::ForCurrentProcess()->argv()[0]).c_str());
nsAutoCString::const_iterator start, end;
appBinaryPath.BeginReading(start);
appBinaryPath.EndReading(end);
if (RFindInReadable(NS_LITERAL_CSTRING(".app/Contents/MacOS/"), start, end)) {
end = start;
++end;
++end;
++end;
++end;
appBinaryPath.BeginReading(start);
appPath.Assign(Substring(start, end));
} else {
return false;
}
nsCOMPtr<nsIFile> app, appBinary;
nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(appPath), true,
getter_AddRefs(app));
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(appBinaryPath), true,
getter_AddRefs(appBinary));
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
// Mac sandbox rules expect paths to actual files and directories -- not
// soft links.
aAppPath = GetNativeTarget(app);
appBinaryPath = GetNativeTarget(appBinary);
return true;
}
bool GMPChild::SetMacSandboxInfo(bool aAllowWindowServer) {
if (!mGMPLoader) {
return false;
}
nsAutoCString pluginDirectoryPath, pluginFilePath;
if (!GetPluginPaths(mPluginPath, pluginDirectoryPath, pluginFilePath)) {
return false;
}
nsAutoCString appPath, appBinaryPath;
if (!GetAppPaths(appPath, appBinaryPath)) {
return false;
}
MacSandboxInfo info;
info.type = MacSandboxType_GMP;
info.shouldLog = Preferences::GetBool("security.sandbox.logging.enabled") ||
PR_GetEnv("MOZ_SANDBOX_LOGGING");
info.hasWindowServer = aAllowWindowServer;
info.pluginPath.assign(pluginDirectoryPath.get());
info.pluginBinaryPath.assign(pluginFilePath.get());
info.appPath.assign(appPath.get());
info.appBinaryPath.assign(appBinaryPath.get());
mGMPLoader->SetSandboxInfo(&info);
return true;
}
# endif // MOZ_SANDBOX
#endif // XP_MACOSX
@ -581,7 +509,7 @@ mozilla::ipc::IPCResult GMPChild::AnswerStartPlugin(const nsString& aAdapter) {
InitPlatformAPI(*platformAPI, this);
mGMPLoader = MakeUnique<GMPLoader>();
#if defined(MOZ_SANDBOX)
#if defined(MOZ_SANDBOX) && !defined(XP_MACOSX)
if (!mGMPLoader->CanSandbox()) {
GMP_CHILD_LOG_DEBUG("%s Can't sandbox GMP, failing", __FUNCTION__);
delete platformAPI;
@ -589,26 +517,8 @@ mozilla::ipc::IPCResult GMPChild::AnswerStartPlugin(const nsString& aAdapter) {
}
#endif
bool isChromium = aAdapter.EqualsLiteral("chromium");
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
// If we started the sandbox at launch ("earlyinit"), then we don't
// need to setup sandbox arguments here with SetMacSandboxInfo().
if (!IsMacSandboxStarted()) {
// Use of the chromium adapter indicates we are going to be
// running the Widevine plugin which requires access to the
// WindowServer in the Mac GMP sandbox policy.
if (!SetMacSandboxInfo(isChromium /* allow-window-server */)) {
NS_WARNING("Failed to set Mac GMP sandbox info");
delete platformAPI;
return IPC_FAIL(
this, nsPrintfCString("Failed to set Mac GMP sandbox info.").get());
}
}
#endif
GMPAdapter* adapter = nullptr;
if (isChromium) {
if (aAdapter.EqualsLiteral("chromium")) {
auto&& paths = MakeCDMHostVerificationPaths();
GMP_CHILD_LOG_DEBUG("%s CDM host paths=%s", __func__,
ToCString(paths).get());

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

@ -132,14 +132,6 @@ void GMPLoader::Shutdown() {
}
}
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
void GMPLoader::SetSandboxInfo(MacSandboxInfo* aSandboxInfo) {
if (mSandboxStarter) {
mSandboxStarter->SetSandboxInfo(aSandboxInfo);
}
}
#endif
#if defined(XP_WIN) && defined(MOZ_SANDBOX)
class WinSandboxStarter : public mozilla::gmp::SandboxStarter {
public:
@ -156,32 +148,6 @@ class WinSandboxStarter : public mozilla::gmp::SandboxStarter {
};
#endif
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
class MacSandboxStarter : public mozilla::gmp::SandboxStarter {
public:
bool Start(const char* aLibPath) override {
// If we started the sandbox at launch ("earlyinit"),
// then don't try to start the sandbox again.
if (IsMacSandboxStarted()) {
return true;
}
std::string err;
bool rv = mozilla::StartMacSandbox(mInfo, err);
if (!rv) {
fprintf(stderr, "sandbox_init() failed! Error \"%s\"\n", err.c_str());
}
return rv;
}
void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override {
mInfo = *aSandboxInfo;
}
private:
MacSandboxInfo mInfo;
};
#endif
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
namespace {
class LinuxSandboxStarter : public mozilla::gmp::SandboxStarter {
@ -210,8 +176,6 @@ class LinuxSandboxStarter : public mozilla::gmp::SandboxStarter {
static UniquePtr<SandboxStarter> MakeSandboxStarter() {
#if defined(XP_WIN) && defined(MOZ_SANDBOX)
return mozilla::MakeUnique<WinSandboxStarter>();
#elif defined(XP_MACOSX) && defined(MOZ_SANDBOX)
return mozilla::MakeUnique<MacSandboxStarter>();
#elif defined(XP_LINUX) && defined(MOZ_SANDBOX)
return LinuxSandboxStarter::Make();
#else

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

@ -23,12 +23,6 @@ class SandboxStarter {
public:
virtual ~SandboxStarter() {}
virtual bool Start(const char* aLibPath) = 0;
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
// On OS X we need to set Mac-specific sandbox info just before we start the
// sandbox, which we don't yet know when the GMPLoader and SandboxStarter
// objects are created.
virtual void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) = 0;
#endif
};
// Interface that adapts a plugin to the GMP API.
@ -69,13 +63,6 @@ class GMPLoader {
// plugin library.
void Shutdown();
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
// On OS X we need to set Mac-specific sandbox info just before we start the
// sandbox, which we don't yet know when the GMPLoader and SandboxStarter
// objects are created.
void SetSandboxInfo(MacSandboxInfo* aSandboxInfo);
#endif
bool CanSandbox() const;
private:

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

@ -50,16 +50,11 @@ void GMPProcessParent::InitStaticMainThread() {
// The GMPProcessParent constructor is called off the
// main thread. Do main thread initialization here.
MOZ_ASSERT(NS_IsMainThread());
sLaunchWithMacSandbox =
Preferences::GetBool("security.sandbox.gmp.mac.earlyinit", true) &&
(getenv("MOZ_DISABLE_GMP_SANDBOX") == nullptr);
sMacSandboxGMPLogging =
Preferences::GetBool("security.sandbox.logging.enabled") ||
PR_GetEnv("MOZ_SANDBOX_GMP_LOGGING") || PR_GetEnv("MOZ_SANDBOX_LOGGING");
GMP_LOG_DEBUG(
"GMPProcessParent::InitStaticMainThread: earlyinit=%s, logging=%s",
sLaunchWithMacSandbox ? "true" : "false",
sMacSandboxGMPLogging ? "true" : "false");
GMP_LOG_DEBUG("GMPProcessParent::InitStaticMainThread: sandbox logging=%s",
sMacSandboxGMPLogging ? "true" : "false");
# if defined(DEBUG)
sIsMainThreadInitDone = true;
# endif

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

@ -26,9 +26,7 @@ protocol PRDD
{
parent:
async Init(GfxVarUpdate[] vars,
FileDescriptor? sandboxBroker,
bool startMacSandbox);
async Init(GfxVarUpdate[] vars, FileDescriptor? sandboxBroker);
async InitProfiler(Endpoint<PProfilerChild> endpoint);

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

@ -36,7 +36,7 @@ RDDChild::RDDChild(RDDProcessHost* aHost) : mHost(aHost) {
RDDChild::~RDDChild() { MOZ_COUNT_DTOR(RDDChild); }
bool RDDChild::Init(bool aStartMacSandbox) {
bool RDDChild::Init() {
Maybe<FileDescriptor> brokerFd;
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
@ -56,7 +56,7 @@ bool RDDChild::Init(bool aStartMacSandbox) {
nsTArray<GfxVarUpdate> updates = gfxVars::FetchNonDefaultVars();
SendInit(updates, brokerFd, aStartMacSandbox);
SendInit(updates, brokerFd);
#ifdef MOZ_GECKO_PROFILER
Unused << SendInitProfiler(ProfilerParent::CreateForProcess(OtherPid()));

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

@ -34,7 +34,7 @@ class RDDChild final : public PRDDChild,
explicit RDDChild(RDDProcessHost* aHost);
~RDDChild();
bool Init(bool aStartMacSandbox);
bool Init();
void OnCompositorUnexpectedShutdown() override;
void OnVarChanged(const GfxVarUpdate& aVar) override;

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

@ -32,7 +32,6 @@
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
# include "mozilla/Sandbox.h"
# include "nsMacUtilsImpl.h"
# include <Carbon/Carbon.h> // for CGSSetDenyWindowServerConnections
# include "RDDProcessHost.h"
#endif
@ -99,34 +98,12 @@ bool RDDParent::Init(base::ProcessId aParentPid, const char* aParentBuildID,
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
extern "C" {
CGError CGSSetDenyWindowServerConnections(bool);
void CGSShutdownServerConnections();
};
static void StartRDDMacSandbox() {
// Actual security benefits are only acheived when we additionally deny
// future connections.
CGError result = CGSSetDenyWindowServerConnections(true);
MOZ_DIAGNOSTIC_ASSERT(result == kCGErrorSuccess);
# if !MOZ_DIAGNOSTIC_ASSERT_ENABLED
Unused << result;
# endif
MacSandboxInfo info;
RDDProcessHost::StaticFillMacSandboxInfo(info);
std::string err;
bool rv = mozilla::StartMacSandbox(info, err);
if (!rv) {
NS_WARNING(err.c_str());
MOZ_CRASH("mozilla::StartMacSandbox failed");
}
}
#endif
mozilla::ipc::IPCResult RDDParent::RecvInit(
nsTArray<GfxVarUpdate>&& vars, const Maybe<FileDescriptor>& aBrokerFd,
bool aStartMacSandbox) {
nsTArray<GfxVarUpdate>&& vars, const Maybe<FileDescriptor>& aBrokerFd) {
for (const auto& var : vars) {
gfxVars::ApplyUpdate(var);
}
@ -138,13 +115,6 @@ mozilla::ipc::IPCResult RDDParent::RecvInit(
// because it's not running a native event loop. See bug 1384336.
CGSShutdownServerConnections();
if (aStartMacSandbox) {
StartRDDMacSandbox();
} else {
# ifdef DEBUG
AssertMacSandboxEnabled();
# endif
}
# elif defined(XP_LINUX)
int fd = -1;
if (aBrokerFd.isSome()) {

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

@ -25,8 +25,7 @@ class RDDParent final : public PRDDParent {
MessageLoop* aIOLoop, IPC::Channel* aChannel);
mozilla::ipc::IPCResult RecvInit(nsTArray<GfxVarUpdate>&& vars,
const Maybe<ipc::FileDescriptor>& aBrokerFd,
bool aStartMacSandbox);
const Maybe<ipc::FileDescriptor>& aBrokerFd);
mozilla::ipc::IPCResult RecvInitProfiler(
Endpoint<PProfilerChild>&& aEndpoint);

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

@ -35,13 +35,8 @@ RDDProcessHost::RDDProcessHost(Listener* aListener)
MOZ_COUNT_CTOR(RDDProcessHost);
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
// sLaunchWithMacSandbox is statically initialized to false.
// Once we've set it to true due to the pref, avoid checking the
// pref on subsequent calls. As a result, changing the earlyinit
// pref requires restarting the browser to take effect.
if (!sLaunchWithMacSandbox) {
sLaunchWithMacSandbox =
Preferences::GetBool("security.sandbox.rdd.mac.earlyinit");
sLaunchWithMacSandbox = (PR_GetEnv("MOZ_DISABLE_RDD_SANDBOX") == nullptr);
}
mDisableOSActivityMode = sLaunchWithMacSandbox;
#endif
@ -162,15 +157,7 @@ void RDDProcessHost::InitAfterConnect(bool aSucceeded) {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1555076#c7
mPrefSerializer = nullptr;
bool startMacSandbox = false;
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
// If the sandbox was started at launch time,
// do not start the sandbox again.
startMacSandbox = !sLaunchWithMacSandbox;
#endif
if (!mRDDChild->Init(startMacSandbox)) {
if (!mRDDChild->Init()) {
// Can't just kill here because it will create a timing race that
// will crash the tab. We don't really want to crash the tab just
// because RDD linux sandbox failed to initialize. In this case,

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

@ -25,8 +25,6 @@ namespace dom {
("MediaControlKeysHandler=%p, " msg, this, \
ToMediaControlKeysEventStr(key), ##__VA_ARGS__));
NS_IMPL_ISUPPORTS0(MediaControlKeysHandler)
void MediaControlKeysHandler::OnKeyPressed(MediaControlKeysEvent aKeyEvent) {
LOG_KEY("OnKeyPressed '%s'", aKeyEvent);
@ -71,8 +69,6 @@ void MediaControlKeysHandler::OnKeyPressed(MediaControlKeysEvent aKeyEvent) {
}
}
NS_IMPL_ISUPPORTS0(MediaControlKeysEventSource)
void MediaControlKeysEventSource::AddListener(
MediaControlKeysEventListener* aListener) {
MOZ_ASSERT(aListener);

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

@ -15,6 +15,7 @@ namespace dom {
* MediaControlKeysEvent represents all possible control buttons in controller
* interface, no matter it's physical one, such as keyboard, headset, or a
* virtual one, such as the interface provided by Android MediaController.
* Note. keep this sync with `MediaControlKeysTestEvent` in ChromeUtils.webidl.
*/
enum class MediaControlKeysEvent : uint32_t {
ePlay,
@ -35,8 +36,9 @@ enum class MediaControlKeysEvent : uint32_t {
* and then everytime when the media key events occur, `OnKeyPressed` will be
* called so that we can do related handling.
*/
class MediaControlKeysEventListener : public nsISupports {
class MediaControlKeysEventListener {
public:
NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
MediaControlKeysEventListener() = default;
virtual void OnKeyPressed(MediaControlKeysEvent aKeyEvent) = 0;
@ -51,8 +53,7 @@ class MediaControlKeysEventListener : public nsISupports {
*/
class MediaControlKeysHandler final : public MediaControlKeysEventListener {
public:
NS_DECL_ISUPPORTS
NS_INLINE_DECL_REFCOUNTING(MediaControlKeysHandler, override)
void OnKeyPressed(MediaControlKeysEvent aKeyEvent) override;
private:
@ -60,14 +61,13 @@ class MediaControlKeysHandler final : public MediaControlKeysEventListener {
};
/**
* MediaControlKeysEventSource is a base class which is used to implement
* MediaControlKeysEventSource is an abstract class which is used to implement
* transporting media control keys event to all its listeners when media keys
* event happens.
*/
class MediaControlKeysEventSource : public nsISupports {
class MediaControlKeysEventSource {
public:
NS_DECL_ISUPPORTS
NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
MediaControlKeysEventSource() = default;
virtual void AddListener(MediaControlKeysEventListener* aListener);

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

@ -20,9 +20,6 @@
namespace mozilla {
namespace dom {
NS_IMPL_ISUPPORTS_INHERITED0(MediaControlKeysManager,
MediaControlKeysEventSource)
bool MediaControlKeysManager::IsOpened() const {
// As MediaControlKeysManager represents a platform-indenpendent event source,
// which we can use to add other listeners to moniter media key events, we

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

@ -22,7 +22,8 @@ namespace dom {
class MediaControlKeysManager final : public MediaControlKeysEventSource,
public MediaControlKeysEventListener {
public:
NS_DECL_ISUPPORTS_INHERITED
NS_INLINE_DECL_REFCOUNTING(MediaControlKeysManager, override)
MediaControlKeysManager() = default;
// MediaControlKeysEventSource methods

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

@ -173,5 +173,13 @@ MediaControlService::GetLastAddedController() {
return GetControllerById(mControllerHistory.LastElement()).forget();
}
void MediaControlService::GenerateMediaControlKeysTestEvent(
MediaControlKeysEvent aEvent) {
if (!StaticPrefs::media_mediacontrol_testingevents_enabled()) {
return;
}
mMediaKeysHandler->OnKeyPressed(aEvent);
}
} // namespace dom
} // namespace mozilla

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

@ -55,6 +55,9 @@ class MediaControlService final : public nsIObserver {
return mMediaControllerAmountChangedEvent;
}
// This is used for testing only, to generate fake media control keys events.
void GenerateMediaControlKeysTestEvent(MediaControlKeysEvent aEvent);
private:
MediaControlService();
~MediaControlService();

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

@ -7,9 +7,10 @@
#ifndef DOM_MEDIA_MEDIACONTROL_MEDIACONTROLUTILS_H_
#define DOM_MEDIA_MEDIACONTROL_MEDIACONTROLUTILS_H_
#include "mozilla/Logging.h"
#include "MediaController.h"
#include "MediaControlKeysEvent.h"
#include "mozilla/dom/ChromeUtilsBinding.h"
#include "mozilla/Logging.h"
extern mozilla::LazyLogModule gMediaControlLog;
@ -40,6 +41,30 @@ inline const char* ToMediaControlKeysEventStr(MediaControlKeysEvent aKeyEvent) {
}
}
inline MediaControlKeysEvent
ConvertMediaControlKeysTestEventToMediaControlKeysEvent(
MediaControlKeysTestEvent aEvent) {
switch (aEvent) {
case MediaControlKeysTestEvent::Play:
return MediaControlKeysEvent::ePlay;
case MediaControlKeysTestEvent::Pause:
return MediaControlKeysEvent::ePause;
case MediaControlKeysTestEvent::PlayPause:
return MediaControlKeysEvent::ePlayPause;
case MediaControlKeysTestEvent::PrevTrack:
return MediaControlKeysEvent::ePrevTrack;
case MediaControlKeysTestEvent::NextTrack:
return MediaControlKeysEvent::eNextTrack;
case MediaControlKeysTestEvent::SeekBackward:
return MediaControlKeysEvent::eSeekBackward;
case MediaControlKeysTestEvent::SeekForward:
return MediaControlKeysEvent::eSeekForward;
default:
MOZ_ASSERT(aEvent == MediaControlKeysTestEvent::Stop);
return MediaControlKeysEvent::eStop;
}
}
void NotifyMediaStarted(uint64_t aWindowID);
void NotifyMediaStopped(uint64_t aWindowID);
void NotifyMediaAudibleChanged(uint64_t aWindowID, bool aAudible);

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

@ -2,6 +2,8 @@
support-files =
file_autoplay.html
file_muted_autoplay.html
head.js
../../test/gizmo.mp4
[browser_audio_focus_management.js]
[browser_media_control_keys_event.js]

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

@ -148,10 +148,6 @@ async function switchAudioFocusManagerment(enable) {
set: [["media.audioFocus.management", enable]],
});
}
async function createTabAndLoad(url) {
let tab = await BrowserTestUtils.openNewForegroundTab(window.gBrowser, url);
return tab;
}
async function playMedia(tab) {
await SpecialPowers.spawn(tab.linkedBrowser, [], () => {
@ -173,50 +169,6 @@ async function playMedia(tab) {
});
}
async function checkOrWaitUntilMediaStartedPlaying(tab) {
await SpecialPowers.spawn(tab.linkedBrowser, [], () => {
return new Promise(resolve => {
const video = content.document.getElementById("autoplay");
if (!video) {
ok(false, `can't get the media element!`);
}
if (!video.paused) {
ok(true, `media started playing`);
resolve();
} else {
info(`wait until media starts playing`);
video.onplaying = () => {
video.onplaying = null;
ok(true, `media started playing`);
resolve();
};
}
});
});
}
async function checkOrWaitUntilMediaStoppedPlaying(tab) {
await SpecialPowers.spawn(tab.linkedBrowser, [], () => {
return new Promise(resolve => {
const video = content.document.getElementById("autoplay");
if (!video) {
ok(false, `can't get the media element!`);
}
if (video.paused) {
ok(true, `media stopped playing`);
resolve();
} else {
info(`wait until media stops playing`);
video.onpause = () => {
video.onpause = null;
ok(true, `media stopped playing`);
resolve();
};
}
});
});
}
async function clearTabsAndResetPref(tabs) {
info(`clear tabs and reset pref`);
for (let tab of tabs) {

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

@ -0,0 +1,52 @@
/* eslint-disable no-undef */
const PAGE_AUTOPLAY =
"https://example.com/browser/dom/media/mediacontrol/tests/file_autoplay.html";
/**
* This test is used to generate platform-independent media control keys event
* and see if media can be controlled correctly and current we only support
* `play`, `pause`, `playPause` and `stop` events.
*/
add_task(async function setupTestingPref() {
await SpecialPowers.pushPrefEnv({
set: [["media.mediacontrol.testingevents.enabled", true]],
});
});
add_task(async function testPlayPauseAndStop() {
info(`open autoplay media`);
const tab = await createTabAndLoad(PAGE_AUTOPLAY);
await checkOrWaitUntilMediaStartedPlaying(tab);
info(`pressing 'pause' key`);
ChromeUtils.generateMediaControlKeysTestEvent("pause");
await checkOrWaitUntilMediaStoppedPlaying(tab);
info(`pressing 'play' key`);
ChromeUtils.generateMediaControlKeysTestEvent("play");
await checkOrWaitUntilMediaStartedPlaying(tab);
info(`pressing 'stop' key`);
ChromeUtils.generateMediaControlKeysTestEvent("stop");
await checkOrWaitUntilMediaStoppedPlaying(tab);
info(`remove tab`);
await BrowserTestUtils.removeTab(tab);
});
add_task(async function testPlayPause() {
info(`open autoplay media`);
const tab = await createTabAndLoad(PAGE_AUTOPLAY);
await checkOrWaitUntilMediaStartedPlaying(tab);
info(`pressing 'playPause' key`);
ChromeUtils.generateMediaControlKeysTestEvent("playPause");
await checkOrWaitUntilMediaStoppedPlaying(tab);
info(`pressing 'playPause' key`);
ChromeUtils.generateMediaControlKeysTestEvent("playPause");
await checkOrWaitUntilMediaStartedPlaying(tab);
info(`remove tab`);
await BrowserTestUtils.removeTab(tab);
});

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

@ -8,8 +8,13 @@
using namespace mozilla::dom;
class MediaControlKeysEventSourceTestImpl : public MediaControlKeysEventSource {
public:
NS_INLINE_DECL_REFCOUNTING(MediaControlKeysEventSourceTestImpl, override)
bool Open() override { return true; }
bool IsOpened() const override { return true; }
private:
~MediaControlKeysEventSourceTestImpl() = default;
};
TEST(MediaControlKeysEvent, TestAddOrRemoveListener)

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

@ -19,7 +19,7 @@ static const int kSystemDefinedEventMediaKeysSubtype = 8;
class MediaHardwareKeysEventListenerTest : public MediaControlKeysEventListener {
public:
NS_DECL_ISUPPORTS
NS_INLINE_DECL_REFCOUNTING(MediaHardwareKeysEventListenerTest, override)
void OnKeyPressed(MediaControlKeysEvent aKeyEvent) override {
mReceivedEvent = mozilla::Some(aKeyEvent);
@ -37,8 +37,6 @@ class MediaHardwareKeysEventListenerTest : public MediaControlKeysEventListener
mozilla::Maybe<MediaControlKeysEvent> mReceivedEvent;
};
NS_IMPL_ISUPPORTS0(MediaHardwareKeysEventListenerTest)
static void SendFakeEvent(RefPtr<MediaHardwareKeysEventSourceMac>& aSource, int aKeyData) {
NSEvent* event = [NSEvent otherEventWithType:NSSystemDefined
location:NSZeroPoint

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

@ -0,0 +1,50 @@
/* eslint-disable no-undef */
async function createTabAndLoad(url) {
let tab = await BrowserTestUtils.openNewForegroundTab(window.gBrowser, url);
return tab;
}
async function checkOrWaitUntilMediaStartedPlaying(tab) {
await SpecialPowers.spawn(tab.linkedBrowser, [], () => {
return new Promise(resolve => {
const video = content.document.getElementById("autoplay");
if (!video) {
ok(false, `can't get the media element!`);
}
if (!video.paused) {
ok(true, `media started playing`);
resolve();
} else {
info(`wait until media starts playing`);
video.onplaying = () => {
video.onplaying = null;
ok(true, `media started playing`);
resolve();
};
}
});
});
}
async function checkOrWaitUntilMediaStoppedPlaying(tab) {
await SpecialPowers.spawn(tab.linkedBrowser, [], () => {
return new Promise(resolve => {
const video = content.document.getElementById("autoplay");
if (!video) {
ok(false, `can't get the media element!`);
}
if (video.paused) {
ok(true, `media stopped playing`);
resolve();
} else {
info(`wait until media stops playing`);
video.onpause = () => {
video.onpause = null;
ok(true, `media stopped playing`);
resolve();
};
}
});
});
}

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

@ -15,7 +15,18 @@
<script class="testbody" type="text/javascript">
/* import-globals-from ../../canvas/test/captureStream_common.js */
function startTest() {
(async function() {
try {
SimpleTest.waitForExplicitFinish();
await startTest();
} catch(e) {
ok(false, `Got error msg '${e}'`);
} finally {
SimpleTest.finish();
}
})();
async function startTest() {
let canvas = document.getElementById("video-src-canvas");
let canvas_size = 100;
@ -24,77 +35,52 @@ function startTest() {
helper.drawColor(canvas, helper.red);
let stream = canvas.captureStream();
let numVideoSeekedEvents = 0;
let blob;
let mediaRecorder = new MediaRecorder(stream);
is(mediaRecorder.stream, stream,
"Media recorder stream = canvas stream at the beginning of recording");
// Not expected events.
mediaRecorder.onwarning = () => ok(false, "MediaRecorder: onwarning unexpectedly fired");
mediaRecorder.onerror = err => {
ok(false, "MediaRecorder: onerror unexpectedly fired. Code " + err.name);
SimpleTest.finish();
};
// When recorder is stopped get recorded data.
mediaRecorder.ondataavailable = ev => {
info("Got 'dataavailable' event");
is(blob, undefined, "On dataavailable event blob is undefined");
blob = ev.data;
};
mediaRecorder.onstart = () => {
info('onstart fired successfully');
// Feed some more data into the recorder so the output has a non trivial duration.
// This avoids the case where we have only 1 frame in the output, which breaks
// looping (this is expected as a WebM with 1 video frame has no duration).
let counter = 0;
let draw = () => {
counter++;
helper.drawColor(canvas, helper.blue);
if(counter > 2) {
mediaRecorder.stop();
return;
}
requestAnimationFrame(draw);
};
requestAnimationFrame(draw);
};
mediaRecorder.onstop = () => {
info("Got 'stop' event");
ok(blob, "Should have gotten a data blob");
let video = document.getElementById("recorded-video");
video.src = URL.createObjectURL(blob);
video.onerror = err => {
ok(false, "Should be able to play the recording. Got error. code=" + video.error.code);
SimpleTest.finish();
};
video.onseeked = () => {
// We get a seeked event when the video has restarted.
info("Got 'onseeked' event");
if(++numVideoSeekedEvents == 2) {
// We've looped the video
video.pause();
SimpleTest.finish();
}
};
video.play();
};
new Promise(r => mediaRecorder.onerror = err => r(err)).then(
err => Promise.reject(`MediaRecorder: error unexpectedly fired. Code ${err.name}`));
mediaRecorder.start();
}
await new Promise(r => mediaRecorder.onstart = r);
info("Media recorder started");
// Feed some more data into the recorder so the output has a non trivial duration.
// This avoids the case where we have only 1 frame in the output, which breaks
// looping (this is expected as a WebM with 1 video frame has no duration).
let counter = 0;
let draw = () => {
counter++;
helper.drawColor(canvas, helper.blue);
if(counter > 2) {
mediaRecorder.stop();
return;
}
requestAnimationFrame(draw);
};
requestAnimationFrame(draw);
SimpleTest.waitForExplicitFinish();
startTest();
// When recorder is stopped get recorded data.
const data = await new Promise(r => mediaRecorder.ondataavailable = ev => r(ev));
info(`Media recorder get availiable data`);
const blob = data.data;
await new Promise(r => mediaRecorder.onstop = r);
info("Media recorder stopped");
ok(blob, "Should have gotten a data blob");
const video = document.getElementById("recorded-video");
new Promise(r => video.onerror = err => r(err)).then(
err => Promise.reject(`Video: error unexpectedly fired. Code ${err.code}`));
video.src = URL.createObjectURL(blob);
video.play();
await new Promise(r => video.onplaying = r);
for (let idx = 0; idx < 2; idx++) {
await new Promise(r => video.onseeking = r);
ok(true, `waiting until video finishes seeking`);
await new Promise(r => video.onseeked = r);
ok(true, "video finished seeked");
}
video.pause();
}
</script>
</pre>

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

@ -64,14 +64,14 @@
]
);
// Second negotiation should cause the first track to mute...
// The first track should mute when the connection is closed.
test.chain.insertBefore("PC_REMOTE_SET_REMOTE_DESCRIPTION", [
function PC_REMOTE_SETUP_ONMUTE(test) {
haveMuteEvent = haveEvent(test.pcRemote._pc.getReceivers()[0].track, "mute");
}
], false, 1);
]);
// ...and a second track to unmute.
// Second negotiation should cause the second track to unmute.
test.chain.insertAfter("PC_REMOTE_SET_REMOTE_DESCRIPTION", [
function PC_REMOTE_SETUP_ONUNMUTE(test) {
haveUnmuteEvent = haveEvent(test.pcRemote._pc.getReceivers()[1].track, "unmute");

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

@ -74,14 +74,14 @@
]
);
// Second negotiation should cause the first track to mute...
// The first track should mute when the connection is closed.
test.chain.insertBefore("PC_REMOTE_SET_REMOTE_DESCRIPTION", [
function PC_REMOTE_SETUP_ONMUTE(test) {
haveMuteEvent = haveEvent(test.pcRemote._pc.getReceivers()[0].track, "mute");
}
], false, 1);
]);
// ...and a second track to unmute.
// Second negotiation should cause the second track to unmute.
test.chain.insertAfter("PC_REMOTE_SET_REMOTE_DESCRIPTION", [
function PC_REMOTE_SETUP_ONUNMUTE(test) {
haveUnmuteEvent = haveEvent(test.pcRemote._pc.getReceivers()[1].track, "unmute");

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

@ -315,7 +315,9 @@ var pedanticChecks = report => {
// Check that report is only-maplike
[...report.keys()].forEach(key => is(report[key], undefined,
`Report is not dictionary like, it lacks a property for key ${key}`));
report.forEach((statObj, mapKey) => {
info(`"${mapKey} = ${JSON.stringify(statObj, null, 2)}`);
});
// eslint-disable-next-line complexity
report.forEach((statObj, mapKey) => {
let tested = {};
@ -373,7 +375,8 @@ var pedanticChecks = report => {
if (isRemote) {
// local id
if (stat.localId) {
ok(report.has(stat.localId), "localId exists in report.");
ok(report.has(stat.localId),
`localId ${stat.localId} exists in report.`);
is(report.get(stat.localId).ssrc, stat.ssrc,
"remote ssrc and local ssrc match.");
is(report.get(stat.localId).remoteId, stat.id,
@ -382,7 +385,8 @@ var pedanticChecks = report => {
} else {
// remote id
if (stat.remoteId) {
ok(report.has(stat.remoteId), "remoteId exists in report.");
ok(report.has(stat.remoteId),
`remoteId ${stat.remoteId} exists in report.`);
is(report.get(stat.remoteId).ssrc, stat.ssrc,
"remote ssrc and local ssrc match.");
is(report.get(stat.remoteId).localId, stat.id,

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

@ -257,7 +257,7 @@ bool ServiceWorkersAreCrossProcess() {
return ServiceWorkerParentInterceptEnabled() && XRE_IsE10sParentProcess();
}
const char* GetXPCOMShutdownTopic() {
const char* GetStartShutdownTopic() {
if (ServiceWorkersAreCrossProcess()) {
return "profile-change-teardown";
}
@ -265,6 +265,8 @@ const char* GetXPCOMShutdownTopic() {
return NS_XPCOM_SHUTDOWN_OBSERVER_ID;
}
constexpr char kFinishShutdownTopic[] = "profile-before-change-qm";
already_AddRefed<nsIAsyncShutdownClient> GetAsyncShutdownBarrier() {
AssertIsOnMainThread();
@ -347,7 +349,7 @@ void ServiceWorkerManager::Init(ServiceWorkerRegistrar* aRegistrar) {
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (obs) {
DebugOnly<nsresult> rv;
rv = obs->AddObserver(this, GetXPCOMShutdownTopic(), false /* ownsWeak */);
rv = obs->AddObserver(this, GetStartShutdownTopic(), false /* ownsWeak */);
MOZ_ASSERT(NS_SUCCEEDED(rv));
}
@ -498,7 +500,9 @@ void ServiceWorkerManager::MaybeStartShutdown() {
for (auto& registrationEntry : dataPtr->mInfos) {
registrationEntry.GetData()->ShutdownWorkers();
}
dataPtr->mInfos.Clear();
// ServiceWorkerCleanup may try to unregister registrations, so don't clear
// mInfos.
}
for (auto& entry : mControlledClients) {
@ -515,7 +519,21 @@ void ServiceWorkerManager::MaybeStartShutdown() {
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (obs) {
obs->RemoveObserver(this, GetXPCOMShutdownTopic());
obs->RemoveObserver(this, GetStartShutdownTopic());
if (ServiceWorkersAreCrossProcess()) {
obs->AddObserver(this, kFinishShutdownTopic, false);
return;
}
}
MaybeFinishShutdown();
}
void ServiceWorkerManager::MaybeFinishShutdown() {
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (obs) {
obs->RemoveObserver(this, kFinishShutdownTopic);
}
if (!mActor) {
@ -2824,11 +2842,16 @@ ServiceWorkerManager::RemoveListener(
NS_IMETHODIMP
ServiceWorkerManager::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) {
if (strcmp(aTopic, GetXPCOMShutdownTopic()) == 0) {
if (strcmp(aTopic, GetStartShutdownTopic()) == 0) {
MaybeStartShutdown();
return NS_OK;
}
if (strcmp(aTopic, kFinishShutdownTopic) == 0) {
MaybeFinishShutdown();
return NS_OK;
}
MOZ_CRASH("Received message we aren't supposed to be registered for!");
return NS_OK;
}

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

@ -305,6 +305,8 @@ class ServiceWorkerManager final : public nsIServiceWorkerManager,
void MaybeStartShutdown();
void MaybeFinishShutdown();
already_AddRefed<ServiceWorkerJobQueue> GetOrCreateJobQueue(
const nsACString& aOriginSuffix, const nsACString& aScope);

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

@ -11,6 +11,7 @@ callback PromiseReturner = Promise<any>();
[Pref="dom.expose_test_interfaces",
Exposed=Window]
interface WrapperCachedNonISupportsTestInterface {
[Pref="dom.webidl.test1"] constructor();
};
// The type of string C++ sees.

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

@ -18,8 +18,6 @@ interface XULElement : Element {
attribute DOMString ordinal;
[SetterThrows]
attribute DOMString orient;
[SetterThrows]
attribute DOMString pack;
// Properties for hiding elements.
attribute boolean hidden;

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

@ -399,10 +399,6 @@ class nsXULElement : public nsStyledElement {
void SetOrient(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::orient, aValue, rv);
}
void GetPack(DOMString& aValue) const { GetXULAttr(nsGkAtoms::pack, aValue); }
void SetPack(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::pack, aValue, rv);
}
bool Hidden() const { return BoolAttrIsTrue(nsGkAtoms::hidden); }
void SetHidden(bool aHidden) { SetXULBoolAttr(nsGkAtoms::hidden, aHidden); }
bool Collapsed() const { return BoolAttrIsTrue(nsGkAtoms::collapsed); }

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

@ -27,6 +27,9 @@
#include "nsStyleConsts.h"
#include "mozilla/AppUnits.h"
#include "mozilla/FloatingPoint.h"
#ifdef MOZ_WASM_SANDBOXING_GRAPHITE
# include "mozilla/ipc/LibrarySandboxPreload.h"
#endif
#include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Preferences.h"
@ -610,7 +613,11 @@ struct gfxFontEntry::GrSandboxData {
GrSandboxData() {
#ifdef MOZ_WASM_SANDBOXING_GRAPHITE
# error "Sandboxed graphite not yet implemented"
// Firefox preloads the library externally to ensure we won't be stopped by
// the content sandbox
const bool external_loads_exist = true;
sandbox.create_sandbox(mozilla::ipc::GetSandboxedGraphitePath().get(),
external_loads_exist);
#else
sandbox.create_sandbox();
#endif

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

@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#include "LibrarySandboxPreload.h"
#include "BinaryPath.h"
#include "prlink.h"
namespace mozilla {
namespace ipc {
nsAutoCString GetSandboxedGraphitePath() {
nsCOMPtr<nsIFile> binaryPath;
nsresult rv = mozilla::BinaryPath::GetFile(getter_AddRefs(binaryPath));
if (NS_FAILED(rv)) {
MOZ_CRASH("Library preload failure: Failed to get binary file\n");
}
nsCOMPtr<nsIFile> graphiteFile;
rv = binaryPath->GetParent(getter_AddRefs(graphiteFile));
if (NS_FAILED(rv)) {
MOZ_CRASH("Library preload failure: Failed to get binary folder\n");
}
rv = graphiteFile->AppendNative(NS_LITERAL_CSTRING("libgraphitewasm.so"));
if (NS_FAILED(rv)) {
MOZ_CRASH("Library preload failure: Failed to get libgraphite file");
}
nsAutoString path;
rv = graphiteFile->GetPath(path);
if (NS_FAILED(rv)) {
MOZ_CRASH("Library preload failure: Failed to get libgraphite path\n");
}
nsAutoCString converted_path = NS_ConvertUTF16toUTF8(path);
return converted_path;
}
void PreloadSandboxedDynamicLibraries() {
#ifdef MOZ_WASM_SANDBOXING_GRAPHITE
nsAutoCString path = GetSandboxedGraphitePath();
PRLibSpec libSpec;
libSpec.type = PR_LibSpec_Pathname;
libSpec.value.pathname = path.get();
PRLibrary* ret = PR_LoadLibraryWithFlags(libSpec, PR_LD_LAZY);
if (!ret) {
MOZ_CRASH("Library preload failure: Failed to load libgraphite\n");
}
#endif
}
} // namespace ipc
} // namespace mozilla

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

@ -0,0 +1,17 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=4 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef ipc_glue_LibrarySandboxPreload_h
#define ipc_glue_LibrarySandboxPreload_h
namespace mozilla {
namespace ipc {
nsAutoCString GetSandboxedGraphitePath();
void PreloadSandboxedDynamicLibraries();
} // namespace ipc
} // namespace mozilla
#endif

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

@ -38,6 +38,7 @@ EXPORTS.mozilla.ipc += [
'IPCStreamSource.h',
'IPCStreamUtils.h',
'IPDLParamTraits.h',
'LibrarySandboxPreload.h',
'MessageChannel.h',
'MessageLink.h',
'Neutering.h',
@ -162,6 +163,7 @@ UNIFIED_SOURCES += [
'IPCStreamParent.cpp',
'IPCStreamSource.cpp',
'IPCStreamUtils.cpp',
'LibrarySandboxPreload.cpp',
'MessageChannel.cpp',
'MessageLink.cpp',
'MessagePump.cpp',

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

@ -1534,6 +1534,9 @@ void MacroAssemblerMIPS64Compat::tagValue(JSValueType type, Register payload,
ma_li(ScratchRegister, ImmTag(JSVAL_TYPE_TO_TAG(type)));
ma_dins(dest.valueReg(), ScratchRegister, Imm32(JSVAL_TAG_SHIFT),
Imm32(64 - JSVAL_TAG_SHIFT));
if (type == JSVAL_TYPE_INT32 || type == JSVAL_TYPE_BOOLEAN) {
ma_dins(dest.valueReg(), zero, Imm32(32), Imm32(JSVAL_TAG_SHIFT - 32));
}
}
void MacroAssemblerMIPS64Compat::pushValue(ValueOperand val) {

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

@ -31,7 +31,8 @@ enum InstrumentationHolderSlots {
static RealmInstrumentation* GetInstrumentation(JSObject* obj) {
Value v = JS_GetReservedSlot(obj, RealmInstrumentationSlot);
return static_cast<RealmInstrumentation*>(v.toPrivate());
return static_cast<RealmInstrumentation*>(v.isUndefined() ? nullptr
: v.toPrivate());
}
/* static */
@ -43,7 +44,9 @@ void RealmInstrumentation::holderFinalize(JSFreeOp* fop, JSObject* obj) {
/* static */
void RealmInstrumentation::holderTrace(JSTracer* trc, JSObject* obj) {
RealmInstrumentation* instrumentation = GetInstrumentation(obj);
instrumentation->trace(trc);
if (instrumentation) {
instrumentation->trace(trc);
}
}
static const JSClassOps InstrumentationHolderClassOps = {
@ -168,6 +171,7 @@ bool RealmInstrumentation::setActive(JSContext* cx,
}
RealmInstrumentation* instrumentation = GetInstrumentation(holder);
MOZ_ASSERT(instrumentation);
if (active != instrumentation->active) {
instrumentation->active = active;
@ -188,6 +192,7 @@ bool RealmInstrumentation::isActive(GlobalObject* global) {
MOZ_ASSERT(holder);
RealmInstrumentation* instrumentation = GetInstrumentation(holder);
MOZ_ASSERT(instrumentation);
return instrumentation->active;
}
@ -197,6 +202,7 @@ const int32_t* RealmInstrumentation::addressOfActive(GlobalObject* global) {
MOZ_ASSERT(holder);
RealmInstrumentation* instrumentation = GetInstrumentation(holder);
MOZ_ASSERT(instrumentation);
return &instrumentation->active;
}
@ -206,6 +212,7 @@ JSObject* RealmInstrumentation::getCallback(GlobalObject* global) {
MOZ_ASSERT(holder);
RealmInstrumentation* instrumentation = GetInstrumentation(holder);
MOZ_ASSERT(instrumentation);
return instrumentation->callback;
}
@ -217,6 +224,7 @@ uint32_t RealmInstrumentation::getInstrumentationKinds(GlobalObject* global) {
}
RealmInstrumentation* instrumentation = GetInstrumentation(holder);
MOZ_ASSERT(instrumentation);
return instrumentation->kinds;
}
@ -227,6 +235,7 @@ bool RealmInstrumentation::getScriptId(JSContext* cx,
MOZ_ASSERT(global == cx->global());
RootedObject holder(cx, global->getInstrumentationHolder());
RealmInstrumentation* instrumentation = GetInstrumentation(holder);
MOZ_ASSERT(instrumentation);
RootedObject dbgObject(cx, UncheckedUnwrap(instrumentation->dbgObject));

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

@ -8,6 +8,7 @@
#include "mozilla/Services.h"
#include "mozilla/dom/Document.h"
#include "nsCOMPtr.h"
#include "nsGlobalWindowInner.h"
#include "nsIDOMEventListener.h"
#include "nsIFrame.h"
#include "nsIObserverService.h"

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

@ -12,6 +12,7 @@
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/MouseEventBinding.h"
#include "nsHTMLParts.h"
#include "nsLayoutUtils.h"
#include "nsGkAtoms.h"
#include "nsFontMetrics.h"

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

@ -184,23 +184,30 @@ void StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame,
// Containing block limits for the position of aFrame relative to its parent.
// The margin box of the sticky element stays within the content box of the
// contaning-block element.
if (cbFrame != scrolledFrame) {
if (cbFrame == scrolledFrame) {
// cbFrame is the scrolledFrame, and it won't have continuations. Unlike the
// else clause, we consider scrollable overflow rect because and the union
// of its in-flow rects doesn't include the scrollable overflow area.
*aContain = cbFrame->GetScrollableOverflowRectRelativeToSelf();
nsLayoutUtils::TransformRect(cbFrame, aFrame->GetParent(), *aContain);
} else {
*aContain = nsLayoutUtils::GetAllInFlowRectsUnion(
cbFrame, aFrame->GetParent(), nsLayoutUtils::RECTS_USE_CONTENT_BOX);
nsRect marginRect = nsLayoutUtils::GetAllInFlowRectsUnion(
aFrame, aFrame->GetParent(), nsLayoutUtils::RECTS_USE_MARGIN_BOX);
// Deflate aContain by the difference between the union of aFrame's
// continuations' margin boxes and the union of their border boxes, so that
// by keeping aFrame within aContain, we keep the union of the margin boxes
// within the containing block's content box.
aContain->Deflate(marginRect - rect);
// Deflate aContain by the border-box size, to form a constraint on the
// upper-left corner of aFrame and continuations.
aContain->Deflate(nsMargin(0, rect.width, rect.height, 0));
}
nsRect marginRect = nsLayoutUtils::GetAllInFlowRectsUnion(
aFrame, aFrame->GetParent(), nsLayoutUtils::RECTS_USE_MARGIN_BOX);
// Deflate aContain by the difference between the union of aFrame's
// continuations' margin boxes and the union of their border boxes, so that
// by keeping aFrame within aContain, we keep the union of the margin boxes
// within the containing block's content box.
aContain->Deflate(marginRect - rect);
// Deflate aContain by the border-box size, to form a constraint on the
// upper-left corner of aFrame and continuations.
aContain->Deflate(nsMargin(0, rect.width, rect.height, 0));
nsMargin sfPadding = scrolledFrame->GetUsedPadding();
nsPoint sfOffset = aFrame->GetParent()->GetOffsetTo(scrolledFrame);

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

@ -28,6 +28,7 @@
#include "nsINode.h"
#include "nsIScrollbarMediator.h"
#include "nsITextControlFrame.h"
#include "nsILayoutHistoryState.h"
#include "nsNodeInfoManager.h"
#include "nsContentCreatorFunctions.h"
#include "mozilla/PresState.h"
@ -73,6 +74,7 @@
#include "nsPluginFrame.h"
#include "nsSliderFrame.h"
#include "ViewportFrame.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/layers/APZCCallbackHelper.h"
#include "mozilla/layers/AxisPhysicsModel.h"
#include "mozilla/layers/AxisPhysicsMSDModel.h"

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

@ -13,15 +13,6 @@
# of this, an item could have zero <failure-type>, which indicates it
# is expected to pass, and override failure rule above it.
#### Selectors 4 ####################################################
# focus-within
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) selectors/focus-within-0??.html
# Rely on Element.attachShadow which is not implemented yet
skip selectors/focus-within-shadow-*.html
#### CSS Values 3 ####################################################
# Fuzzy
@ -191,19 +182,6 @@ skip css-writing-modes/bidi-table-001.html
skip css-writing-modes/block-plaintext-006.html
skip css-writing-modes/table-cell-001.html
skip css-writing-modes/table-cell-002.html
skip selectors/any-link-dynamic-001.html
skip selectors/root-siblings.htm
skip selectors/scope-without-scoping.html
skip selectors/selector-placeholder-shown-type-change-001.html
skip selectors/selector-placeholder-shown-type-change-002.html
skip selectors/selector-placeholder-shown-type-change-003.html
skip selectors/selector-read-write-type-change-001.html
skip selectors/selector-read-write-type-change-002.html
skip selectors/selector-required-type-change-001.html
skip selectors/selector-required-type-change-002.html
skip selectors/selectors-attr-white-space-001.html
skip selectors/selectors-empty-001.xml
skip selectors/selectors-namespace-001.xml
# Bug 1392106
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/margin-v??-00?.xht
@ -218,4 +196,3 @@ random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/text-comb
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/text-orientation-mixed-???-???.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/text-orientation-sideways-v??-1??.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) css-writing-modes/text-orientation-upright-srl-018.xht
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) selectors/selectors-dir-selector-???-001.html

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

@ -33,7 +33,6 @@ gSubtrees = [
os.path.join("css-conditional"),
os.path.join("css-values"),
os.path.join("css-writing-modes"),
os.path.join("selectors"),
]
# Insert the properties which you want to add "-moz" prefix to

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

@ -1,22 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<style type="text/css"><![CDATA[
p {color: green;}
]]></style>
</head>
<body>
<p>This text should be green.</p>
</body>
</html>

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

@ -1537,91 +1537,3 @@ Importing css-writing-modes/writing-mode-vertical-rl-002.xht to css-writing-mode
Importing css-writing-modes/reftest/writing-mode-vertical-rl-002-ref.xht to css-writing-modes/reftest/writing-mode-vertical-rl-002-ref.xht
Importing css-writing-modes/writing-mode-vertical-rl-003.htm to css-writing-modes/writing-mode-vertical-rl-003.htm
Importing css-writing-modes/writing-mode-vertical-rl-003-ref.htm to css-writing-modes/writing-mode-vertical-rl-003-ref.htm
Importing selectors/CHANGES to selectors/CHANGES
Importing selectors/Makefile to selectors/Makefile
Importing selectors/OWNERS to selectors/OWNERS
Importing selectors/TODO to selectors/TODO
Importing selectors/any-link-dynamic-001.html to selectors/any-link-dynamic-001.html
Importing selectors/any-link-dynamic-001-ref.html to selectors/any-link-dynamic-001-ref.html
Importing selectors/css3-modsel-12.xml-removed to selectors/css3-modsel-12.xml-removed
Importing selectors/css3-modsel-162.xml-removed to selectors/css3-modsel-162.xml-removed
Importing selectors/css3-modsel-163.xml-disabled-contains-removed to selectors/css3-modsel-163.xml-disabled-contains-removed
Importing selectors/css3-modsel-164.xml-removed to selectors/css3-modsel-164.xml-removed
Importing selectors/css3-modsel-165.xml-removed to selectors/css3-modsel-165.xml-removed
Importing selectors/css3-modsel-180.xml-disabled-because-we-want-to-allow-for-expansion to selectors/css3-modsel-180.xml-disabled-because-we-want-to-allow-for-expansion
Importing selectors/css3-modsel-19a.xml-removed to selectors/css3-modsel-19a.xml-removed
Importing selectors/css3-modsel-28c.pl-draft to selectors/css3-modsel-28c.pl-draft
Importing selectors/css3-modsel-40.xml-removed to selectors/css3-modsel-40.xml-removed
Importing selectors/css3-modsel-58.xml-removed to selectors/css3-modsel-58.xml-removed
Importing selectors/css3-modsel-7c.xml-disabled-due-to-limitations-in-the-build-system to selectors/css3-modsel-7c.xml-disabled-due-to-limitations-in-the-build-system
Importing selectors/css3-modsel-7d.xml-disabled-due-to-limitations-in-the-build-system to selectors/css3-modsel-7d.xml-disabled-due-to-limitations-in-the-build-system
Importing selectors/css3-modsel-84.xml-disabled-contains-removed to selectors/css3-modsel-84.xml-disabled-contains-removed
Importing selectors/css3-modsel-84b.xml-disabled-contains-removed to selectors/css3-modsel-84b.xml-disabled-contains-removed
Importing selectors/css3-modsel-85.xml-disabled-contains-removed to selectors/css3-modsel-85.xml-disabled-contains-removed
Importing selectors/css3-modsel-d5.xml-removed to selectors/css3-modsel-d5.xml-removed
Importing selectors/css3-modsel-d5a.xml-removed to selectors/css3-modsel-d5a.xml-removed
Importing selectors/css3-modsel-d5b.xml-removed to selectors/css3-modsel-d5b.xml-removed
Importing selectors/css3-modsel-d5c.xml-removed to selectors/css3-modsel-d5c.xml-removed
Importing selectors/css3-modsel-d5d.xml-removed to selectors/css3-modsel-d5d.xml-removed
Importing selectors/css3-modsel-d5e.xml-removed to selectors/css3-modsel-d5e.xml-removed
Importing selectors/focus-within-001.html to selectors/focus-within-001.html
Importing selectors/focus-within-001-ref.html to selectors/focus-within-001-ref.html
Importing selectors/focus-within-002.html to selectors/focus-within-002.html
Importing selectors/focus-within-003.html to selectors/focus-within-003.html
Importing selectors/focus-within-004.html to selectors/focus-within-004.html
Importing selectors/focus-within-005.html to selectors/focus-within-005.html
Importing selectors/focus-within-006.html to selectors/focus-within-006.html
Importing selectors/focus-within-006-ref.html to selectors/focus-within-006-ref.html
Importing selectors/focus-within-007.html to selectors/focus-within-007.html
Importing selectors/focus-within-007-ref.html to selectors/focus-within-007-ref.html
Importing selectors/focus-within-008.html to selectors/focus-within-008.html
Importing selectors/focus-within-010.html to selectors/focus-within-010.html
Importing selectors/focus-within-shadow-001-ref.html to selectors/focus-within-shadow-001-ref.html
Importing selectors/focus-within-shadow-001.html to selectors/focus-within-shadow-001.html
Importing selectors/focus-within-shadow-002.html to selectors/focus-within-shadow-002.html
Importing selectors/focus-within-shadow-003.html to selectors/focus-within-shadow-003.html
Importing selectors/focus-within-shadow-004.html to selectors/focus-within-shadow-004.html
Importing selectors/focus-within-shadow-005.html to selectors/focus-within-shadow-005.html
Importing selectors/focus-within-shadow-006.html to selectors/focus-within-shadow-006.html
Importing selectors/generate.pl to selectors/generate.pl
Importing selectors/htaccess to selectors/htaccess
Importing selectors/html-full.css to selectors/html-full.css
Importing selectors/html-shell.css to selectors/html-shell.css
Importing selectors/i18n/OWNERS to selectors/i18n/OWNERS
Importing selectors/of-type-selectors.xhtml to selectors/of-type-selectors.xhtml
Importing selectors/of-type-selectors-ref.xhtml to selectors/of-type-selectors-ref.xhtml
Importing selectors/root-siblings.htm to selectors/root-siblings.htm
Importing CSS2/reference/ref-this-text-should-be-green.xht to CSS2/reference/ref-this-text-should-be-green.xht
Importing selectors/scope-without-scoping.html to selectors/scope-without-scoping.html
Importing selectors/selector-placeholder-shown-type-change-001.html to selectors/selector-placeholder-shown-type-change-001.html
Importing selectors/selector-placeholder-shown-type-change-001-ref.html to selectors/selector-placeholder-shown-type-change-001-ref.html
Importing selectors/selector-placeholder-shown-type-change-002.html to selectors/selector-placeholder-shown-type-change-002.html
Importing selectors/selector-placeholder-shown-type-change-002-ref.html to selectors/selector-placeholder-shown-type-change-002-ref.html
Importing selectors/selector-placeholder-shown-type-change-003.html to selectors/selector-placeholder-shown-type-change-003.html
Importing selectors/selector-placeholder-shown-type-change-003-ref.html to selectors/selector-placeholder-shown-type-change-003-ref.html
Importing selectors/selector-read-write-type-change-001.html to selectors/selector-read-write-type-change-001.html
Importing selectors/selector-read-write-type-change-001-ref.html to selectors/selector-read-write-type-change-001-ref.html
Importing selectors/selector-read-write-type-change-002.html to selectors/selector-read-write-type-change-002.html
Importing selectors/selector-read-write-type-change-002-ref.html to selectors/selector-read-write-type-change-002-ref.html
Importing selectors/selector-required-type-change-001.html to selectors/selector-required-type-change-001.html
Importing selectors/selector-required-type-change-001-ref.html to selectors/selector-required-type-change-001-ref.html
Importing selectors/selector-required-type-change-002.html to selectors/selector-required-type-change-002.html
Importing selectors/selector-required-type-change-002-ref.html to selectors/selector-required-type-change-002-ref.html
Importing selectors/selector-required.html to selectors/selector-required.html
Importing selectors/selector-required-ref.html to selectors/selector-required-ref.html
Importing selectors/selectors-attr-white-space-001.html to selectors/selectors-attr-white-space-001.html
Importing selectors/selectors-attr-white-space-001-ref.html to selectors/selectors-attr-white-space-001-ref.html
Importing selectors/selectors-dir-selector-ltr-001.html to selectors/selectors-dir-selector-ltr-001.html
Importing selectors/selectors-dir-selector-rtl-001.html to selectors/selectors-dir-selector-rtl-001.html
Importing selectors/selectors-empty-001.xml to selectors/selectors-empty-001.xml
Importing selectors/selectors-empty-001-ref.xml to selectors/selectors-empty-001-ref.xml
Importing selectors/selectors-namespace-001.xml to selectors/selectors-namespace-001.xml
Importing selectors/selectors-namespace-001-ref.xml to selectors/selectors-namespace-001-ref.xml
Importing selectors/tng.css to selectors/tng.css
Importing selectors/utils/generators.pm to selectors/utils/generators.pm
Importing selectors/utils/helpers.pm to selectors/utils/helpers.pm
Importing selectors/utils/parser.pm to selectors/utils/parser.pm
Importing selectors/xhtml-full.css to selectors/xhtml-full.css
Importing selectors/xhtml-shell.css to selectors/xhtml-shell.css
Importing selectors/xml-full.css to selectors/xml-full.css
Importing selectors/xml-shell.css to selectors/xml-shell.css

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

@ -1010,35 +1010,3 @@ fuzzy-if(winWidget,0-158,0-624) fuzzy-if(!webrender&&OSX,255-255,480-520) random
fuzzy-if(winWidget,0-158,0-624) fuzzy-if(!webrender&&OSX,255-255,480-520) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/writing-mode-vertical-rl-001.xht css-writing-modes/reftest/writing-mode-vertical-rl-001-ref.xht
fuzzy-if(winWidget,0-158,0-624) fuzzy-if(!webrender&&OSX,255-255,480-520) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/writing-mode-vertical-rl-002.xht css-writing-modes/reftest/writing-mode-vertical-rl-002-ref.xht
fuzzy-if(winWidget,0-158,0-624) fuzzy-if(!webrender&&OSX,255-255,480-520) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == css-writing-modes/writing-mode-vertical-rl-003.htm css-writing-modes/writing-mode-vertical-rl-003-ref.htm
skip == selectors/any-link-dynamic-001.html selectors/any-link-dynamic-001-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-001.html selectors/focus-within-001-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-002.html selectors/focus-within-001-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-003.html selectors/focus-within-001-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-004.html selectors/focus-within-001-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-005.html selectors/focus-within-001-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-006.html selectors/focus-within-006-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-007.html selectors/focus-within-007-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-008.html selectors/focus-within-007-ref.html
needs-focus random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/focus-within-010.html selectors/focus-within-shadow-001-ref.html
skip == selectors/focus-within-shadow-001.html selectors/focus-within-shadow-001-ref.html
skip == selectors/focus-within-shadow-002.html selectors/focus-within-shadow-001-ref.html
skip == selectors/focus-within-shadow-003.html selectors/focus-within-shadow-001-ref.html
skip == selectors/focus-within-shadow-004.html selectors/focus-within-shadow-001-ref.html
skip == selectors/focus-within-shadow-005.html selectors/focus-within-shadow-001-ref.html
skip == selectors/focus-within-shadow-006.html selectors/focus-within-shadow-001-ref.html
== selectors/of-type-selectors.xhtml selectors/of-type-selectors-ref.xhtml
skip == selectors/root-siblings.htm CSS2/reference/ref-this-text-should-be-green.xht
skip == selectors/scope-without-scoping.html reference/ref-filled-green-100px-square.xht
skip == selectors/selector-placeholder-shown-type-change-001.html selectors/selector-placeholder-shown-type-change-001-ref.html
skip == selectors/selector-placeholder-shown-type-change-002.html selectors/selector-placeholder-shown-type-change-002-ref.html
skip == selectors/selector-placeholder-shown-type-change-003.html selectors/selector-placeholder-shown-type-change-003-ref.html
skip == selectors/selector-read-write-type-change-001.html selectors/selector-read-write-type-change-001-ref.html
skip == selectors/selector-read-write-type-change-002.html selectors/selector-read-write-type-change-002-ref.html
skip == selectors/selector-required-type-change-001.html selectors/selector-required-type-change-001-ref.html
skip == selectors/selector-required-type-change-002.html selectors/selector-required-type-change-002-ref.html
== selectors/selector-required.html selectors/selector-required-ref.html
skip == selectors/selectors-attr-white-space-001.html selectors/selectors-attr-white-space-001-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/selectors-dir-selector-ltr-001.html reference/ref-filled-green-100px-square.xht
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == selectors/selectors-dir-selector-rtl-001.html reference/ref-filled-green-100px-square.xht
skip == selectors/selectors-empty-001.xml selectors/selectors-empty-001-ref.xml
skip == selectors/selectors-namespace-001.xml selectors/selectors-namespace-001-ref.xml

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

@ -1,241 +0,0 @@
Since the 3 June 2009 release, the following tests have changed:
Removed tests:
css3-modsel-d5 - :indeterminate
css3-modsel-d5a - :indeterminate and :checked
css3-modsel-d5b - NEGATED :indeterminate and :checked
css3-modsel-d5c - :indeterminate and :checked
css3-modsel-d5d - :indeterminate with :checked
css3-modsel-d5e - NEGATED :indeterminate with :checked
:indeterminate is not part of Selectors Level 3
------------------------------------------------------------------------
Since the 7 March 2006 release, the following tests have changed:
New tests:
css3-modsel-184a - Ends-wth attribute selector with empty value
css3-modsel-184b - Starts-with attribute selector with empty value
css3-modsel-184c - Contains attribute selector with empty value
css3-modsel-184d - NEGATED ends-with attribute selector with empty value
css3-modsel-184e - NEGATED starts-with attribute selector with empty value
css3-modsel-184f - NEGATED contains attribute selector with empty value
Tests to verify that attribute selectors with empty values don't match
Removed tests:
css3-modsel-40 - ::selection pseudo-element
css3-modsel-162 - Contextual ::selection
css3-modsel-164 - :focus with ::selection
css3-modsel-165 - :hover with ::selection
::selection has been removed from Selectors Level 3
------------------------------------------------------------------------
Since the 19 October 2005 release, the following tests have changed:
Modified tests:
css3-modsel-6 - Attribute value selector
Removed confusing prose and made it a simple pass criteria.
css3-modsel-18 - :hover pseudo-class
Removed test of border-spacing.
css3-modsel-39a - ::first-letter pseudo-element with ::before pseudo-element
css3-modsel-39c - ::first-letter pseudo-element with ::before pseudo-element
Changed from background-color to color.
css3-modsel-161 - Syntax and parsing of unknown pseudo-classes and pseudo-elements
Added the metadata making this test an interactive test.
css3-modsel-d5 - :indeterminate
css3-modsel-d5a - :indeterminate and :checked
css3-modsel-d5d - :indeterminate with :checked
css3-modsel-d5e - NEGATED :indeterminate with :checked
Changed so that UAs that do not support styling of form controls
can still pass these tests if they support combinators (mark II).
css3-modsel-d1b - Dynamic handling of :empty
Updated to test what the spec actually says (oops).
Removed tests:
css3-modsel-180 - ::first-letter on inlines
We changed the spec so that first-letter doesn't apply to
inlines, but we don't want to just reverse the test since we want
to allow :first-letter to apply to inlines in future.
------------------------------------------------------------------------
Since the 3 October 2005 release, the following tests have changed:
New tests:
css3-modsel-27a - Impossible rules (:root:firstchild, etc)
css3-modsel-27b - Impossible rules (* html, * :root)
A test to verify there are no elements above the root element.
------------------------------------------------------------------------
Since the 16 December 2004 release, the following tests have changed:
Modified tests:
css3-modsel-15c - Multiple IDs
css3-modsel-d3 - Dynamic handling of attribute selectors
Fixed typos in script.
css3-modsel-70 - NEGATED :checked pseudo-class
css3-modsel-d5b - NEGATED :indeterminate and :checked
css3-modsel-d5c - :indeterminate and :checked
css3-modsel-d5e - NEGATED :indeterminate with :checked
Changed so that UAs that do not support styling of form controls
can still pass these tests if they support combinators.
css3-modsel-66 - NEGATED :target pseudo-class
Changed colours so it is less misleading on non-supporting UAs.
css3-modsel-39b - ::first-letter pseudo-element
css3-modsel-39 - ::first-letter pseudo-element
css3-modsel-39a - ::first-letter pseudo-element with ::before pseudo-element
css3-modsel-39c - ::first-letter pseudo-element with ::before pseudo-element
Made their "very long paragraphs" actually be long.
css3-modsel-84 - :contains() pseudo-class
css3-modsel-85 - NEGATED :contains() pseudo-class
Made text less misleading about the pass condition.
Removed tests:
css3-modsel-19a - :active pseudo-class on blocks
This test tested something that the spec did not specify.
css3-modsel-84 - :contains() pseudo-class
css3-modsel-84b - :contains() pseudo-class
css3-modsel-85 - NEGATED :contains() pseudo-class
css3-modsel-163 - Contextual :contains
Removed since :contains() was removed.
------------------------------------------------------------------------
Since the 10 May 2004 release, the following tests have changed:
New tests:
css3-modsel-15c - Multiple IDs
A test that checks if UAs support multiple IDs on the same
element. Requires two or more of XHTML, xml:id, and DOM3 Core
support. See also the comment in the test itself.
Modified tests:
css3-modsel-90 - Simple combination of direct and indirect adjacent combinators
css3-modsel-d3 - Dynamic handling of attribute selectors
css3-modsel-15b - Multiple ID selectors
Changed to remove false-negative results in some of the test
harnesses.
css3-modsel-25 - :checked pseudo-class
Changed so that UAs that do not support styling of form controls
can still pass this test if they support combinators.
css3-modsel-162 - Contextual ::selection
Made the pass condition slightly clearer.
Fixed the control test to disable styling of all text in that section.
All tests involving namespace attributes
Fixed the generating script so that the tests involving
attributes once again have their namespace prefixes declared.
------------------------------------------------------------------------
Since the 21 April 2004 release, the following tests have changed:
New tests:
css3-modsel-183 - Syntax and parsing of class selectors
Some more detailed tests for error handling issues known to be
broken in some UAs.
Modified tests:
css3-modsel-14b - More than one class selector
Expanded the test to catch a few more potential bugs.
css3-modsel-153 - :empty pseudo-class and CDATA
css3-modsel-150 - :empty pseudo-class and XML/SGML constructs
Updating :empty tests to match agreed (if as yet unpublished)
errata.
------------------------------------------------------------------------
Since the 2 March 2004 release, the following tests have changed:
New tests:
css3-modsel-42a - :after pseudo-element
css3-modsel-41a - :before pseudo-element
Removed tests:
css3-modsel-12 - Default attribute value
css3-modsel-58 - Default attribute value and negation pseudo-class
These tests no longer apply since UAs are now allowed to assume
attribute defaulting or to ignore it, basically at will.
Modified tests:
css3-modsel-23 - :enabled pseudo-class
css3-modsel-24 - :disabled pseudo-class
css3-modsel-28 - :nth-child() pseudo-class
css3-modsel-28b - :nth-child() pseudo-class
css3-modsel-29 - :nth-last-child() pseudo-class
css3-modsel-29b - :nth-last-child() pseudo-class
css3-modsel-32 - :first-child pseudo-class
css3-modsel-33 - :last-child pseudo-class
css3-modsel-68 - NEGATED :enabled pseudo-class
css3-modsel-69 - NEGATED :disabled pseudo-class
css3-modsel-73 - NEGATED :nth-child() pseudo-class
css3-modsel-73b - NEGATED :nth-child() pseudo-class
css3-modsel-74 - NEGATED :nth-last-child() pseudo-class
css3-modsel-74b - NEGATED :nth-last-child() pseudo-class
css3-modsel-77 - NEGATED :first-child pseudo-class
css3-modsel-77b - NEGATED :first-child pseudo-class
css3-modsel-78 - NEGATED :last-child pseudo-class
css3-modsel-78b - NEGATED :last-child pseudo-class
css3-modsel-87 - Nondeterministic matching of direct and indirect adjacent combinators
css3-modsel-87b - Nondeterministic matching of direct and indirect adjacent combinators
css3-modsel-88 - Nondeterministic matching of descendant and direct adjacent combinators
css3-modsel-88b - Nondeterministic matching of descendant and direct adjacent combinators
css3-modsel-90 - Simple combination of direct and indirect adjacent combinators
css3-modsel-90b - Simple combination of direct and indirect adjacent combinators
css3-modsel-d1 - NEGATED Dynamic handling of :empty
css3-modsel-d1b - NEGATED Dynamic handling of :empty
css3-modsel-d2 - Dynamic handling of combinators
css3-modsel-d3 - Dynamic handling of attribute selectors
css3-modsel-d4 - Dynamic updating of :first-child and :last-child
css3-modsel-d5 - :indeterminate
css3-modsel-d5a - :indeterminate and :checked
css3-modsel-d5b - NEGATED :indeterminate and :checked
css3-modsel-d5c - :indeterminate and :checked
css3-modsel-d5d - :indeterminate with :checked
css3-modsel-d5e - NEGATED :indeterminate with :checked
(and some others depending on the test format)
Fixed minor standards compliance issues.
All the non-namespaced XHTML tests
Removed some extraneous namespace declarations that made the
tests invalid.
------------------------------------------------------------------------
Since the 15 September 2003 release, the following tests have changed:
New tests:
css3-modsel-3a - Universal selector (no namespaces)
css3-modsel-18a - :hover pseudo-class on links
css3-modsel-18c - :hover pseudo-class on links
css3-modsel-19a - :active pseudo-class on blocks
css3-modsel-19b - :active pseudo-class on controls
css3-modsel-179 - ::first-line on inlines
css3-modsel-179a - ::first-line after <br>
css3-modsel-180 - ::first-letter on inlines
css3-modsel-180a - ::first-letter after <br>
css3-modsel-181 - Case sensitivity
css3-modsel-182 - Namespaces and \: in selectors
Modified tests:
css3-modsel-21c - :target pseudo-class
Fixed to match spec errata.
css3-modsel-98 - Attribute value selector with declared namespace
Added a test to make sure the attribute selectors work without quotes.
css3-modsel-161 - Syntax and parsing of unknown pseudo-classes and pseudo-elements
Added more tests and split up the existing test to catch more possible errors.
css3-modsel-44 - Child combinator
Stylesheet used the wrong property name.
------------------------------------------------------------------------

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

@ -1,52 +0,0 @@
##############################################################################
# W3C Test Suite Generator #
##############################################################################
## Variables
DESTINATION_TYPES=$(shell perl generate.pl -v DESTINATION_TYPES)
SHELL_TYPES=$(shell perl generate.pl -v SHELL_TYPES)
TEST_TYPES=$(shell perl generate.pl -v TEST_TYPES)
SOURCE=$(shell ls *.xml)
STYLESHEETS=dist/style/tng.css $(shell perl -e 'foreach $$a (qw($(DESTINATION_TYPES))) { print "dist/style/$$a-full.css\ndist/style/$$a-shell.css\n"; }')
## Main Targets
all: directories cache $(STYLESHEETS) dist/.htaccess dist/CHANGES
directories: Makefile generate.pl utils/*
-rm -rf dist/
-rm cache
perl -e 'foreach $$a (qw($(DESTINATION_TYPES))) { print `mkdir -p dist/$$a/tests\n`; foreach $$b (qw($(TEST_TYPES))) { print `mkdir -p dist/$$a/$$b/flat\n`; foreach $$c (qw($(SHELL_TYPES))) { print `mkdir -p dist/$$a/$$b/$$c\n`; } } }'
mkdir -p dist/style
touch directories
cache: $(SOURCE)
perl generate.pl $?
## Support Files
# (not mentioned in 'all' as there is no README)
dist/README: README.dist
cp README.dist dist/README
dist/CHANGES: CHANGES
cp CHANGES dist/CHANGES
dist/style/%.css: %.css
cp $< $@
dist/.htaccess: htaccess
cp htaccess dist/.htaccess
## Phony Targets
.PHONY: all clean
clean:
-rm -rf dist/
-rm directories
-rm cache
##############################################################################

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

@ -1,6 +0,0 @@
@tantek
@fantasai
@therealglazou
@frivoal
@plinss
@tabatkins

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

@ -1,13 +0,0 @@
Some things that need testing:
:nth-child(2n+3)
:nth-child(2n-2)
:nth-child(2n-3)
:nth-child(-2n+1)
:nth-child(-1n+6)
:nth-child(-2)
:nth-child(-2n-2)
:nth-child(-n-2)
summary file
See also:
http://www.w3.org/mid/40B8E7FA.3040409@mit.edu

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

@ -1,10 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS test reference</title>
<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu">
<style>
span { color: green; }
</style>
<body>
<a></a><span>This should be green</span>
</body>

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

@ -1,14 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS test: Handling of dynamic changes to :any-link selectors</title>
<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu">
<link rel="match" href="any-link-dynamic-001-ref.html">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#the-any-link-pseudo">
<style>
span { color: green; }
:any-link + span { color: red; }
</style>
<body onload="window.oldColor = getComputedStyle(document.querySelector('span')).color;
document.querySelector('a').removeAttribute('href');">
<a href=""></a><span>This should be green</span>
</body>

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

@ -1,14 +0,0 @@
<csstest def="Default attribute value" module="W3C Selectors" modulename="css3-modsel" number="12" rev="1.1" date="21-june-2003" xmlns:a="http://www.example.org/a" xmlns:b="http://www.example.org/b" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.example.org/css3tests">
<author>Daniel Glazman</author>
<author>Ian Hickson</author>
<cssrules>form { background-color : lime }
form[method] { background-color : red }
form[method="get"] { background-color : red }</cssrules>
<code>
<form action="http://www.example.org/foo.cgi" xmlns="http://www.w3.org/1999/xhtml">
<p>The line should have a green background.</p>
</form>
</code>
</csstest>

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