Merge mozilla-central to b2g-inbound

This commit is contained in:
Carsten "Tomcat" Book 2015-05-18 13:57:18 +02:00
Родитель 55f0cac7c7 09631fba2e
Коммит 7c8dfe495a
666 изменённых файлов: 8307 добавлений и 3740 удалений

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

@ -740,13 +740,9 @@ pref("hal.processPriorityManager.gonk.FOREGROUND_KEYBOARD.OomScoreAdjust", 200);
pref("hal.processPriorityManager.gonk.FOREGROUND_KEYBOARD.cgroup", "apps");
pref("hal.processPriorityManager.gonk.BACKGROUND_PERCEIVABLE.OomScoreAdjust", 400);
pref("hal.processPriorityManager.gonk.BACKGROUND_PERCEIVABLE.KillUnderKB", 7168);
pref("hal.processPriorityManager.gonk.BACKGROUND_PERCEIVABLE.KillUnderKB", 8192);
pref("hal.processPriorityManager.gonk.BACKGROUND_PERCEIVABLE.cgroup", "apps/bg_perceivable");
pref("hal.processPriorityManager.gonk.BACKGROUND_HOMESCREEN.OomScoreAdjust", 534);
pref("hal.processPriorityManager.gonk.BACKGROUND_HOMESCREEN.KillUnderKB", 8192);
pref("hal.processPriorityManager.gonk.BACKGROUND_HOMESCREEN.cgroup", "apps/bg_non_interactive");
pref("hal.processPriorityManager.gonk.BACKGROUND.OomScoreAdjust", 667);
pref("hal.processPriorityManager.gonk.BACKGROUND.KillUnderKB", 20480);
pref("hal.processPriorityManager.gonk.BACKGROUND.cgroup", "apps/bg_non_interactive");

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

@ -439,6 +439,10 @@
@RESPATH@/components/TCPPresentationServer.js
#ifdef MOZ_SECUREELEMENT
@RESPATH@/components/ACEService.js
@RESPATH@/components/ACEService.manifest
@RESPATH@/components/GPAccessRulesManager.js
@RESPATH@/components/GPAccessRulesManager.manifest
@RESPATH@/components/SecureElement.js
@RESPATH@/components/SecureElement.manifest
@RESPATH@/components/UiccConnector.js

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

@ -1403,6 +1403,8 @@ pref("devtools.inspector.showUserAgentStyles", false);
pref("devtools.inspector.showAllAnonymousContent", false);
// Enable the MDN docs tooltip
pref("devtools.inspector.mdnDocsTooltip.enabled", true);
// Show the new animation inspector UI
pref("devtools.inspector.animationInspectorV3", false);
// DevTools default color unit
pref("devtools.defaultColorUnit", "hex");

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

@ -49,19 +49,19 @@ let _referrerTests = [
rel: "noreferrer",
result: "" // rel=noreferrer trumps meta-referrer
},
// 3. Origin-when-crossorigin policy - this depends on the triggering
// 3. Origin-when-cross-origin policy - this depends on the triggering
// principal. We expect full referrer for same-origin requests,
// and origin referrer for cross-origin requests.
{
fromScheme: "https://",
toScheme: "https://",
policy: "origin-when-crossorigin",
policy: "origin-when-cross-origin",
result: "https://test1.example.com/browser" // same origin
},
{
fromScheme: "http://",
toScheme: "https://",
policy: "origin-when-crossorigin",
policy: "origin-when-cross-origin",
result: "http://test1.example.com" // cross origin
},
];

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

@ -38,7 +38,7 @@
onselect="AboutPermissions.onSitesListSelect(event);">
<richlistitem id="all-sites-item"
class="site"
value="&sites.allSites;"/>
value="&sites.allSites;"/>
</richlistbox>
</vbox>
@ -63,217 +63,220 @@
</hbox>
</deck>
<!-- Passwords -->
<hbox id="password-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="password"/>
<vbox>
<label class="pref-title" value="&password.label;"/>
<hbox align="center">
<menulist id="password-menulist"
class="pref-menulist"
type="password"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="password-1" value="1" label="&permission.allow;"/>
<menuitem id="password-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
<button id="passwords-manage-all-button"
label="&password.manage;"
oncommand="AboutPermissions.managePasswords();"/>
</hbox>
<hbox id="passwords-count" align="center">
<label id="passwords-label"/>
<button id="passwords-manage-button"
label="&password.manage;"
oncommand="AboutPermissions.managePasswords();"/>
</hbox>
</vbox>
</hbox>
<vbox id="permissions-list" flex="1">
<!-- Geolocation -->
<hbox id="geo-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="geo"/>
<vbox>
<label class="pref-title" value="&geo.label;"/>
<hbox>
<menulist id="geo-menulist"
class="pref-menulist"
type="geo"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="geo-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="geo-1" value="1" label="&permission.allow;"/>
<menuitem id="geo-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Passwords -->
<hbox id="password-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="password"/>
<vbox>
<label class="pref-title" value="&password.label;"/>
<hbox align="center">
<menulist id="password-menulist"
class="pref-menulist"
type="password"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="password-1" value="1" label="&permission.allow;"/>
<menuitem id="password-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
<button id="passwords-manage-all-button"
label="&password.manage;"
oncommand="AboutPermissions.managePasswords();"/>
</hbox>
<hbox id="passwords-count" align="center">
<label id="passwords-label"/>
<button id="passwords-manage-button"
label="&password.manage;"
oncommand="AboutPermissions.managePasswords();"/>
</hbox>
</vbox>
</hbox>
<!-- Camera -->
<hbox id="camera-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="camera"/>
<vbox>
<label class="pref-title" value="&camera.label;"/>
<hbox align="center">
<menulist id="camera-menulist"
class="pref-menulist"
type="camera"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="camera-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="camera-1" value="1" label="&permission.allow;"/>
<menuitem id="camera-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Geolocation -->
<hbox id="geo-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="geo"/>
<vbox>
<label class="pref-title" value="&geo.label;"/>
<hbox>
<menulist id="geo-menulist"
class="pref-menulist"
type="geo"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="geo-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="geo-1" value="1" label="&permission.allow;"/>
<menuitem id="geo-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Microphone -->
<hbox id="microphone-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="microphone"/>
<vbox>
<label class="pref-title" value="&microphone.label;"/>
<hbox align="center">
<menulist id="microphone-menulist"
class="pref-menulist"
type="microphone"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="microphone-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="microphone-1" value="1" label="&permission.allow;"/>
<menuitem id="microphone-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Camera -->
<hbox id="camera-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="camera"/>
<vbox>
<label class="pref-title" value="&camera.label;"/>
<hbox align="center">
<menulist id="camera-menulist"
class="pref-menulist"
type="camera"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="camera-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="camera-1" value="1" label="&permission.allow;"/>
<menuitem id="camera-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Cookies -->
<hbox id="cookie-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="cookie"/>
<vbox>
<label class="pref-title" value="&cookie.label;"/>
<hbox align="center">
<menulist id="cookie-menulist"
class="pref-menulist"
type="cookie"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="cookie-1" value="1" label="&permission.allow;"/>
<menuitem id="cookie-8" value="8" label="&permission.allowForSession;"/>
<menuitem id="cookie-9" value="9" label="&permission.allowFirstPartyOnly;"/>
<menuitem id="cookie-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
<button id="cookies-clear-all-button"
label="&cookie.removeAll;"
oncommand="Services.cookies.removeAll();"/>
<button id="cookies-manage-all-button"
label="&cookie.manage;"
oncommand="AboutPermissions.manageCookies();"/>
</hbox>
<hbox id="cookies-count" align="center">
<label id="cookies-label"/>
<button id="cookies-clear-button"
label="&cookie.remove;"
oncommand="AboutPermissions.clearCookies();"/>
<button id="cookies-manage-button"
label="&cookie.manage;"
oncommand="AboutPermissions.manageCookies();"/>
</hbox>
</vbox>
</hbox>
<!-- Microphone -->
<hbox id="microphone-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="microphone"/>
<vbox>
<label class="pref-title" value="&microphone.label;"/>
<hbox align="center">
<menulist id="microphone-menulist"
class="pref-menulist"
type="microphone"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="microphone-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="microphone-1" value="1" label="&permission.allow;"/>
<menuitem id="microphone-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Pop-up Blocking -->
<hbox id="popup-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="popup"/>
<vbox>
<label class="pref-title" value="&popup.label;"/>
<hbox>
<menulist id="popup-menulist"
class="pref-menulist"
type="popup"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="popup-1" value="1" label="&permission.allow;"/>
<menuitem id="popup-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Cookies -->
<hbox id="cookie-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="cookie"/>
<vbox>
<label class="pref-title" value="&cookie.label;"/>
<hbox align="center">
<menulist id="cookie-menulist"
class="pref-menulist"
type="cookie"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="cookie-1" value="1" label="&permission.allow;"/>
<menuitem id="cookie-8" value="8" label="&permission.allowForSession;"/>
<menuitem id="cookie-9" value="9" label="&permission.allowFirstPartyOnly;"/>
<menuitem id="cookie-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
<button id="cookies-clear-all-button"
label="&cookie.removeAll;"
oncommand="Services.cookies.removeAll();"/>
<button id="cookies-manage-all-button"
label="&cookie.manage;"
oncommand="AboutPermissions.manageCookies();"/>
</hbox>
<hbox id="cookies-count" align="center">
<label id="cookies-label"/>
<button id="cookies-clear-button"
label="&cookie.remove;"
oncommand="AboutPermissions.clearCookies();"/>
<button id="cookies-manage-button"
label="&cookie.manage;"
oncommand="AboutPermissions.manageCookies();"/>
</hbox>
</vbox>
</hbox>
<!-- IndexedDB Storage -->
<hbox id="indexedDB-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="indexedDB"/>
<vbox>
<label class="pref-title" value="&indexedDB.label;"/>
<hbox>
<menulist id="indexedDB-menulist"
class="pref-menulist"
type="indexedDB"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="indexedDB-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="indexedDB-1" value="1" label="&permission.allow;"/>
<menuitem id="indexedDB-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Pop-up Blocking -->
<hbox id="popup-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="popup"/>
<vbox>
<label class="pref-title" value="&popup.label;"/>
<hbox>
<menulist id="popup-menulist"
class="pref-menulist"
type="popup"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="popup-1" value="1" label="&permission.allow;"/>
<menuitem id="popup-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Fullscreen -->
<hbox id="fullscreen-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="fullscreen"/>
<vbox>
<label class="pref-title" value="&fullscreen.label;"/>
<hbox align="center">
<menulist id="fullscreen-menulist"
class="pref-menulist"
type="fullscreen"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="fullscreen-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="fullscreen-1" value="1" label="&permission.allow;"/>
<menuitem id="fullscreen-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- IndexedDB Storage -->
<hbox id="indexedDB-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="indexedDB"/>
<vbox>
<label class="pref-title" value="&indexedDB.label;"/>
<hbox>
<menulist id="indexedDB-menulist"
class="pref-menulist"
type="indexedDB"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="indexedDB-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="indexedDB-1" value="1" label="&permission.allow;"/>
<menuitem id="indexedDB-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Push Notifications -->
<hbox id="push-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="push"/>
<vbox>
<label class="pref-title" value="&push.label;"/>
<hbox align="center">
<menulist id="push-menulist"
class="pref-menulist"
type="push"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="push-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="push-1" value="1" label="&permission.allow;"/>
<menuitem id="push-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Fullscreen -->
<hbox id="fullscreen-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="fullscreen"/>
<vbox>
<label class="pref-title" value="&fullscreen.label;"/>
<hbox align="center">
<menulist id="fullscreen-menulist"
class="pref-menulist"
type="fullscreen"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="fullscreen-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="fullscreen-1" value="1" label="&permission.allow;"/>
<menuitem id="fullscreen-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
<!-- Push Notifications -->
<hbox id="push-pref-item"
class="pref-item" align="top">
<image class="pref-icon" type="push"/>
<vbox>
<label class="pref-title" value="&push.label;"/>
<hbox align="center">
<menulist id="push-menulist"
class="pref-menulist"
type="push"
oncommand="AboutPermissions.onPermissionCommand(event);">
<menupopup>
<menuitem id="push-0" value="0" label="&permission.alwaysAsk;"/>
<menuitem id="push-1" value="1" label="&permission.allow;"/>
<menuitem id="push-2" value="2" label="&permission.block;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</hbox>
</vbox>
</vbox>
</hbox>

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

@ -1,17 +1,9 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
let tempScope = {};
let {gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let TargetFactory = devtools.TargetFactory;
let TEST_URI = "http://mochi.test:8888/browser/browser/devtools/fontinspector/test/browser_fontinspector.html";
let view, viewDoc;
const BASE_URI = "http://mochi.test:8888/browser/browser/devtools/fontinspector/test/"
const TEST_URI = BASE_URI + "browser_fontinspector.html";
const FONTS = [
{name: "Ostrich Sans Medium", remote: true, url: BASE_URI + "ostrich-regular.ttf",
format: "truetype", cssName: "bar"},
@ -24,33 +16,17 @@ const FONTS = [
];
add_task(function*() {
yield loadTab(TEST_URI);
let {toolbox, inspector} = yield openInspector();
let { inspector, fontInspector } = yield openFontInspectorForURL(TEST_URI);
ok(!!fontInspector, "Font inspector document is alive.");
info("Selecting the test node");
yield selectNode("body", inspector);
let viewDoc = fontInspector.chromeDoc;
let updated = inspector.once("fontinspector-updated");
inspector.sidebar.select("fontinspector");
yield updated;
info("Font Inspector ready");
view = inspector.sidebar.getWindowForTab("fontinspector");
viewDoc = view.document;
ok(!!view.fontInspector, "Font inspector document is alive.");
yield testBodyFonts(inspector);
yield testDivFonts(inspector);
yield testShowAllFonts(inspector);
view = viewDoc = null;
yield testBodyFonts(inspector, viewDoc);
yield testDivFonts(inspector, viewDoc);
yield testShowAllFonts(inspector, viewDoc);
});
function* testBodyFonts(inspector) {
function* testBodyFonts(inspector, viewDoc) {
let s = viewDoc.querySelectorAll("#all-fonts > section");
is(s.length, 5, "Found 5 fonts");
@ -89,7 +65,7 @@ function* testBodyFonts(inspector) {
"Arial", "local font has right css name");
}
function* testDivFonts(inspector) {
function* testDivFonts(inspector, viewDoc) {
let updated = inspector.once("fontinspector-updated");
yield selectNode("div", inspector);
yield updated;
@ -100,7 +76,7 @@ function* testDivFonts(inspector) {
"The DIV font has the right name");
}
function* testShowAllFonts(inspector) {
function* testShowAllFonts(inspector, viewDoc) {
info("testing showing all fonts");
let updated = inspector.once("fontinspector-updated");

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

@ -13,6 +13,8 @@ const { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {})
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let TargetFactory = devtools.TargetFactory;
const BASE_URI = "http://mochi.test:8888/browser/browser/devtools/fontinspector/test/"
// All test are asynchronous
waitForExplicitFinish();
@ -98,6 +100,52 @@ let openInspector = Task.async(function*(cb) {
}
});
/**
* Adds a new tab with the given URL, opens the inspector and selects the
* font-inspector tab.
*
* @return Object
* {
* toolbox,
* inspector,
* fontInspector
* }
*/
let openFontInspectorForURL = Task.async(function* (url) {
info("Opening tab " + url);
yield loadTab(url);
let { toolbox, inspector } = yield openInspector();
/**
* Call selectNode to trigger font-inspector update so that we don't timeout
* if following conditions hold
* a) the initial 'fontinspector-updated' was emitted while we were waiting
* for openInspector to resolve
* b) the font-inspector tab was selected by default which means the call to
* select will not trigger another update.
*
* selectNode calls setNodeFront which always emits 'new-node' which calls
* FontInspector.update that emits the 'fontinspector-updated' event.
*/
let updated = inspector.once("fontinspector-updated");
yield selectNode("body", inspector);
inspector.sidebar.select("fontinspector");
info("Waiting for font-inspector to update.");
yield updated;
info("Font Inspector ready.");
let { fontInspector } = inspector.sidebar.getWindowForTab("fontinspector");
return {
fontInspector,
inspector,
toolbox
};
});
/**
* Select a node in the inspector given its selector.
*/

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

@ -573,9 +573,86 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
let selected = this.selectedItem.attachment;
let params = nsIURL(selected.url).query.split("&");
let string = params.join(Services.appinfo.OS === "WINNT" ? "\r\n" : "\n");
clipboardHelper.copyString(params.join("\n"), document);
clipboardHelper.copyString(string, document);
},
/**
* Extracts any urlencoded form data sections (e.g. "?foo=bar&baz=42") from a
* POST request.
*
* @param object aHeaders
* The "requestHeaders".
* @param object aUploadHeaders
* The "requestHeadersFromUploadStream".
* @param object aPostData
* The "requestPostData".
* @return array
* A promise that is resolved with the extracted form data.
*/
_getFormDataSections: Task.async(function*(aHeaders, aUploadHeaders, aPostData) {
let formDataSections = [];
let { headers: requestHeaders } = aHeaders;
let { headers: payloadHeaders } = aUploadHeaders;
let allHeaders = [...payloadHeaders, ...requestHeaders];
let contentTypeHeader = allHeaders.find(e => e.name.toLowerCase() == "content-type");
let contentTypeLongString = contentTypeHeader ? contentTypeHeader.value : "";
let contentType = yield gNetwork.getString(contentTypeLongString);
if (contentType.includes("x-www-form-urlencoded")) {
let postDataLongString = aPostData.postData.text;
let postData = yield gNetwork.getString(postDataLongString);
for (let section of postData.split(/\r\n|\r|\n/)) {
// Before displaying it, make sure this section of the POST data
// isn't a line containing upload stream headers.
if (payloadHeaders.every(header => !section.startsWith(header.name))) {
formDataSections.push(section);
}
}
}
return formDataSections;
}),
/**
* Copy the request form data parameters (or raw payload) from the currently selected item.
*/
copyPostData: Task.async(function*() {
let selected = this.selectedItem.attachment;
let view = this;
// Try to extract any form data parameters.
let formDataSections = yield view._getFormDataSections(
selected.requestHeaders,
selected.requestHeadersFromUploadStream,
selected.requestPostData);
let params = [];
formDataSections.forEach(section => {
let paramsArray = parseQueryString(section);
if (paramsArray) {
params = [...params, ...paramsArray];
}
});
let string = params
.map(param => param.name + (param.value ? "=" + param.value : ""))
.join(Services.appinfo.OS === "WINNT" ? "\r\n" : "\n");
// Fall back to raw payload.
if (!string) {
let postData = selected.requestPostData.postData.text;
string = yield gNetwork.getString(postData);
if (Services.appinfo.OS !== "WINNT") {
string = string.replace(/\r/g, "");
}
}
clipboardHelper.copyString(string, document);
}),
/**
* Copy a cURL command from the currently selected item.
*/
@ -1843,6 +1920,9 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
let copyUrlParamsElement = $("#request-menu-context-copy-url-params");
copyUrlParamsElement.hidden = !selectedItem || !nsIURL(selectedItem.attachment.url).query;
let copyPostDataElement = $("#request-menu-context-copy-post-data");
copyPostDataElement.hidden = !selectedItem || !selectedItem.attachment.requestPostData;
let copyAsCurlElement = $("#request-menu-context-copy-as-curl");
copyAsCurlElement.hidden = !selectedItem || !selectedItem.attachment.responseContent;
@ -2450,19 +2530,19 @@ NetworkDetailsView.prototype = {
/**
* Sets the network request headers shown in this view.
*
* @param object aHeadersResponse
* @param object aHeaders
* The "requestHeaders" message received from the server.
* @param object aHeadersFromUploadStream
* @param object aUploadHeaders
* The "requestHeadersFromUploadStream" inferred from the POST payload.
* @return object
* A promise that resolves when request headers are set.
*/
_setRequestHeaders: Task.async(function*(aHeadersResponse, aHeadersFromUploadStream) {
if (aHeadersResponse && aHeadersResponse.headers.length) {
yield this._addHeaders(this._requestHeaders, aHeadersResponse);
_setRequestHeaders: Task.async(function*(aHeaders, aUploadHeaders) {
if (aHeaders && aHeaders.headers.length) {
yield this._addHeaders(this._requestHeaders, aHeaders);
}
if (aHeadersFromUploadStream && aHeadersFromUploadStream.headers.length) {
yield this._addHeaders(this._requestHeadersFromUpload, aHeadersFromUploadStream);
if (aUploadHeaders && aUploadHeaders.headers.length) {
yield this._addHeaders(this._requestHeadersFromUpload, aUploadHeaders);
}
}),
@ -2590,40 +2670,28 @@ NetworkDetailsView.prototype = {
/**
* Sets the network request post params shown in this view.
*
* @param object aHeadersResponse
* @param object aHeaders
* The "requestHeaders" message received from the server.
* @param object aHeadersFromUploadStream
* @param object aUploadHeaders
* The "requestHeadersFromUploadStream" inferred from the POST payload.
* @param object aPostDataResponse
* @param object aPostData
* The "requestPostData" message received from the server.
* @return object
* A promise that is resolved when the request post params are set.
*/
_setRequestPostParams: Task.async(function*(aHeadersResponse, aHeadersFromUploadStream, aPostDataResponse) {
if (!aHeadersResponse || !aHeadersFromUploadStream || !aPostDataResponse) {
_setRequestPostParams: Task.async(function*(aHeaders, aUploadHeaders, aPostData) {
if (!aHeaders || !aUploadHeaders || !aPostData) {
return;
}
let { headers: requestHeaders } = aHeadersResponse;
let { headers: payloadHeaders } = aHeadersFromUploadStream;
let allHeaders = [...payloadHeaders, ...requestHeaders];
let formDataSections = yield RequestsMenuView.prototype._getFormDataSections(
aHeaders, aUploadHeaders, aPostData);
let contentTypeHeader = allHeaders.find(e => e.name.toLowerCase() == "content-type");
let contentTypeLongString = contentTypeHeader ? contentTypeHeader.value : "";
let postDataLongString = aPostDataResponse.postData.text;
let postData = yield gNetwork.getString(postDataLongString);
let contentType = yield gNetwork.getString(contentTypeLongString);
// Handle query strings (e.g. "?foo=bar&baz=42").
if (contentType.includes("x-www-form-urlencoded")) {
for (let section of postData.split(/\r\n|\r|\n/)) {
// Before displaying it, make sure this section of the POST data
// isn't a line containing upload stream headers.
if (payloadHeaders.every(header => !section.startsWith(header.name))) {
this._addParams(this._paramsFormData, section);
}
}
// Handle urlencoded form data sections (e.g. "?foo=bar&baz=42").
if (formDataSections.length > 0) {
formDataSections.forEach(section => {
this._addParams(this._paramsFormData, section);
});
}
// Handle actual forms ("multipart/form-data" content type).
else {
@ -2637,6 +2705,9 @@ NetworkDetailsView.prototype = {
$("#request-post-data-textarea-box").hidden = false;
let editor = yield NetMonitorView.editor("#request-post-data-textarea");
let postDataLongString = aPostData.postData.text;
let postData = yield gNetwork.getString(postDataLongString);
// Most POST bodies are usually JSON, so they can be neatly
// syntax highlighted as JS. Otheriwse, fall back to plain text.
try {

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

@ -32,6 +32,10 @@
label="&netmonitorUI.context.copyUrlParams;"
accesskey="&netmonitorUI.context.copyUrlParams.accesskey;"
oncommand="NetMonitorView.RequestsMenu.copyUrlParams();"/>
<menuitem id="request-menu-context-copy-post-data"
label="&netmonitorUI.context.copyPostData;"
accesskey="&netmonitorUI.context.copyPostData.accesskey;"
oncommand="NetMonitorView.RequestsMenu.copyPostData();"/>
<menuitem id="request-menu-context-copy-as-curl"
label="&netmonitorUI.context.copyAsCurl;"
accesskey="&netmonitorUI.context.copyAsCurl.accesskey;"

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

@ -18,31 +18,44 @@ function test() {
yield waitForNetworkEvents(aMonitor, 1, 6);
RequestsMenu.selectedItem = RequestsMenu.getItemAtIndex(0);
testCopyUrlParamsHidden(false);
testCopyUrlParams("a");
yield testCopyUrlParamsHidden(false);
yield testCopyUrlParams("a");
yield testCopyPostDataHidden(false);
yield testCopyPostData("{ \"foo\": \"bar\" }");
RequestsMenu.selectedItem = RequestsMenu.getItemAtIndex(1);
testCopyUrlParamsHidden(false);
testCopyUrlParams("a=b");
yield testCopyUrlParamsHidden(false);
yield testCopyUrlParams("a=b");
yield testCopyPostDataHidden(false);
yield testCopyPostData("{ \"foo\": \"bar\" }");
RequestsMenu.selectedItem = RequestsMenu.getItemAtIndex(2);
testCopyUrlParamsHidden(false);
testCopyUrlParams("a=b");
yield testCopyUrlParamsHidden(false);
yield testCopyUrlParams("a=b");
yield testCopyPostDataHidden(false);
yield testCopyPostData("foo=bar");
RequestsMenu.selectedItem = RequestsMenu.getItemAtIndex(3);
testCopyUrlParamsHidden(false);
testCopyUrlParams("a");
yield testCopyUrlParamsHidden(false);
yield testCopyUrlParams("a");
yield testCopyPostDataHidden(false);
yield testCopyPostData("{ \"foo\": \"bar\" }");
RequestsMenu.selectedItem = RequestsMenu.getItemAtIndex(4);
testCopyUrlParamsHidden(false);
testCopyUrlParams("a=b");
yield testCopyUrlParamsHidden(false);
yield testCopyUrlParams("a=b");
yield testCopyPostDataHidden(false);
yield testCopyPostData("{ \"foo\": \"bar\" }");
RequestsMenu.selectedItem = RequestsMenu.getItemAtIndex(5);
testCopyUrlParamsHidden(false);
testCopyUrlParams("a=b");
yield testCopyUrlParamsHidden(false);
yield testCopyUrlParams("a=b");
yield testCopyPostDataHidden(false);
yield testCopyPostData("?foo=bar");
RequestsMenu.selectedItem = RequestsMenu.getItemAtIndex(6);
testCopyUrlParamsHidden(true);
yield testCopyUrlParamsHidden(true);
yield testCopyPostDataHidden(true);
yield teardown(aMonitor);
finish();
@ -50,12 +63,27 @@ function test() {
function testCopyUrlParamsHidden(aHidden) {
RequestsMenu._onContextShowing();
is(document.querySelector("#request-menu-context-copy-url-params").hidden, aHidden, "The \"Copy URL Params\" context menu item should" + (aHidden ? " " : " not ") + "be hidden.");
is(document.querySelector("#request-menu-context-copy-url-params").hidden,
aHidden, "The \"Copy URL Parameters\" context menu item should" + (aHidden ? " " : " not ") + "be hidden.");
}
function testCopyUrlParams(aQueryString) {
RequestsMenu.copyUrlParams();
is(SpecialPowers.getClipboardData("text/unicode"), aQueryString, "The url query string copied from the selected item is correct.");
is(SpecialPowers.getClipboardData("text/unicode"),
aQueryString, "The url query string copied from the selected item is correct.");
}
function testCopyPostDataHidden(aHidden) {
RequestsMenu._onContextShowing();
is(document.querySelector("#request-menu-context-copy-post-data").hidden,
aHidden, "The \"Copy POST Data\" context menu item should" + (aHidden ? " " : " not ") + "be hidden.");
}
function testCopyPostData(aPostData) {
return RequestsMenu.copyPostData().then(() => {
is(SpecialPowers.getClipboardData("text/unicode"),
aPostData, "The post data string copied from the selected item is correct.");
});
}
aDebuggee.performRequests();

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

@ -112,7 +112,7 @@
#add-filter {
-moz-appearance: none;
background: url(chrome://browser/skin/devtools/add.svg);
background-size: 18px;
background-size: cover;
border: none;
width: 16px;
height: 16px;

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

@ -45,6 +45,8 @@
type="search" placeholder="&filterStylesPlaceholder;"/>
<button id="ruleview-searchinput-clear" class="devtools-searchinput-clear"></button>
</div>
<!-- TODO : Bug 1165122 : Show this button by default -->
<button hidden="true" id="ruleview-add-rule-button" title="&addRuleButtonTooltip;" class="devtools-button"></button>
</div>
</div>

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

@ -1135,6 +1135,7 @@ function CssRuleView(aInspector, aDoc, aStore, aPageStyle) {
this._onFilterTextboxContextMenu = this._onFilterTextboxContextMenu.bind(this);
this.element = this.doc.getElementById("ruleview-container");
this.addRuleButton = this.doc.getElementById("ruleview-add-rule-button");
this.searchField = this.doc.getElementById("ruleview-searchbox");
this.searchClearButton = this.doc.getElementById("ruleview-searchinput-clear");
@ -1142,6 +1143,7 @@ function CssRuleView(aInspector, aDoc, aStore, aPageStyle) {
this.element.addEventListener("copy", this._onCopy);
this.element.addEventListener("contextmenu", this._onContextMenu);
this.addRuleButton.addEventListener("click", this._onAddRule);
this.searchField.addEventListener("input", this._onFilterStyles);
this.searchField.addEventListener("keypress", this._onFilterKeyPress);
this.searchField.addEventListener("contextmenu", this._onFilterTextboxContextMenu);
@ -1197,8 +1199,8 @@ CssRuleView.prototype = {
this._contextmenu.id = "rule-view-context-menu";
this.menuitemAddRule = createMenuItem(this._contextmenu, {
label: "ruleView.contextmenu.addRule",
accesskey: "ruleView.contextmenu.addRule.accessKey",
label: "ruleView.contextmenu.addNewRule",
accesskey: "ruleView.contextmenu.addNewRule.accessKey",
command: this._onAddRule
});
this.menuitemSelectAll = createMenuItem(this._contextmenu, {
@ -1749,6 +1751,7 @@ CssRuleView.prototype = {
// Remove bound listeners
this.element.removeEventListener("copy", this._onCopy);
this.element.removeEventListener("contextmenu", this._onContextMenu);
this.addRuleButton.removeEventListener("click", this._onAddRule);
this.searchField.removeEventListener("input", this._onFilterStyles);
this.searchField.removeEventListener("keypress", this._onFilterKeyPress);
this.searchField.removeEventListener("contextmenu",

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

@ -27,42 +27,24 @@ const TEST_DATA = [
];
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");
content.document.body.innerHTML = PAGE_CONTENT;
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(PAGE_CONTENT));
info("Opening the rule-view");
let {toolbox, inspector, view} = yield openRuleView();
info("Iterating over the test data");
for (let data of TEST_DATA) {
yield runTestData(inspector, view, data);
yield runTestData(inspector, view, data, "context-menu");
yield runTestData(inspector, view, data, "button");
}
});
function* runTestData(inspector, view, data) {
function* runTestData(inspector, view, data, method) {
let {node, expected} = data;
info("Selecting the test element");
yield selectNode(node, inspector);
info("Waiting for context menu to be shown");
let onPopup = once(view._contextmenu, "popupshown");
let win = view.doc.defaultView;
EventUtils.synthesizeMouseAtCenter(view.element,
{button: 2, type: "contextmenu"}, win);
yield onPopup;
ok(!view.menuitemAddRule.hidden, "Add rule is visible");
info("Waiting for rule view to change");
let onRuleViewChanged = once(view, "ruleview-changed");
info("Adding the new rule");
view.menuitemAddRule.click();
yield onRuleViewChanged;
view._contextmenu.hidePopup();
yield addNewRule(inspector, view, method);
yield testNewRule(view, expected, 1);
@ -70,6 +52,31 @@ function* runTestData(inspector, view, data) {
content.document.body.innerHTML = PAGE_CONTENT;
}
function* addNewRule(inspector, view, method) {
if (method == "context-menu") {
info("Waiting for context menu to be shown");
let onPopup = once(view._contextmenu, "popupshown");
let win = view.doc.defaultView;
EventUtils.synthesizeMouseAtCenter(view.element,
{button: 2, type: "contextmenu"}, win);
yield onPopup;
ok(!view.menuitemAddRule.hidden, "Add rule is visible");
info("Adding the new rule");
view.menuitemAddRule.click();
view._contextmenu.hidePopup();
}
else {
info("Adding the new rule using the button");
view.addRuleButton.click();
}
info("Waiting for rule view to change");
let onRuleViewChanged = once(view, "ruleview-changed");
yield onRuleViewChanged;
}
function* testNewRule(view, expected, index) {
let idRuleEditor = getRuleViewRuleEditor(view, index);
let editor = idRuleEditor.selectorText.ownerDocument.activeElement;
@ -88,4 +95,4 @@ function* testNewRule(view, expected, index) {
let lastRule = textProps[textProps.length - 1];
is(lastRule.name, "font-weight", "Last rule name is font-weight");
is(lastRule.value, "bold", "Last rule value is bold");
}
}

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

@ -18,10 +18,7 @@ let PAGE_CONTENT = [
].join("\n");
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");
content.document.body.innerHTML = PAGE_CONTENT;
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(PAGE_CONTENT));
info("Opening the rule-view");
let {toolbox, inspector, view} = yield openRuleView();
@ -29,23 +26,13 @@ add_task(function*() {
info("Selecting the test element");
yield selectNode("#testid", inspector);
info("Waiting for context menu to be shown");
let onPopup = once(view._contextmenu, "popupshown");
let win = view.doc.defaultView;
EventUtils.synthesizeMouseAtCenter(view.element,
{button: 2, type: "contextmenu"}, win);
yield onPopup;
ok(!view.menuitemAddRule.hidden, "Add rule is visible");
info("Waiting for rule view to change");
let onRuleViewChanged = once(view, "ruleview-changed");
info("Adding the new rule");
view.menuitemAddRule.click();
view.addRuleButton.click();
yield onRuleViewChanged;
view._contextmenu.hidePopup();
yield testEditSelector(view, "span");

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

@ -18,10 +18,7 @@ let PAGE_CONTENT = [
].join("\n");
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");
content.document.body.innerHTML = PAGE_CONTENT;
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(PAGE_CONTENT));
info("Opening the rule-view");
let {toolbox, inspector, view} = yield openRuleView();
@ -29,23 +26,13 @@ add_task(function*() {
info("Selecting the test element");
yield selectNode("#testid", inspector);
info("Waiting for context menu to be shown");
let onPopup = once(view._contextmenu, "popupshown");
let win = view.doc.defaultView;
EventUtils.synthesizeMouseAtCenter(view.element,
{button: 2, type: "contextmenu"}, win);
yield onPopup;
ok(!view.menuitemAddRule.hidden, "Add rule is visible");
info("Waiting for rule view to change");
let onRuleViewChanged = once(view, "ruleview-changed");
info("Adding the new rule");
view.menuitemAddRule.click();
view.addRuleButton.click();
yield onRuleViewChanged;
view._contextmenu.hidePopup();
info("Adding new properties to the new rule");
yield testNewRule(view, "#testid", 1);

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

@ -18,13 +18,14 @@ Object.defineProperty(this, "TiltManager", {
exports.items = [
{
name: 'tilt',
name: "tilt",
description: l10n.lookup("tiltDesc"),
manual: l10n.lookup("tiltManual"),
hidden: true
},
{
name: 'tilt open',
name: "tilt open",
runAt: "client",
description: l10n.lookup("tiltOpenDesc"),
manual: l10n.lookup("tiltOpenManual"),
hidden: true,
@ -42,6 +43,7 @@ exports.items = [
},
{
name: "tilt toggle",
runAt: "client",
buttonId: "command-button-tilt",
buttonClass: "command-button command-button-invertable",
tooltipText: l10n.lookup("tiltToggleTooltip"),
@ -82,7 +84,8 @@ exports.items = [
}
},
{
name: 'tilt translate',
name: "tilt translate",
runAt: "client",
description: l10n.lookup("tiltTranslateDesc"),
manual: l10n.lookup("tiltTranslateManual"),
hidden: true,
@ -115,7 +118,8 @@ exports.items = [
}
},
{
name: 'tilt rotate',
name: "tilt rotate",
runAt: "client",
description: l10n.lookup("tiltRotateDesc"),
manual: l10n.lookup("tiltRotateManual"),
hidden: true,
@ -155,7 +159,8 @@ exports.items = [
}
},
{
name: 'tilt zoom',
name: "tilt zoom",
runAt: "client",
description: l10n.lookup("tiltZoomDesc"),
manual: l10n.lookup("tiltZoomManual"),
hidden: true,
@ -181,7 +186,8 @@ exports.items = [
}
},
{
name: 'tilt reset',
name: "tilt reset",
runAt: "client",
description: l10n.lookup("tiltResetDesc"),
manual: l10n.lookup("tiltResetManual"),
hidden: true,
@ -199,7 +205,8 @@ exports.items = [
}
},
{
name: 'tilt close',
name: "tilt close",
runAt: "client",
description: l10n.lookup("tiltCloseDesc"),
manual: l10n.lookup("tiltCloseManual"),
hidden: true,

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

@ -264,6 +264,14 @@
- for the Copy URL Parameters menu item displayed in the context menu for a request -->
<!ENTITY netmonitorUI.context.copyUrlParams.accesskey "P">
<!-- LOCALIZATION NOTE (netmonitorUI.context.copyPostData): This is the label displayed
- on the context menu that copies the selected request's post data -->
<!ENTITY netmonitorUI.context.copyPostData "Copy POST Data">
<!-- LOCALIZATION NOTE (netmonitorUI.context.copyPostData.accesskey): This is the access key
- for the Copy POST Data menu item displayed in the context menu for a request -->
<!ENTITY netmonitorUI.context.copyPostData.accesskey "D">
<!-- LOCALIZATION NOTE (netmonitorUI.context.copyAsCurl): This is the label displayed
- on the context menu that copies the selected request as a cURL command.
- The capitalization is part of the official name and should be used throughout all languages.

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

@ -17,6 +17,11 @@
- the search box when no search term has been entered. -->
<!ENTITY filterStylesPlaceholder "Filter Styles">
<!-- LOCALIZATION NOTE (addRuleButtonTooltip): This is the tooltip shown when
- hovering the `Add new rule` button in the rules view toolbar. This should
- match ruleView.contextmenu.addNewRule in styleinspector.properties -->
<!ENTITY addRuleButtonTooltip "Add new rule">
<!-- LOCALIZATION NOTE (selectedElementLabel): This is the label for the path of
- the highlighted element in the web page. This path is based on the document
- tree. -->

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

@ -2,13 +2,16 @@
* 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/. */
@import url("chrome://global/skin/inContentUI.css");
@import url("chrome://global/skin/in-content/common.css");
#permissions-content {
padding-top: 48px;
-moz-padding-end: 0; /* no padding to move the scroll bar to the edge */
}
/* sites box */
#sites-box {
padding: 10px;
width: 25em;
}
@ -39,13 +42,17 @@
/* permissions box */
#permissions-box {
padding-top: 10px;
-moz-padding-start: 10px;
}
#permissions-list {
overflow-y: auto;
padding-top: 5px;
-moz-padding-end: 44px;
}
#site-description {
font-size: 125%;
-moz-margin-start: 6px; /* to match button margin */
}
#site-label {
@ -57,7 +64,15 @@
#defaults-description {
font-size: 125%;
font-weight: bold;
-moz-margin-start: 6px;
}
#header-deck {
-moz-margin-end: 44px;
}
#site-header,
#defaults-header {
margin-bottom: 1px;
}
.pref-item {
@ -109,11 +124,16 @@
.pref-title {
font-size: 125%;
-moz-margin-start: 4px;
margin-bottom: 0;
font-weight: bold;
}
.pref-menulist {
margin-left: 6px;
margin-right: 6px;
min-width: 10em;
}
#cookies-label,
#passwords-label {
-moz-margin-start: 4px; /* align with the menulists */
}

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

@ -2,13 +2,16 @@
* 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/. */
@import url("chrome://global/skin/inContentUI.css");
@import url("chrome://global/skin/in-content/common.css");
#permissions-content {
padding-top: 48px;
-moz-padding-end: 0; /* no padding to move the scroll bar to the edge */
}
/* sites box */
#sites-box {
padding: 10px;
width: 25em;
}
@ -17,10 +20,6 @@
}
#sites-list {
-moz-appearance: none;
border: 1px solid rgba(60,73,97,0.5);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.15), 0 1px rgba(255,255,255,0.25);
background: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0.3));
margin: 5px 0 0 0;
}
@ -49,13 +48,17 @@
/* permissions box */
#permissions-box {
padding: 10px;
-moz-padding-start: 10px;
}
#permissions-list {
overflow-y: auto;
padding-top: 5px;
-moz-padding-end: 44px;
}
#site-description {
font-size: 125%;
-moz-margin-start: 6px; /* to match button margin */
}
#site-label {
@ -64,10 +67,22 @@
margin-bottom: 0;
}
#site-visit-count {
margin-bottom: 4px;
}
#defaults-description {
font-size: 125%;
font-weight: bold;
-moz-margin-start: 6px;
}
#header-deck {
-moz-margin-end: 44px;
}
#site-header,
#defaults-header {
margin-bottom: 1px;
}
.pref-item {
@ -125,11 +140,16 @@
.pref-title {
font-size: 125%;
-moz-margin-start: 2px; /* align with the menulists */
margin-bottom: 0;
font-weight: bold;
}
.pref-menulist {
margin-left: 6px;
margin-right: 6px;
min-width: 10em;
}
#cookies-label,
#passwords-label {
-moz-margin-start: 2px; /* align with the menulists */
}

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

@ -1,49 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="48"
height="16"
viewBox="0 0 16 16">
<style>
g:not(:target) {
display: none;
}
</style>
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="16" height="16" viewBox="0 0 16 16">
<defs>
<style type="text/css">
<![CDATA[
.style-icon-notification {
fill: #666666;
<style>
use:not(:target) {
display: none;
}
.style-icon-notification {
fill: #666;
}
.style-icon-notification.hover {
fill: #808080;
}
.style-icon-notification.active {
fill: #4d4d4d;
}
]]>
</style>
<path id="shape-notifcations-addons" d="M10,15c0.5,0,1-0.4,1-1v-3c0,0,0-0.8,0.8-0.8c0.6,0,0.6,0.8,1.8,0.8c0.6,0,1.5-0.2,1.5-2c0-1.8-0.9-2-1.5-2 c-1.1,0-1.1,0.7-1.8,0.7C11,7.7,11,7,11,7V6c0-0.6-0.5-1-1-1H8c0,0-0.8,0-0.8-0.8C7.2,3.6,8,3.6,8,2.5C8,1.9,7.8,1,6,1 C4.2,1,4,1.9,4,2.5c0,1.1,0.8,1.1,0.8,1.8C4.8,5,4,5,4,5H2C1.5,5,1,5.4,1,6l0,1.5c0,0-0.1,1,1.1,1c0.8,0,0.9-1,1.9-1 C4.5,7.4,5,8,5,9c0,1-0.5,1.6-1,1.6c-1,0-1.1-1.1-1.9-1.1C0.9,9.5,1,10.8,1,10.8V14c0,0.6,0.5,1,1,1l2.6,0c0,0,1.1,0,1.1-1 c0-0.8-1-0.1-1-1.1c0-0.5,0.7-1.2,1.8-1.2s1.8,0.7,1.8,1.2c0,1-1.1,0.3-1.1,1.1c0,1,1.2,1,1.2,1H10z"/>
</defs>
<g id="default">
<use xlink:href="#shape-notifcations-addons" class="style-icon-notification" />
</g>
<g id="hover">
<use xlink:href="#shape-notifcations-addons" class="style-icon-notification hover" />
</g>
<g id="active">
<use xlink:href="#shape-notifcations-addons" class="style-icon-notification active" />
</g>
<use id="default" xlink:href="#shape-notifcations-addons" class="style-icon-notification"/>
<use id="hover" xlink:href="#shape-notifcations-addons" class="style-icon-notification hover"/>
<use id="active" xlink:href="#shape-notifcations-addons" class="style-icon-notification active"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.6 KiB

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

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

@ -1,54 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="64"
height="64"
viewBox="0 0 64 64">
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="64" height="64" viewBox="0 0 64 64">
<defs>
<style type="text/css">
<![CDATA[
<style>
.style-puzzle-piece {
fill: url('#gradient-linear-puzzle-piece');
}
.style-badge-shadow {
fill: #0d131a;
fill: #0d131a;
fill-opacity: .15;
}
.style-badge-background {
fill: #fff;
fill: #fff;
}
.style-badge-inside {
fill: #e62117;
fill: #e62117;
}
.style-badge-icon {
fill: #fff;
fill: #fff;
}
]]>
</style>
<linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#999999" stop-opacity="1"/>
<stop offset="100%" stop-color="#8c8c8c" stop-opacity="1"/>
</linearGradient>
</defs>
<path id="puzzle-piece" class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg id="badge-state" width="32" height="32" x="32" y="0">
<path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg width="32" height="32" x="32" y="0">
<ellipse class="style-badge-shadow" rx="14" ry="15" cx="16" cy="17" />
<circle class="style-badge-background" r="15" cy="15" cx="16" />
<circle class="style-badge-inside" r="12" cy="15" cx="16" />
<rect class="style-badge-icon" x="9" y="13" width="14" height="4" rx="1" ry="1" />
</svg>
</svg>

До

Ширина:  |  Высота:  |  Размер: 2.0 KiB

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

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

@ -1,31 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="64"
height="64"
viewBox="0 0 64 64">
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="64" height="64" viewBox="0 0 64 64">
<defs>
<style type="text/css">
<![CDATA[
<style>
.style-puzzle-piece {
fill: url('#gradient-linear-puzzle-piece');
}
]]>
</style>
<linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#66cc52" stop-opacity="1"/>
<stop offset="100%" stop-color="#60bf4c" stop-opacity="1"/>
</linearGradient>
</defs>
<path id="puzzle-piece" class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.4 KiB

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

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

@ -1,54 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="64"
height="64"
viewBox="0 0 64 64">
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="64" height="64" viewBox="0 0 64 64">
<defs>
<style type="text/css">
<![CDATA[
<style>
.style-puzzle-piece {
fill: url('#gradient-linear-puzzle-piece');
}
.style-badge-shadow {
fill: #0d131a;
fill: #0d131a;
fill-opacity: .15;
}
.style-badge-background {
fill: #fff;
fill: #fff;
}
.style-badge-inside {
fill: #55cc3d;
fill: #55cc3d;
}
.style-badge-icon {
fill: #fff;
fill: #fff;
}
]]>
</style>
<linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#66cc52" stop-opacity="1"/>
<stop offset="100%" stop-color="#60bf4c" stop-opacity="1"/>
</linearGradient>
</defs>
<path id="puzzle-piece" class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg id="badge-state" width="32" height="32" x="32" y="0">
<path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg width="32" height="32" x="32" y="0">
<ellipse class="style-badge-shadow" rx="14" ry="15" cx="16" cy="17" />
<circle class="style-badge-background" r="15" cy="15" cx="16" />
<circle class="style-badge-inside" r="12" cy="15" cx="16" />
<path class="style-badge-icon" d="M22.7,16.1l-5.6,5.5C16.8,21.9,16.4,22,16,22c-0.4,0-0.7-0.1-1-0.4 l-5.6-5.5C8.8,15.5,8.9,15,9.8,15l3.2,0V9c0-0.6,0.5-1,1.1-1h4c0.6,0,1,0.4,1,1v6h3.2C23.1,15,23.3,15.5,22.7,16.1z"/>
</svg>
</svg>

До

Ширина:  |  Высота:  |  Размер: 2.1 KiB

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

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

@ -1,54 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="64"
height="64"
viewBox="0 0 64 64">
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="64" height="64" viewBox="0 0 64 64">
<defs>
<style type="text/css">
<![CDATA[
<style>
.style-puzzle-piece {
fill: url('#gradient-linear-puzzle-piece');
}
.style-badge-shadow {
fill: #0d131a;
fill: #0d131a;
fill-opacity: .15;
}
.style-badge-background {
fill: #fff;
fill: #fff;
}
.style-badge-inside {
fill: #e62117;
fill: #e62117;
}
.style-badge-icon {
fill: #fff;
fill: #fff;
}
]]>
</style>
<linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#999999" stop-opacity="1"/>
<stop offset="100%" stop-color="#8c8c8c" stop-opacity="1"/>
</linearGradient>
</defs>
<path id="puzzle-piece" class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg id="badge-state" width="32" height="32" x="32" y="0">
<path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg width="32" height="32" x="32" y="0">
<ellipse class="style-badge-shadow" rx="14" ry="15" cx="16" cy="17" />
<circle class="style-badge-background" r="15" cy="15" cx="16" />
<circle class="style-badge-inside" r="12" cy="15" cx="16" />
<path class="style-badge-icon" d="M14.9,16.2c0,0,0.1,0.8,1.1,0.8c1,0,1.1-0.8,1.1-0.8 s0.7-3.5,0.8-5.2C18,9.3,18.4,7,16,7s-2,2.4-1.9,4C14.2,12.7,14.9,16.2,14.9,16.2z M16,19c-1.1,0-2,0.9-2,2c0,1.1,0.9,2,2,2 c1.1,0,2-0.9,2-2C18,19.9,17.1,19,16,19z" />
</svg>
</svg>

До

Ширина:  |  Высота:  |  Размер: 2.2 KiB

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

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

@ -1,54 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="64"
height="64"
viewBox="0 0 64 64">
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="64" height="64" viewBox="0 0 64 64">
<defs>
<style type="text/css">
<![CDATA[
<style>
.style-puzzle-piece {
fill: url('#gradient-linear-puzzle-piece');
}
.style-badge-shadow {
fill: #0d131a;
fill: #0d131a;
fill-opacity: .15;
}
.style-badge-background {
fill: #fff;
fill: #fff;
}
.style-badge-inside {
fill: #55cc3d;
fill: #55cc3d;
}
.style-badge-icon {
fill: #fff;
fill: #fff;
}
]]>
</style>
<linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#66cc52" stop-opacity="1"/>
<stop offset="100%" stop-color="#60bf4c" stop-opacity="1"/>
</linearGradient>
</defs>
<path id="puzzle-piece" class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg id="badge-state" width="32" height="32" x="32" y="0">
<path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg width="32" height="32" x="32" y="0">
<ellipse class="style-badge-shadow" rx="14" ry="15" cx="16" cy="17" />
<circle class="style-badge-background" r="15" cy="15" cx="16" />
<circle class="style-badge-inside" r="12" cy="15" cx="16" />
<path class="style-badge-icon" d="M22.8,12.3c0,0-6.7,8.1-6.9,8.3c-0.4,0.5-1.5,0.3-1.7,0 c-0.2-0.3-5-5.8-5-5.8c-0.3-0.3-0.3-0.7,0-1l1-1c0.4-0.4,0.9,0,1.2,0.3c0.3,0.4,3.4,3.8,3.4,3.8s5.2-6.1,5.4-6.4 c0.5-0.8,1.6-0.8,1.9-0.5l0.7,0.6C23.1,11.1,23.1,12,22.8,12.3z" />
</svg>
</svg>

До

Ширина:  |  Высота:  |  Размер: 2.2 KiB

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

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

@ -1,64 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="64"
height="64"
viewBox="0 0 64 64">
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="64" height="64" viewBox="0 0 64 64">
<defs>
<style type="text/css">
<![CDATA[
<style>
.style-puzzle-piece {
fill: url('#gradient-linear-puzzle-piece');
fill-opacity: .25;
}
.style-puzzle-piece-outline {
fill: none;
stroke-width: 2;
stroke: #52b33e;
stroke-dasharray: 4 2;
}
.style-badge-shadow {
fill: #0d131a;
fill: #0d131a;
fill-opacity: .15;
}
.style-badge-background {
fill: #fff;
fill: #fff;
}
.style-badge-inside {
fill: #00a1e5;
fill: #00a1e5;
}
.style-badge-icon {
fill: #fff;
fill: #fff;
}
]]>
</style>
<linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#66cc52" stop-opacity="1"/>
<stop offset="100%" stop-color="#60bf4c" stop-opacity="1"/>
</linearGradient>
</defs>
<path id="puzzle-piece" class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<!-- <path id="puzzle-piece-outline" class="style-puzzle-piece-outline" d="M23.6,2.5c6.8,0,7.8,3.4,7.8,5.4c0,2.4-1.1,3.4-2.2,4.4c-0.8,0.7-1.6,1.5-1.6,2.7c0,2.8,3.7,3.5,3.9,3.5l0,0 h0H42c1.9,0,3.5,1.6,3.5,3.5l0,5.9c0,0.2,0.4,4.2,3.3,4.2c1.3,0,1.9-0.8,2.6-1.6c0.9-1,1.7-2.1,4.1-2.1c3.8,0,5.7,2.5,5.7,7.4 c0,2.3-0.6,7.7-5.7,7.7c-2.4,0-3.3-1.1-4.1-2.2c-0.7-0.8-1.3-1.7-2.6-1.7c-2.9,0-3.3,3.9-3.3,4.2l0,14.2c0,1.9-1.5,3.5-3.5,3.5 l-5.3,0c0,0-0.1,0-0.3,0c-4.9,0-5.4-2.8-5.4-3.9c0-1.2,0.7-2,1.6-2.9c1.1-1.1,2.3-2.4,2.3-4.7c0-2.4-2.9-5-7.1-5 c-3.3,0-6.9,1.9-6.9,5c0,2.4,1.2,3.6,2.3,4.7c0.9,0.9,1.6,1.7,1.6,2.9c0,1.2-0.5,3.9-5.4,3.9c-0.2,0-0.3,0-0.4,0H6 c-1.9,0-3.5-1.6-3.5-3.5l0-12.3c0,0-0.2-2.7,1.2-4.2c0.6-0.7,1.6-1.1,2.7-1.1c1.2,0,1.9,0.7,2.7,1.7c1,1.1,2.2,2.4,4.6,2.4 c3,0,4.5-3.4,4.5-6.8c0-4.5-2.3-6.5-4.5-6.5c-2.4,0-3.5,1.3-4.6,2.4c-0.8,0.9-1.5,1.7-2.7,1.7c-1.1,0-2-0.3-2.6-1 c-1.5-1.6-1.3-4.4-1.3-4.5l0-7.8c0-1.9,1.5-3.5,3.5-3.5h9.7h0l0,0c0.2,0,3.9-0.7,3.9-3.5c0-1.2-0.7-2-1.5-2.7c-0.9-0.9-2-2-2-4.4 C16.1,4.3,18.6,2.5,23.6,2.5"/> -->
<path id="puzzle-piece-outline" class="style-puzzle-piece-outline" d="M23.6,3c6.3,0,7.3,3,7.3,4.9c0,2.2-1,3.1-2,4c-0.8,0.8-1.8,1.6-1.8,3.1c0,2.6,2.7,3.7,4.3,4l0.1,0h0.1H42 c1.7,0,3,1.4,3,3v5.8v0l0,0c0.2,1.7,1.2,4.7,3.8,4.7c1.5,0,2.3-0.9,3-1.8c0.8-1,1.6-1.9,3.7-1.9c3.5,0,5.2,2.2,5.2,6.9 c0,6.2-3.2,7.2-5.2,7.2c-2.1,0-2.9-1-3.7-2c-0.7-0.9-1.5-1.9-3-1.9c-2.6,0-3.6,2.9-3.8,4.6l0,0l0,0L45,58c0,1.6-1.3,3-3,3h-5.2l0,0 l0,0c0,0-0.1,0-0.3,0c-4.5,0-4.9-2.4-4.9-3.4c0-1,0.5-1.6,1.5-2.6c1.1-1.1,2.4-2.5,2.4-5.1c0-3.3-3.9-5.5-7.6-5.5 c-4.6,0-7.4,2.8-7.4,5.5c0,2.6,1.4,4,2.5,5.1c1,1,1.5,1.6,1.5,2.6c0,3.1-3.4,3.4-4.9,3.4c-0.2,0-0.3,0-0.3,0l0,0h0H6 c-1.6,0-3-1.3-3-3l0-12.2l0,0l0,0c0,0-0.1-2.5,1.1-3.9c0.6-0.6,1.3-0.9,2.3-0.9c0.9,0,1.5,0.5,2.3,1.5c1,1.2,2.3,2.6,4.9,2.6 c3.3,0,5-3.6,5-7.3c0-3.4-1.6-7-5-7c-2.6,0-3.9,1.4-4.9,2.6c-0.9,1-1.4,1.5-2.3,1.5c-1,0-1.7-0.3-2.3-0.9C2.8,32.6,3,29.9,3,29.9 l0,0l0,0L3,22c0-1.7,1.3-3,3-3h9.7h0.1l0.1,0c1.6-0.3,4.3-1.4,4.3-4c0-1.4-0.9-2.3-1.6-3.1c-0.9-1-1.8-1.9-1.8-4.1 C16.6,4.6,18.9,3,23.6,3"/>
<svg id="badge-state" width="32" height="32" x="32" y="0">
<path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<path class="style-puzzle-piece-outline" d="M23.6,3c6.3,0,7.3,3,7.3,4.9c0,2.2-1,3.1-2,4c-0.8,0.8-1.8,1.6-1.8,3.1c0,2.6,2.7,3.7,4.3,4l0.1,0h0.1H42 c1.7,0,3,1.4,3,3v5.8v0l0,0c0.2,1.7,1.2,4.7,3.8,4.7c1.5,0,2.3-0.9,3-1.8c0.8-1,1.6-1.9,3.7-1.9c3.5,0,5.2,2.2,5.2,6.9 c0,6.2-3.2,7.2-5.2,7.2c-2.1,0-2.9-1-3.7-2c-0.7-0.9-1.5-1.9-3-1.9c-2.6,0-3.6,2.9-3.8,4.6l0,0l0,0L45,58c0,1.6-1.3,3-3,3h-5.2l0,0 l0,0c0,0-0.1,0-0.3,0c-4.5,0-4.9-2.4-4.9-3.4c0-1,0.5-1.6,1.5-2.6c1.1-1.1,2.4-2.5,2.4-5.1c0-3.3-3.9-5.5-7.6-5.5 c-4.6,0-7.4,2.8-7.4,5.5c0,2.6,1.4,4,2.5,5.1c1,1,1.5,1.6,1.5,2.6c0,3.1-3.4,3.4-4.9,3.4c-0.2,0-0.3,0-0.3,0l0,0h0H6 c-1.6,0-3-1.3-3-3l0-12.2l0,0l0,0c0,0-0.1-2.5,1.1-3.9c0.6-0.6,1.3-0.9,2.3-0.9c0.9,0,1.5,0.5,2.3,1.5c1,1.2,2.3,2.6,4.9,2.6 c3.3,0,5-3.6,5-7.3c0-3.4-1.6-7-5-7c-2.6,0-3.9,1.4-4.9,2.6c-0.9,1-1.4,1.5-2.3,1.5c-1,0-1.7-0.3-2.3-0.9C2.8,32.6,3,29.9,3,29.9 l0,0l0,0L3,22c0-1.7,1.3-3,3-3h9.7h0.1l0.1,0c1.6-0.3,4.3-1.4,4.3-4c0-1.4-0.9-2.3-1.6-3.1c-0.9-1-1.8-1.9-1.8-4.1 C16.6,4.6,18.9,3,23.6,3"/>
<svg width="32" height="32" x="32" y="0">
<ellipse class="style-badge-shadow" rx="14" ry="15" cx="16" cy="17" />
<circle class="style-badge-background" r="15" cy="15" cx="16" />
<circle class="style-badge-inside" r="12" cy="15" cx="16" />
<path class="style-badge-icon" d="M21,15h-6l2.4-2.4c-0.6-0.4-1.2-0.6-1.9-0.6c-2,0-3.5,1.6-3.5,3.5 c0,2,1.6,3.5,3.5,3.5c1,0,2-0.5,2.6-1.2l1.7,1c-1,1.3-2.6,2.1-4.3,2.1c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5 c1.3,0,2.4,0.4,3.3,1.2L21,9V15z"/>
</svg>
</svg>

До

Ширина:  |  Высота:  |  Размер: 4.4 KiB

После

Ширина:  |  Высота:  |  Размер: 3.3 KiB

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

@ -1,54 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="64"
height="64"
viewBox="0 0 64 64">
<!-- 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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="64" height="64" viewBox="0 0 64 64">
<defs>
<style type="text/css">
<![CDATA[
<style>
.style-puzzle-piece {
fill: url('#gradient-linear-puzzle-piece');
}
.style-badge-shadow {
fill: #0d131a;
fill: #0d131a;
fill-opacity: .15;
}
.style-badge-background {
fill: #fff;
fill: #fff;
}
.style-badge-inside {
fill: #ffcd02;
fill: #ffcd02;
}
.style-badge-icon {
fill: #fff;
fill: #fff;
}
]]>
</style>
<linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#999999" stop-opacity="1"/>
<stop offset="100%" stop-color="#8c8c8c" stop-opacity="1"/>
</linearGradient>
</defs>
<path id="puzzle-piece" class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg id="badge-state" width="32" height="32" x="32" y="0">
<path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
<svg width="32" height="32" x="32" y="0">
<path class="style-badge-shadow" d="M29.5,25.8L18.7,4c-0.6-1.2-1.6-2-2.7-2c-1.1,0-2.1,0.7-2.7,2L2.5,25.8 c-0.6,1.2-0.6,2.5-0.1,3.6C2.9,30.4,4,31,5.2,31h21.6c1.2,0,2.3-0.6,2.8-1.6C30.2,28.4,30.1,27.1,29.5,25.8z" />
<path class="style-badge-background" d="M16,0c-1.7,0-3.2,1-4.1,2.7L1.7,21.9c-0.9,1.7-0.9,3.4,0,4.8C2.5,28.2,4.1,29,5.9,29H26 c1.9,0,3.4-0.8,4.3-2.2c0.9-1.4,0.8-3.2,0-4.8L20.1,2.7C19.2,1,17.7,0,16,0L16,0z" />
<path class="style-badge-inside" d="M5.9,26c-1.7,0-2.4-1.2-1.6-2.7L14.6,4.1c0.8-1.5,2.1-1.5,2.8,0l10.3,19.3 c0.8,1.5,0.1,2.7-1.6,2.7H5.9z" />
<path class="style-badge-icon" d="M14.9,17.6c0,0,0.1,0.7,1.1,0.7c1,0,1.1-0.7,1.1-0.7 s0.7-2.9,0.8-4.2c0.1-1.3,0.5-3.2-1.9-3.2c-2.4,0-2,1.9-1.9,3.2C14.2,14.8,14.9,17.6,14.9,17.6z M16,20c-1.1,0-2,0.9-2,2 c0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C18,20.9,17.1,20,16,20z" />
</svg>
</svg>

До

Ширина:  |  Высота:  |  Размер: 2.5 KiB

После

Ширина:  |  Высота:  |  Размер: 2.5 KiB

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

@ -183,9 +183,9 @@ body {
.computedview-colorswatch {
border-radius: 50%;
width: 1em;
height: 1em;
vertical-align: text-top;
width: 0.9em;
height: 0.9em;
vertical-align: middle;
-moz-margin-end: 5px;
display: inline-block;
position: relative;

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

@ -1,3 +1,9 @@
<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<polygon fill="#EEF0F2" points="4,7 8,7 8,3 10,3 10,7 14,7 14,9 10,9 10,13 8,13 8,9 4,9 4,7"></polygon>
</svg>
<!-- 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/. -->
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g fill="#edf0f1">
<rect x="2" y="7" width="12" height="2" />
<rect x="7" y="2" width="2" height="12" />
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 220 B

После

Ширина:  |  Высота:  |  Размер: 467 B

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

@ -160,9 +160,9 @@
.ruleview-swatch {
cursor: pointer;
border-radius: 50%;
width: 1em;
height: 1em;
vertical-align: text-top;
width: 0.9em;
height: 0.9em;
vertical-align: middle;
-moz-margin-end: 5px;
display: inline-block;
position: relative;
@ -264,3 +264,8 @@
.ruleview-selectorhighlighter.highlighted {
background-position: -16px 0;
}
#ruleview-add-rule-button::before {
background-image: url("chrome://browser/skin/devtools/add.svg");
background-size: cover;
}

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

@ -339,10 +339,6 @@
list-style-image: url(chrome://global/skin/icons/question-32.png);
}
#addons-notification-icon {
list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric.png);
}
#login-fill-notification-icon,
#password-notification-icon {
list-style-image: url(chrome://mozapps/skin/passwordmgr/key-16@2x.png);

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

@ -2,13 +2,16 @@
* 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/. */
@import url("chrome://global/skin/inContentUI.css");
@import url("chrome://global/skin/in-content/common.css");
#permissions-content {
padding-top: 48px;
-moz-padding-end: 0; /* no padding to move the scroll bar to the edge */
}
/* sites box */
#sites-box {
padding: 10px;
width: 25em;
}
@ -17,9 +20,6 @@
}
#sites-list {
-moz-appearance: none;
border: 1px solid rgba(0, 0, 0, 0.32);
background-color: rgba(255, 255, 255, 0.4);
margin: 5px 0 0 0;
}
@ -42,13 +42,17 @@
/* permissions box */
#permissions-box {
padding-top: 10px;
-moz-padding-start: 10px;
}
#permissions-list {
overflow-y: auto;
padding-top: 5px;
-moz-padding-end: 44px;
}
#site-description {
font-size: 125%;
-moz-margin-start: 6px; /* to match button margin */
}
#site-label {
@ -57,10 +61,22 @@
margin-bottom: 0;
}
#site-visit-count {
margin-bottom: 0;
}
#defaults-description {
font-size: 125%;
font-weight: bold;
-moz-margin-start: 6px;
}
#header-deck {
-moz-margin-end: 44px;
}
#site-header,
#defaults-header {
margin-bottom: 1px;
}
.pref-item {
@ -112,12 +128,16 @@
.pref-title {
font-size: 125%;
-moz-margin-start: 4px;
margin-bottom: 0;
font-weight: bold;
}
.pref-menulist {
margin-left: 6px;
margin-right: 6px;
min-width: 10em; /* native menulists ellipsize their longest entries by default on many themes */
min-width: 10em;
}
#cookies-label,
#passwords-label {
-moz-margin-start: 4px; /* align with the menulists */
}

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

@ -600,6 +600,10 @@ IsOnFullDomainWhitelist(nsIURI* aURI)
NS_LITERAL_CSTRING("mw.nikkei.com"),
NS_LITERAL_CSTRING("www.nhk.or.jp"),
NS_LITERAL_CSTRING("www.tokyo-sports.co.jp"),
NS_LITERAL_CSTRING("www.bellemaison.jp"),
NS_LITERAL_CSTRING("www.kuronekoyamato.co.jp"),
NS_LITERAL_CSTRING("s.tsite.jp"),
NS_LITERAL_CSTRING("formassist.jp"), // for orico.jp
};
static const size_t sNumFullDomainsOnWhitelist =
MOZ_ARRAY_LENGTH(sFullDomainsOnWhitelist);

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

@ -69,7 +69,7 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../shistory/src',
'/docshell/shistory',
'/dom/base',
'/layout/base',
'/layout/generic',

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

@ -13,12 +13,12 @@ SOURCES += [
]
LOCAL_INCLUDES += [
'../base',
'../shistory/src/',
'/docshell/base',
'/docshell/shistory',
'/uriloader/base',
'/uriloader/exthandler',
'/uriloader/prefetch',
]
]
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
LOCAL_INCLUDES += ['/uriloader/exthandler/mac']

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

@ -4,5 +4,33 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ['public', 'src']
XPIDL_SOURCES += [
'nsIBFCacheEntry.idl',
'nsISHContainer.idl',
'nsISHEntry.idl',
'nsISHistory.idl',
'nsISHistoryInternal.idl',
'nsISHistoryListener.idl',
'nsISHTransaction.idl',
]
XPIDL_MODULE = 'shistory'
EXPORTS += [
'nsSHEntryShared.h',
]
UNIFIED_SOURCES += [
'nsSHEntry.cpp',
'nsSHEntryShared.cpp',
'nsSHistory.cpp',
'nsSHTransaction.cpp',
]
FAIL_ON_WARNINGS = True
LOCAL_INCLUDES += [
'/docshell/base',
]
FINAL_LIBRARY = 'xul'

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

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

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

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

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

@ -1,18 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
XPIDL_SOURCES += [
'nsIBFCacheEntry.idl',
'nsISHContainer.idl',
'nsISHEntry.idl',
'nsISHistory.idl',
'nsISHistoryInternal.idl',
'nsISHistoryListener.idl',
'nsISHTransaction.idl',
]
XPIDL_MODULE = 'shistory'

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

@ -1,24 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
EXPORTS += [
'nsSHEntryShared.h',
]
UNIFIED_SOURCES += [
'nsSHEntry.cpp',
'nsSHEntryShared.cpp',
'nsSHistory.cpp',
'nsSHTransaction.cpp',
]
FAIL_ON_WARNINGS = True
LOCAL_INCLUDES += [
'/docshell/base',
]
FINAL_LIBRARY = 'xul'

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

@ -423,7 +423,7 @@ LOCAL_INCLUDES += [
'/dom/xslt/xpath',
'/dom/xul',
'/gfx/2d',
'/image/src',
'/image',
'/js/xpconnect/src',
'/js/xpconnect/wrappers',
'/layout/base',

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

@ -44,7 +44,7 @@ var testData = {
'crossorigin': 'origin',
'downgrade': 'origin' }},
'origin-when-crossorigin': { 'csp': "script-src * 'unsafe-inline'; referrer origin-when-crossorigin",
'origin-when-cross-origin': { 'csp': "script-src * 'unsafe-inline'; referrer origin-when-cross-origin",
'expected': { 'sameorigin': 'full',
'crossorigin': 'origin',
'downgrade': 'origin' }},

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

@ -242,6 +242,7 @@ support-files =
w3element_traversal.svg
wholeTexty-helper.xml
file_nonascii_blob_url.html
referrerHelper.js
[test_anonymousContent_api.html]
[test_anonymousContent_append_after_reflow.html]
@ -613,6 +614,7 @@ skip-if = buildapp == 'b2g'
[test_bug704320.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g (Needs multiple window.open support) android(times out, bug 1100609) e10s(randomly fails, bug 1100362)
[test_bug704320_policyset.html]
support-files = referrerHelper.js
[test_bug704320_preload.html]
[test_bug707142.html]
[test_bug708620.html]
@ -665,6 +667,8 @@ skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e1
[test_bug1075702.html]
[test_bug1101364.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android'
[test_bug1163743.html]
support-files = referrerHelper.js
[test_caretPositionFromPoint.html]
[test_classList.html]
# This test fails on the Mac for some reason

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

@ -0,0 +1,76 @@
/**
* Listen for notifications from the child.
* These are sent in case of error, or when the loads we await have completed.
*/
window.addEventListener("message", function(event) {
if (event.data == "childLoadComplete") {
// all loads happen, continue the test.
advance();
} else if (event.data == "childOverload") {
// too many loads happened in a test frame, abort.
ok(false, "Too many load handlers called in test.");
SimpleTest.finish();
} else if (event.data.indexOf("fail-") == 0) {
// something else failed in the test frame, abort.
ok(false, "Child failed the test with error " + event.data.substr(5));
SimpleTest.finish();
}});
/**
* helper to perform an XHR.
* Used by resetCounter() and checkResults().
*/
function doXHR(url, onSuccess, onFail) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
if (xhr.status == 200) {
onSuccess(xhr);
} else {
onFail(xhr);
}
};
xhr.open('GET', url, true);
xhr.send(null);
}
/**
* This triggers state-resetting on the counter server.
*/
function resetCounter() {
doXHR('/tests/dom/base/test/bug704320_counter.sjs?reset',
advance,
function(xhr) {
ok(false, "Need to be able to reset the request counter");
SimpleTest.finish();
});
}
/**
* Grabs the results via XHR and passes to checker.
*/
function checkResults(testname, expected) {
doXHR('/tests/dom/base/test/bug704320_counter.sjs?results',
function(xhr) {
var results = JSON.parse(xhr.responseText);
info(xhr.responseText);
ok('img' in results,
testname + " test: some image loads required in results object.");
is(results['img'].count, 2,
testname + " Test: Expected 2 loads for image requests.");
expected.forEach(function (ref) {
ok(results['img'].referrers.indexOf(ref) >= 0,
testname + " Test: Expected " + ref + " referrer policy in test, results were " +
JSON.stringify(results['img'].referrers) +".");
});
advance();
},
function(xhr) {
ok(false, "Can't get results from the counter server.");
SimpleTest.finish();
});
}

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

@ -5,7 +5,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1091883
-->
<head>
<meta charset="utf-8">
<meta name="referrer" content="origin-when-crossorigin">
<meta name="referrer" content="origin-when-cross-origin">
<title>Test for Bug 1091883</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
@ -26,7 +26,7 @@ var numOrigins = origins.length;
// includes a "frame" that includes a "subframe"; and then this test
// navigates this "subframe" to the "target". Both the referrer and
// the triggering principal are this test, i.e., "http://mochi.test:8888".
// Since the referrer policy is origin-when-crossorigin, we expect to have
// Since the referrer policy is origin-when-cross-origin, we expect to have
// a full referrer if and only if the target is also "http://mochi.test:8888";
// in all other cases, the referrer needs to be the origin alone.
var numTests = numOrigins * numOrigins * numOrigins;

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

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<!--
This checks if the origin-when-crossorigin policy works.
https://bugzilla.mozilla.org/show_bug.cgi?id=1163743
-->
<head>
<meta charset="utf-8">
<title>Test policies for Bug 1163743</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="referrerHelper.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript;version=1.7">
SimpleTest.waitForExplicitFinish();
var advance = function() { tests.next(); };
/**
* testing legacy support for origin-when-crossorigin (1163743)
*/
var tests = (function() {
var iframe = document.getElementById("testframe");
const sjs = "/tests/dom/base/test/bug704320.sjs?action=generate-policy-test";
// origin when crossorigin (trimming whitespace)
yield resetCounter();
yield iframe.src = sjs + "&policy=" + escape(' origin-when-crossorigin');
yield checkResults("origin-when-cross-origin", ["origin", "full"]);
// complete. Be sure to yield so we don't call this twice.
yield SimpleTest.finish();
})();
</script>
</head>
<body onload="tests.next();">
<iframe id="testframe"></iframe>
</body>
</html>

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

@ -26,25 +26,25 @@ var testIframeUrls = [
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-crossorigin',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin',
// HTTP to HTTPS
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=origin',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=origin-when-crossorigin',
'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=origin-when-cross-origin',
// HTTPS to HTTP
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=no-referrer-when-downgrade',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=no-referrer',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=origin',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=origin-when-crossorigin',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=origin-when-cross-origin',
// HTTPS to HTTPS
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin',
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-crossorigin'
'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin'
];
var expectedResults = {
@ -58,14 +58,14 @@ var expectedResults = {
'no-referrer': '',
'unsafe-url': '',
'origin': '',
'origin-when-crossorigin': '',
'origin-when-cross-origin': '',
'no-referrer-when-downgrade': ''
},
'http-to-https': {
'no-referrer': '',
'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
'origin': 'http://example.com',
'origin-when-crossorigin': 'http://example.com',
'origin-when-cross-origin': 'http://example.com',
'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade'
},
// Encrypted and not same-origin
@ -73,7 +73,7 @@ var expectedResults = {
'no-referrer': '',
'unsafe-url': '',
'origin': '',
'origin-when-crossorigin': '',
'origin-when-cross-origin': '',
'no-referrer-when-downgrade': ''
},
// Encrypted
@ -81,7 +81,7 @@ var expectedResults = {
'no-referrer': '',
'unsafe-url': '',
'origin': '',
'origin-when-crossorigin': '',
'origin-when-cross-origin': '',
'no-referrer-when-downgrade': ''
}
},
@ -91,28 +91,28 @@ var expectedResults = {
'no-referrer': '',
'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url&type=form',
'origin': 'http://example.com',
'origin-when-crossorigin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-crossorigin&type=form',
'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin&type=form',
'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade&type=form'
},
'http-to-https': {
'no-referrer': '',
'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url&type=form',
'origin': 'http://example.com',
'origin-when-crossorigin': 'http://example.com',
'origin-when-cross-origin': 'http://example.com',
'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade&type=form'
},
'https-to-http': {
'no-referrer': '',
'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url&type=form',
'origin': 'https://example.com',
'origin-when-crossorigin': 'https://example.com',
'origin-when-cross-origin': 'https://example.com',
'no-referrer-when-downgrade': ''
},
'https-to-https': {
'no-referrer': '',
'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url&type=form',
'origin': 'https://example.com',
'origin-when-crossorigin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-crossorigin&type=form',
'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin&type=form',
'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade&type=form'
}
},
@ -122,28 +122,28 @@ var expectedResults = {
'no-referrer': '',
'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url&type=window.location',
'origin': 'http://example.com',
'origin-when-crossorigin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-crossorigin&type=window.location',
'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin&type=window.location',
'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade&type=window.location'
},
'http-to-https': {
'no-referrer': '',
'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url&type=window.location',
'origin': 'http://example.com',
'origin-when-crossorigin': 'http://example.com',
'origin-when-cross-origin': 'http://example.com',
'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade&type=window.location'
},
'https-to-http': {
'no-referrer': '',
'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url&type=window.location',
'origin': 'https://example.com',
'origin-when-crossorigin': 'https://example.com',
'origin-when-cross-origin': 'https://example.com',
'no-referrer-when-downgrade': ''
},
'https-to-https': {
'no-referrer': '',
'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url&type=window.location',
'origin': 'https://example.com',
'origin-when-crossorigin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-crossorigin&type=window.location',
'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin&type=window.location',
'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-2nd-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade&type=window.location'
}
},
@ -152,28 +152,28 @@ var expectedResults = {
'no-referrer': '',
'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=unsafe-url',
'origin': 'http://example.com',
'origin-when-crossorigin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-crossorigin',
'origin-when-cross-origin': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=origin-when-cross-origin',
'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=http&policy=no-referrer-when-downgrade'
},
'http-to-https': {
'no-referrer': '',
'unsafe-url': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=unsafe-url',
'origin': 'http://example.com',
'origin-when-crossorigin': 'http://example.com',
'origin-when-cross-origin': 'http://example.com',
'no-referrer-when-downgrade': 'http://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=http&scheme-to=https&policy=no-referrer-when-downgrade'
},
'https-to-http': {
'no-referrer': '',
'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=http&policy=unsafe-url',
'origin': 'https://example.com',
'origin-when-crossorigin': 'https://example.com',
'origin-when-cross-origin': 'https://example.com',
'no-referrer-when-downgrade': ''
},
'https-to-https': {
'no-referrer': '',
'unsafe-url': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=unsafe-url',
'origin': 'https://example.com',
'origin-when-crossorigin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-crossorigin',
'origin-when-cross-origin': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=origin-when-cross-origin',
'no-referrer-when-downgrade': 'https://example.com/tests/dom/base/test/bug704320.sjs?action=create-1st-level-iframe&scheme-from=https&scheme-to=https&policy=no-referrer-when-downgrade'
}
}

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

@ -9,6 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=704320
<meta charset="utf-8">
<title>Test policies for Bug 704320</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="referrerHelper.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript;version=1.7">
@ -16,24 +17,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=704320
SimpleTest.waitForExplicitFinish();
var advance = function() { tests.next(); };
/**
* Listen for notifications from the child.
* These are sent in case of error, or when the loads we await have completed.
*/
window.addEventListener("message", function(event) {
if (event.data == "childLoadComplete") {
// all loads happen, continue the test.
advance();
} else if (event.data == "childOverload") {
// too many loads happened in a test frame, abort.
ok(false, "Too many load handlers called in test.");
SimpleTest.finish();
} else if (event.data.indexOf("fail-") == 0) {
// something else failed in the test frame, abort.
ok(false, "Child failed the test with error " + event.data.substr(5));
SimpleTest.finish();
}});
/**
* This is the main test routine -- serialized by use of a generator.
* It resets the counter, then performs two tests in sequence using
@ -82,8 +65,8 @@ var tests = (function() {
// origin when cross-origin (trimming whitespace)
yield resetCounter();
yield iframe.src = sjs + "&policy=" + escape(' origin-when-crossorigin');
yield checkResults("origin-when-crossorigin", ["origin", "full"]);
yield iframe.src = sjs + "&policy=" + escape(' origin-when-cross-origin');
yield checkResults("origin-when-cross-origin", ["origin", "full"]);
// according to the spec section 4.1:
// "If the meta element lacks a content attribute, or if that attributes
@ -109,65 +92,6 @@ var tests = (function() {
yield SimpleTest.finish();
})();
// Helper functions below.
/**
* helper to perform an XHR.
* Used by resetCounter() and checkResults().
*/
function doXHR(url, onSuccess, onFail) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
if (xhr.status == 200) {
onSuccess(xhr);
} else {
onFail(xhr);
}
};
xhr.open('GET', url, true);
xhr.send(null);
}
/**
* This triggers state-resetting on the counter server.
*/
function resetCounter() {
doXHR('/tests/dom/base/test/bug704320_counter.sjs?reset',
advance,
function(xhr) {
ok(false, "Need to be able to reset the request counter");
SimpleTest.finish();
});
}
/**
* Grabs the results via XHR and passes to checker.
*/
function checkResults(testname, expected) {
doXHR('/tests/dom/base/test/bug704320_counter.sjs?results',
function(xhr) {
var results = JSON.parse(xhr.responseText);
info(xhr.responseText);
ok('img' in results,
testname + " test: some image loads required in results object.");
is(results['img'].count, 2,
testname + " Test: Expected 2 loads for image requests.");
expected.forEach(function (ref) {
ok(results['img'].referrers.indexOf(ref) >= 0,
testname + " Test: Expected " + ref + " referrer policy in test, results were " +
JSON.stringify(results['img'].referrers) +".");
});
advance();
},
function(xhr) {
ok(false, "Can't get results from the counter server.");
SimpleTest.finish();
});
}
</script>
</head>

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

@ -53,8 +53,7 @@ const browserElementTestHelpers = {
['dom.ipc.processPriorityManager.BACKGROUND.LRUPoolLevels', 2],
['dom.ipc.processPriorityManager.FOREGROUND.LRUPoolLevels', 2],
['dom.ipc.processPriorityManager.testMode', true],
['dom.ipc.processPriorityManager.enabled', true],
['dom.ipc.processCount', 3]
['dom.ipc.processPriorityManager.enabled', true]
);
},
@ -229,43 +228,6 @@ function expectPriorityWithLRUSet(childID, expectedPriority, expectedLRU) {
});
}
// Returns a promise which is resolved or rejected the next time the process
// childID delays its priority change. We resolve if the priority matches
// expectedPriority, and we reject otherwise.
function expectPriorityDelay(childID, expectedPriority) {
return new Promise(function(resolve, reject) {
var observed = false;
browserElementTestHelpers.addProcessPriorityObserver(
'process-priority-delayed',
function(subject, topic, data) {
if (observed) {
return;
}
var [id, priority] = data.split(":");
if (id != childID) {
return;
}
// Make sure we run the is() calls in this observer only once, otherwise
// we'll expect /every/ priority change to match expectedPriority.
observed = true;
is(priority, expectedPriority,
'Expected delayed priority change of childID ' + childID +
' to ' + expectedPriority);
if (priority == expectedPriority) {
resolve();
} else {
reject();
}
}
);
});
}
// Returns a promise which is resolved the first time the given iframe fires
// the mozbrowser##eventName event.
function expectMozbrowserEvent(iframe, eventName) {

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

@ -27,4 +27,3 @@ support-files = file_NestedFramesOuter.html
[test_WebGLContextLost.html]
disabled = bug 865844
support-files = file_WebGLContextLost.html
[test_DelayedBackgroundTransition.html]

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

@ -18,17 +18,6 @@ browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
browserElementTestHelpers.enableProcessPriorityManager();
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', true);
@ -62,7 +51,7 @@ function runTest() {
// service. This is controled by the media.useAudioChannelService pref.
addEventListener('testready', function() {
SpecialPowers.pushPrefEnv({set: [['media.useAudioChannelService', true]]},
setupTest);
runTest);
});
</script>

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

@ -19,17 +19,6 @@ browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
browserElementTestHelpers.enableProcessPriorityManager();
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', true);
@ -58,7 +47,7 @@ function runTest() {
document.body.appendChild(iframe);
}
addEventListener('testready', setupTest);
addEventListener('testready', runTest);
</script>
</body>

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

@ -20,17 +20,6 @@ browserElementTestHelpers.addPermission();
browserElementTestHelpers.enableProcessPriorityManager();
SpecialPowers.addPermission("embed-apps", true, document);
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
var iframe1 = document.createElement('iframe');
iframe1.setAttribute('mozbrowser', true);
@ -79,7 +68,7 @@ function runTest() {
document.body.appendChild(iframe1);
}
addEventListener('testready', setupTest);
addEventListener('testready', runTest);
</script>
</body>

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

@ -1,61 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
Test that a process won't transit to BACKGROUND priority unless
there is at least one FOREGROUND process.
-->
<head>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="../browserElementTestHelpers.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script type="application/javascript;version=1.7">
"use strict";
SimpleTest.waitForExplicitFinish();
browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
browserElementTestHelpers.enableProcessPriorityManager();
function insertForegroundFrame() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.setAttribute('id', 'foreground');
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend');
document.body.appendChild(foreground);
}
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', true);
iframe.src = browserElementTestHelpers.emptyPage;
var childID = null;
Promise.all([
expectProcessCreated('FOREGROUND').then(function(chid) {
childID = chid;
}),
expectMozbrowserEvent(iframe, 'loadend')
]).then(function() {
var p = expectPriorityDelay(childID, 'BACKGROUND');
iframe.setVisible(false);
return p;
}).then(function() {
var p = expectPriorityChange(childID, 'BACKGROUND');
insertForegroundFrame();
return p;
}).then(function() {
var p = expectPriorityChange(childID, 'FOREGROUND');
iframe.setVisible(true);
return p;
}).then(SimpleTest.finish);
document.body.appendChild(iframe);
}
addEventListener('testready', runTest);
</script>
</body>
</html>

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

@ -33,17 +33,6 @@ addEventListener('unload', function() {
isInBrowserElement: true });
});
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', true);
@ -73,7 +62,7 @@ addEventListener('testready', function() {
// set the timeout to a large value.
SpecialPowers.pushPrefEnv(
{set: [["dom.ipc.systemMessageCPULockTimeoutSec", 99999]]},
setupTest);
runTest);
});
</script>

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

@ -19,17 +19,6 @@ browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
browserElementTestHelpers.enableProcessPriorityManager();
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', true);
@ -59,7 +48,7 @@ function runTest() {
document.body.appendChild(iframe);
}
addEventListener('testready', setupTest);
addEventListener('testready', runTest);
</script>
</body>

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

@ -19,17 +19,6 @@ browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
browserElementTestHelpers.enableProcessPriorityManager();
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', true);
@ -64,7 +53,7 @@ function runTest() {
document.body.appendChild(iframe);
}
addEventListener('testready', setupTest);
addEventListener('testready', runTest);
</script>
</body>
</html>

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

@ -32,17 +32,6 @@ addEventListener('unload', function() {
isInBrowserElement: true });
});
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
// Set up the following hierarchy of frames:
//
@ -80,7 +69,7 @@ function runTest() {
document.body.appendChild(iframe);
}
addEventListener('testready', setupTest);
addEventListener('testready', runTest);
</script>
</body>

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

@ -18,17 +18,6 @@ browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
browserElementTestHelpers.enableProcessPriorityManager();
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', true);
@ -57,7 +46,7 @@ function runTest() {
document.body.appendChild(iframe);
}
addEventListener('testready', setupTest);
addEventListener('testready', runTest);
</script>
</body>
</html>

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

@ -19,17 +19,6 @@ browserElementTestHelpers.setEnabledPref(true);
browserElementTestHelpers.addPermission();
browserElementTestHelpers.enableProcessPriorityManager();
// ProcessPriorityManager requires at least one process in foreground
// so that other processes can transit freely between foreground and
// background.
function setupTest() {
var foreground = document.createElement('iframe');
foreground.setAttribute('mozbrowser', true);
foreground.src = browserElementTestHelpers.emptyPage;
expectMozbrowserEvent(foreground, 'loadend').then(runTest);
document.body.appendChild(foreground);
}
function runTest() {
var iframe = document.createElement('iframe');
iframe.setAttribute('mozbrowser', true);
@ -102,7 +91,7 @@ addEventListener('testready', function() {
// shouldn't hurt things, and anyway this setting mirrors what we do on B2G,
// which is what we're trying to test!
SpecialPowers.pushPrefEnv({set: [["webgl.force-enabled", true]]},
setupTest);
runTest);
});
</script>

2
dom/cache/QuotaClient.cpp поставляемый
Просмотреть файл

@ -110,7 +110,7 @@ public:
InitOrigin(PersistenceType aPersistenceType, const nsACString& aGroup,
const nsACString& aOrigin, UsageInfo* aUsageInfo) override
{
return NS_OK;
return GetUsageForOrigin(aPersistenceType, aGroup, aOrigin, aUsageInfo);
}
virtual nsresult

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

@ -310,6 +310,8 @@ public:
bool IsPremultAlpha() const { return mOptions.premultipliedAlpha; }
bool IsPreservingDrawingBuffer() const { return mOptions.preserveDrawingBuffer; }
bool PresentScreenBuffer();
// a number that increments every time we have an event that causes

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

@ -142,7 +142,7 @@ LOCAL_INCLUDES += [
'/dom/svg',
'/dom/xul',
'/gfx/gl',
'/image/src',
'/image',
'/js/xpconnect/src',
'/layout/generic',
'/layout/style',

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

@ -0,0 +1,174 @@
/* 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";
/*
* Util base class to help test a captured canvas element. Initializes the
* output canvas (used for testing the color of video elements), and optionally
* overrides the default element |width| and |height|.
*/
function CaptureStreamTestHelper(width, height) {
this.cout = document.createElement('canvas');
if (width) {
this.elemWidth = width;
}
if (height) {
this.elemHeight = height;
}
this.cout.width = this.elemWidth;
this.cout.height = this.elemHeight;
document.body.appendChild(this.cout);
}
CaptureStreamTestHelper.prototype = {
/* Predefined colors for use in the methods below. */
black: { data: [0, 0, 0, 255], name: "black" },
green: { data: [0, 255, 0, 255], name: "green" },
red: { data: [255, 0, 0, 255], name: "red" },
/* Default element size for createAndAppendElement() */
elemWidth: 100,
elemHeight: 100,
/* Request a frame from the stream played by |video|. */
requestFrame: function (video) {
info("Requesting frame from " + video.id);
video.mozSrcObject.requestFrame();
},
/* Tests the top left pixel of |video| against |refData|. Format [R,G,B,A]. */
testPixel: function (video, refData, threshold) {
var ctxout = this.cout.getContext('2d');
ctxout.drawImage(video, 0, 0);
var pixel = ctxout.getImageData(0, 0, 1, 1).data;
return pixel.every((val, i) => Math.abs(val - refData[i]) <= threshold);
},
/*
* Returns a promise that resolves when the pixel matches. Use |threshold|
* for fuzzy matching the color on each channel, in the range [0,255].
*/
waitForPixel: function (video, refColor, threshold, infoString) {
return new Promise(resolve => {
info("Testing " + video.id + " against [" + refColor.data.join(',') + "]");
CaptureStreamTestHelper2D.prototype.clear.call(this, this.cout);
video.ontimeupdate = () => {
if (this.testPixel(video, refColor.data, threshold)) {
ok(true, video.id + " " + infoString);
video.ontimeupdate = null;
resolve();
}
};
});
},
/*
* Returns a promise that resolves after |timeout| ms of playback or when a
* pixel of |video| becomes the color |refData|. The test is failed if the
* timeout is not reached.
*/
waitForPixelToTimeout: function (video, refColor, threshold, timeout, infoString) {
return new Promise(resolve => {
info("Waiting for " + video.id + " to time out after " + timeout +
"ms against [" + refColor.data.join(',') + "] - " + refColor.name);
CaptureStreamTestHelper2D.prototype.clear.call(this, this.cout);
var startTime = video.currentTime;
video.ontimeupdate = () => {
if (this.testPixel(video, refColor.data, threshold)) {
ok(false, video.id + " " + infoString);
video.ontimeupdate = null;
resolve();
} else if (video.currentTime > startTime + (timeout / 1000.0)) {
ok(true, video.id + " " + infoString);
video.ontimeupdate = null;
resolve();
}
};
});
},
/* Create an element of type |type| with id |id| and append it to the body. */
createAndAppendElement: function (type, id) {
var e = document.createElement(type);
e.id = id;
e.width = this.elemWidth;
e.height = this.elemHeight;
if (type === 'video') {
e.autoplay = true;
}
document.body.appendChild(e);
return e;
},
}
/* Sub class holding 2D-Canvas specific helpers. */
function CaptureStreamTestHelper2D(width, height) {
CaptureStreamTestHelper.call(this, width, height);
}
CaptureStreamTestHelper2D.prototype = Object.create(CaptureStreamTestHelper.prototype);
CaptureStreamTestHelper2D.prototype.constructor = CaptureStreamTestHelper2D;
/* Clear all drawn content on |canvas|. */
CaptureStreamTestHelper2D.prototype.clear = function(canvas) {
var ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
};
/* Draw the color |color| to the source canvas |canvas|. Format [R,G,B,A]. */
CaptureStreamTestHelper2D.prototype.drawColor = function(canvas, color) {
var ctx = canvas.getContext('2d');
var rgba = color.data.slice(); // Copy to not overwrite the original array
info("Drawing color " + rgba.join(','));
rgba[3] = rgba[3] / 255.0; // Convert opacity to double in range [0,1]
ctx.fillStyle = "rgba(" + rgba.join(',') + ")";
// Only fill top left corner to test that output is not flipped or rotated.
ctx.fillRect(0, 0, canvas.width / 2, canvas.height / 2);
};
/* Test that the given 2d canvas is NOT origin-clean. */
CaptureStreamTestHelper2D.prototype.testNotClean = function(canvas) {
var ctx = canvas.getContext('2d');
var error = "OK";
try {
var data = ctx.getImageData(0, 0, 1, 1);
} catch(e) {
error = e.name;
}
is(error, "SecurityError",
"Canvas '" + canvas.id + "' should not be origin-clean");
};
/* Sub class holding WebGL specific helpers. */
function CaptureStreamTestHelperWebGL(width, height) {
CaptureStreamTestHelper.call(this, width, height);
}
CaptureStreamTestHelperWebGL.prototype = Object.create(CaptureStreamTestHelper.prototype);
CaptureStreamTestHelperWebGL.prototype.constructor = CaptureStreamTestHelperWebGL;
/* Set the (uniform) color location for future draw calls. */
CaptureStreamTestHelperWebGL.prototype.setFragmentColorLocation = function(colorLocation) {
this.colorLocation = colorLocation;
};
/* Clear the given WebGL context with |color|. */
CaptureStreamTestHelperWebGL.prototype.clearColor = function(canvas, color) {
info("WebGL: clearColor(" + color.name + ")");
var gl = canvas.getContext('webgl');
var conv = color.data.map(i => i / 255.0);
gl.clearColor(conv[0], conv[1], conv[2], conv[3]);
gl.clear(gl.COLOR_BUFFER_BIT);
};
/* Set an already setFragmentColorLocation() to |color| and drawArrays() */
CaptureStreamTestHelperWebGL.prototype.drawColor = function(canvas, color) {
info("WebGL: drawArrays(" + color.name + ")");
var gl = canvas.getContext('webgl');
var conv = color.data.map(i => i / 255.0);
gl.uniform4f(this.colorLocation, conv[0], conv[1], conv[2], conv[3]);
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
};

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

@ -73,6 +73,17 @@ function testImage(url, crossOriginAttribute, expected_error) {
"drawImage then get image data on " + url +
" with crossOrigin=" + this.crossOrigin);
try {
c.captureStream(0);
actual_error = OK;
} catch (e) {
actual_error = e.name;
}
verifyError(actual_error, expected_error,
"drawImage then capture stream on " + url +
" with crossOrigin=" + this.crossOrigin);
// Now test patterns
c = document.createElement("canvas");
c.width = this.width;
@ -91,6 +102,17 @@ function testImage(url, crossOriginAttribute, expected_error) {
"createPattern+fill then get image data on " + url +
" with crossOrigin=" + this.crossOrigin);
try {
c.captureStream(0);
actual_error = OK;
} catch (e) {
actual_error = e.name;
}
verifyError(actual_error, expected_error,
"createPattern+fill then capture stream on " + url +
" with crossOrigin=" + this.crossOrigin);
testDone();
};
@ -130,56 +152,64 @@ const attrValues = [
[ "foobar", "anonymous" ]
];
for (var imgIdx = 0; imgIdx < imageFiles.length; ++imgIdx) {
for (var hostnameIdx = 0; hostnameIdx < hostnames.length; ++hostnameIdx) {
var hostnameData = hostnames[hostnameIdx];
var url = "http://" + hostnameData[0] + testPath + imageFiles[imgIdx][0];
for (var attrValIdx = 0; attrValIdx < attrValues.length; ++attrValIdx) {
var attrValData = attrValues[attrValIdx];
// Now compute the expected result
var expected_error;
if (hostnameData[1] == "same-origin") {
// Same-origin; these should all Just Work
expected_error = OK;
} else {
// Cross-origin
is(hostnameData[1], "cross-origin",
"what sort of host is " + hostnameData[0]);
var CORSMode = attrValData[1];
if (CORSMode == "none") {
// Doesn't matter what headers the server sends; we're not
// using CORS on our end.
expected_error = "SecurityError";
function beginTest() {
for (var imgIdx = 0; imgIdx < imageFiles.length; ++imgIdx) {
for (var hostnameIdx = 0; hostnameIdx < hostnames.length; ++hostnameIdx) {
var hostnameData = hostnames[hostnameIdx];
var url = "http://" + hostnameData[0] + testPath + imageFiles[imgIdx][0];
for (var attrValIdx = 0; attrValIdx < attrValues.length; ++attrValIdx) {
var attrValData = attrValues[attrValIdx];
// Now compute the expected result
var expected_error;
if (hostnameData[1] == "same-origin") {
// Same-origin; these should all Just Work
expected_error = OK;
} else {
// Check whether the server will let us talk to them
var CORSHeaders = imageFiles[imgIdx][1];
// We're going to look for CORS headers from the server
if (CORSHeaders == "none") {
// No CORS headers from server; load will fail.
expected_error = BAD_URI_ERR;
} else if (CORSHeaders == "allow-all-anon") {
// Server only allows anonymous requests
if (CORSMode == "anonymous") {
expected_error = OK;
} else {
is(CORSMode, "use-credentials",
"What other CORS modes are there?");
// A load with credentials against a server that only
// allows anonymous loads will fail.
expected_error = BAD_URI_ERR;
}
// Cross-origin
is(hostnameData[1], "cross-origin",
"what sort of host is " + hostnameData[0]);
var CORSMode = attrValData[1];
if (CORSMode == "none") {
// Doesn't matter what headers the server sends; we're not
// using CORS on our end.
expected_error = "SecurityError";
} else {
is(CORSHeaders, "allow-single-server-creds",
"What other CORS headers could there be?");
// Our server should allow both anonymous and non-anonymous requests
expected_error = OK;
// Check whether the server will let us talk to them
var CORSHeaders = imageFiles[imgIdx][1];
// We're going to look for CORS headers from the server
if (CORSHeaders == "none") {
// No CORS headers from server; load will fail.
expected_error = BAD_URI_ERR;
} else if (CORSHeaders == "allow-all-anon") {
// Server only allows anonymous requests
if (CORSMode == "anonymous") {
expected_error = OK;
} else {
is(CORSMode, "use-credentials",
"What other CORS modes are there?");
// A load with credentials against a server that only
// allows anonymous loads will fail.
expected_error = BAD_URI_ERR;
}
} else {
is(CORSHeaders, "allow-single-server-creds",
"What other CORS headers could there be?");
// Our server should allow both anonymous and non-anonymous requests
expected_error = OK;
}
}
}
testImage(url, attrValData[0], expected_error);
}
testImage(url, attrValData[0], expected_error);
}
}
}
var prefs = [
[ "canvas.capturestream.enabled", true ],
];
SpecialPowers.pushPrefEnv({ "set" : prefs }, beginTest);
</script>
</pre>
</body>

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

@ -28,11 +28,7 @@ function createCanvas(width, height) {
return c;
}
function testCanvasDrawImage(v) {
var c = createCanvas(v.width, v.height);
var ctx = c.getContext("2d");
ctx.drawImage(v, 0, 0);
function checkGetImageData(ctx, v) {
try {
var data = ctx.getImageData(0, 0, 1, 1);
ok(true, "drawImage '" + v.src + "' then getImageData with crossOrigin='" + v.crossOrigin + "' worked");
@ -42,22 +38,54 @@ function testCanvasDrawImage(v) {
}
}
function checkGetImageDataTainted(ctx, v) {
try {
var data = ctx.getImageData(0, 0, 1, 1);
ok(false, "changing the CORS mode should not allow reading data from remote videos");
} catch (error) {
ok(error.name === "SecurityError", "changing the CORS mode, drawImage '" + v.src + "' then getImageData with crossOrigin='" + v.crossOrigin + "' failed");
}
}
function checkCaptureStream(c, v) {
try {
var stream = c.captureStream(0);
ok(true, "drawImage '" + v.src + "' then captureStream with crossOrigin='" + v.crossOrigin + "' worked");
} catch(error) {
ok(!v.crossOrigin && error.name === "SecurityError", "drawImage '" + v.src + "' then captureStream with crossOrigin='" + v.crossOrigin + "' failed");
v.tainted = true;
}
}
function checkCaptureStreamTainted(c, v) {
try {
var stream = c.captureStream(0);
ok(false, "changing the CORS mode should not allow capturing a stream from remote videos");
} catch (error) {
ok(error.name === "SecurityError", "changing the CORS mode, drawImage '" + v.src + "' then captureStream with crossOrigin='" + v.crossOrigin + "' failed");
}
}
function testCanvasDrawImage(v) {
var c = createCanvas(v.width, v.height);
var ctx = c.getContext("2d");
ctx.drawImage(v, 0, 0);
checkGetImageData(ctx, v);
checkCaptureStream(c, v);
}
function testCanvasCreatePattern(v) {
var c = createCanvas(v.width, v.height);
var ctx = c.getContext("2d");
ctx.fillStyle = ctx.createPattern(v, "");
ctx.fillRect(0, 0, c.width, c.height);
try {
var data = ctx.getImageData(0, 0, 1, 1);
ok(true, "createPattern '" + v.src + "' then getImageData with crossOrigin='" + v.crossOrigin + "' worked");
} catch(error) {
ok(!v.crossOrigin && error.name === "SecurityError", "createPattern '" + v.src + "' then getImageData with crossOrigin='" + v.crossOrigin + "' failed");
v.tainted = true;
}
checkGetImageData(ctx, v);
checkCaptureStream(c, v);
}
function testWebGL(v) {
function testWebGL(gl, v) {
var tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
@ -75,12 +103,8 @@ function testTaintedCanvas(v) {
var ctx = c.getContext("2d");
ctx.drawImage(v, 0, 0);
try {
var data = ctx.getImageData(0, 0, 1, 1);
ok(false, "changing the CORS mode should not allow reading data from remote videos");
} catch (error) {
ok(error.name === "SecurityError", "changing the CORS mode, drawImage '" + v.src + "' then getImageData with crossOrigin='" + v.crossOrigin + "' failed");
}
checkGetImageDataTainted(ctx, v);
checkCaptureStreamTainted(c, v);
}
function vidDataSuccess(e) {
@ -88,8 +112,8 @@ function vidDataSuccess(e) {
testCanvasDrawImage(e.target);
testCanvasCreatePattern(e.target);
if (gl) {
testWebGL(e.target);
if (document.gl) {
testWebGL(document.gl, e.target);
}
// If we change the CORS mode after loading the file without CORS it should still throw a security error
if (e.target.tainted) {
@ -121,7 +145,7 @@ function startTest(test, token) {
v.crossOrigin = test.cors;
}
v.token = token;
manager.started(token);
document.manager.started(token);
v.autoplay = true;
v.preload = "auto";
v.style.display = "none";
@ -140,53 +164,59 @@ function startTest(test, token) {
function doneTest(e) {
var v = e.target;
v.parentNode.removeChild(v);
manager.finished(v.token);
document.manager.finished(v.token);
}
var videoFile = getPlayableVideo(gSmallTests);
if (!videoFile) {
SimpleTest.finish();
}
videoFile = "?name=tests/dom/media/test/" + videoFile.name + "&type=" + videoFile.type;
function beginTest() {
var videoFile = getPlayableVideo(gSmallTests);
if (!videoFile) {
SimpleTest.finish();
}
videoFile = "?name=tests/dom/media/test/" + videoFile.name + "&type=" + videoFile.type;
var gl;
try {
gl = createCanvas(16, 16).getContext("experimental-webgl");
} catch (ex) {
// Mac OS X 10.5 doesn't support WebGL, so we won't run the WebGL tests
document.manager = new MediaTestManager;
var corsTests = [];
const host = "http://example.com/tests/dom/canvas/test/crossorigin/video.sjs";
const serverAttrValues = [
[ "&cors=none", "none" ],
[ "&cors=anonymous", "anonymous" ],
[ "&cors=use-credentials", "use-credentials" ]
];
const clientAttrValues = [
[ "missing-value-default", "none" ],
[ "", "anonymous" ],
[ "just-crossOrigin-without-value", "anonymous" ],
[ "anonymous", "anonymous" ],
[ "use-credentials", "use-credentials" ],
[ "foobar", "anonymous" ]
];
// Build the video file test array
for (var i = 0; i < serverAttrValues.length; i++) {
for (var n = 0; n < clientAttrValues.length; n++) {
corsTests.push({
name: host + videoFile + serverAttrValues[i][0],
nameIntent: serverAttrValues[i][1],
cors: clientAttrValues[n][0],
corsIntent: clientAttrValues[n][1]
});
}
}
try {
document.gl = createCanvas(16, 16).getContext("experimental-webgl");
} catch (ex) {
// Mac OS X 10.5 doesn't support WebGL, so we won't run the WebGL tests
}
document.manager.runTests(corsTests, startTest);
}
var manager = new MediaTestManager;
var corsTests = [];
const host = "http://example.com/tests/dom/canvas/test/crossorigin/video.sjs";
const serverAttrValues = [
[ "&cors=none", "none" ],
[ "&cors=anonymous", "anonymous" ],
[ "&cors=use-credentials", "use-credentials" ]
];
const clientAttrValues = [
[ "missing-value-default", "none" ],
[ "", "anonymous" ],
[ "just-crossOrigin-without-value", "anonymous" ],
[ "anonymous", "anonymous" ],
[ "use-credentials", "use-credentials" ],
[ "foobar", "anonymous" ]
var prefs = [
[ "canvas.capturestream.enabled", true ],
];
// Build the video file test array
for (var i = 0; i < serverAttrValues.length; i++) {
for (var n = 0; n < clientAttrValues.length; n++) {
corsTests.push({
name: host + videoFile + serverAttrValues[i][0],
nameIntent: serverAttrValues[i][1],
cors: clientAttrValues[n][0],
corsIntent: clientAttrValues[n][1]
});
}
}
manager.runTests(corsTests, startTest);
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({ "set" : prefs }, beginTest);
</script>
</pre>

Двоичные данные
dom/canvas/test/image_red_crossorigin_credentials.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 87 B

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

@ -0,0 +1,2 @@
Access-Control-Allow-Origin: http://mochi.test:8888
Access-Control-Allow-Credentials: true

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

@ -14,6 +14,8 @@ support-files =
image_green.png
image_red-16x16.png
image_red.png
image_red_crossorigin_credentials.png
image_red_crossorigin_credentials.png^headers^
image_redtransparent.png
image_rgrg-256x256.png
image_rrgg-256x256.png
@ -224,6 +226,8 @@ skip-if = (toolkit == 'gonk' && !debug) || os == 'win' #specialpowers.wrap
[test_hitregion_event.html]
skip-if = os == "android" || appname == "b2g"
[test_canvas_strokeStyle_getter.html]
[test_capture.html]
support-files = captureStream_common.js
[test_drawImageIncomplete.html]
[test_drawImage_document_domain.html]
[test_drawImage_edge_cases.html]

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

@ -0,0 +1,111 @@
<!DOCTYPE HTML>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Canvas2D test: CaptureStream()</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="captureStream_common.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<script>
var c; // Canvas element captured by streams.
var h; // CaptureStreamTestHelper holding utility test functions.
var vauto; // Video element with captureStream stream in automatic mode.
var vmanual; // Video element with captureStream stream in manual (fps 0) mode.
var vrate; // Video element with captureStream stream with fixed frame rate.
function checkDrawColorInitialRed() {
info("Checking that all video elements become red after first drawColor(red).");
h.drawColor(c, h.red);
vauto.mozSrcObject = c.captureStream();
vmanual.mozSrcObject = c.captureStream(0);
vrate.mozSrcObject = c.captureStream(10);
ok(h.testPixel(vauto, [0, 0, 0, 0], 0), "vauto hould not be drawn to before stable state");
ok(h.testPixel(vrate, [0, 0, 0, 0], 0), "vrate Should not be drawn to before stable state");
ok(h.testPixel(vmanual, [0, 0, 0, 0], 0), "vmanual Should not be drawn to before stable state");
return Promise.resolve()
.then(() => h.waitForPixel(vauto, h.red, 0, "should become red automatically"))
.then(() => h.waitForPixel(vrate, h.red, 0, "should become red automatically"))
.then(() => h.waitForPixel(vmanual, h.red, 0, "should become red when we get" +
" to stable state (first frame)"));
}
function checkDrawColorGreen() {
info("Checking that drawColor(green) propagates properly to video elements.");
h.drawColor(c, h.green);
return Promise.resolve()
.then(() => h.waitForPixel(vauto, h.green, 0, "should become green automatically"))
.then(() => h.waitForPixel(vrate, h.green, 0, "should become green automatically"))
.then(() => h.waitForPixel(vmanual, h.red, 0, "should still be red"))
.then(() => h.requestFrame(vmanual))
.then(() => h.waitForPixel(vmanual, h.green, 0, "should become green after requstFrame()"));
}
function checkRequestFrameOrderGuarantee() {
info("Checking that requestFrame() immediately before and after drawColor() " +
"calls results in the expected frame seen in the stream.");
return Promise.resolve()
.then(() => h.waitForPixel(vmanual, h.green, 0, "should still be green"))
.then(() => h.drawColor(c, h.red)) // 1. Draw canvas red
.then(() => h.requestFrame(vmanual)) // 2. Immediately request a frame
.then(() => h.drawColor(c, h.green)) // 3. Immediately draw canvas green
.then(() => h.waitForPixel(vmanual, h.red, 0, "should become red after call order test"))
.then(() => h.waitForPixelToTimeout(vmanual, h.green, 0, 500, "should not become green after call order test"));
}
function checkDrawImageNotCleanRed() {
info("Checking that drawImage with not origin-clean image renders streams useless.");
var ctx = c.getContext('2d');
var notCleanRed = new Image();
return new Promise((resolve, reject) => {
notCleanRed.onload = resolve;
notCleanRed.onerror = () => reject(new Error("Failed to load tainted image."));
notCleanRed.src = "http://example.com/tests/dom/canvas/test/image_red_crossorigin_credentials.png";
document.body.appendChild(notCleanRed);
})
.then(() => ctx.drawImage(notCleanRed, 0, 0, c.width, c.height))
.then(() => h.testNotClean(c))
.then(() => h.waitForPixelToTimeout(vauto, h.red, 0, 1000, "should not become red"))
.then(() => h.waitForPixelToTimeout(vrate, h.red, 0, 0, "should not become red"))
.then(() => h.waitForPixel(vmanual, h.green, 0, "should still be green"))
.then(() => h.requestFrame(vmanual))
.then(() => h.waitForPixelToTimeout(vmanual, h.red, 0, 1000, "should not become red"));
}
function finish() {
ok(true, 'Test complete.');
SimpleTest.finish();
}
function beginTest() {
h = new CaptureStreamTestHelper2D();
c = h.createAndAppendElement('canvas', 'c');
vauto = h.createAndAppendElement('video', 'vauto');
vmanual = h.createAndAppendElement('video', 'vmanual');
vrate = h.createAndAppendElement('video', 'vrate');
Promise.resolve()
.then(checkDrawColorInitialRed)
.then(checkDrawColorGreen)
.then(checkRequestFrameOrderGuarantee)
.then(checkDrawColorGreen) // Restore video elements to green.
.then(checkDrawImageNotCleanRed)
.then(finish);
}
SimpleTest.waitForExplicitFinish();
var prefs = [
[ "canvas.capturestream.enabled", true ],
];
SpecialPowers.pushPrefEnv({ "set" : prefs }, beginTest);
</script>

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

@ -9,6 +9,8 @@ support-files =
[webgl-mochitest/test_backbuffer_channels.html]
fail-if = (os == 'b2g')
[webgl-mochitest/test_depth_readpixels.html]
[webgl-mochitest/test_capture.html]
support-files = captureStream_common.js
[webgl-mochitest/test_draw.html]
[webgl-mochitest/test_fb_param.html]
[webgl-mochitest/test_fb_param_crash.html]

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

@ -0,0 +1,200 @@
<!DOCTYPE HTML>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>WebGL test: CaptureStream()</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="../captureStream_common.js">
<script src="driver-info.js"></script>
<script src="webgl-util.js"></script>
<script id="vs" type="x-shader/x-vertex">
attribute vec2 aVertCoord;
void main(void) {
gl_Position = vec4(aVertCoord, 0.0, 1.0);
}
</script>
<script id="fs" type="x-shader/x-fragment">
precision mediump float;
uniform vec4 uColor;
void main(void) {
gl_FragColor = uColor;
}
</script>
<body>
<script>
// Globals. Initialized during beginTest().
var c; // Canvas element captured by streams.
var gl; // WebGLContext of |c|.
var h; // CaptureStreamTestHelper holding utility test functions.
var vauto; // Video element with captureStream stream in automatic mode.
var vmanual; // Video element with captureStream stream in manual (fps 0) mode.
var vrate; // Video element with captureStream stream with fixed frame rate.
/* Fails the test if there was a GL error */
function checkGLError(info) {
var error = gl.getError();
// Comparing strings for sake of log output in hex format.
is("0x" + error.toString(16), "0x0", "WebGL error [" + info + "]");
}
function checkClearColorInitialRed() {
info("Checking that clearing to red works for first frame.");
h.clearColor(c, h.red);
vauto.mozSrcObject = c.captureStream();
vmanual.mozSrcObject = c.captureStream(0);
vrate.mozSrcObject = c.captureStream(10);
ok(h.testPixel(vauto, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
ok(h.testPixel(vrate, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
ok(h.testPixel(vmanual, [0, 0, 0, 0], 0), "Should not be drawn to before stable state");
return Promise.resolve()
.then(() => h.waitForPixel(vauto, h.red, 0, "should become red automatically"))
.then(() => h.waitForPixel(vrate, h.red, 0, "should become red automatically"))
.then(() => h.waitForPixel(vmanual, h.red, 0, "should become red when we get to stable state (first frame)"))
}
function checkDrawColorGreen() {
info("Checking that drawColor() results in green frames.");
h.drawColor(c, h.green);
checkGLError('after DrawColor');
return Promise.resolve()
.then(() => h.waitForPixel(vauto, h.green, 0, "should become green automatically"))
.then(() => h.waitForPixel(vrate, h.green, 0, "should become green automatically"))
.then(() => h.waitForPixel(vmanual, h.red, 0, "should still be red"))
.then(() => h.requestFrame(vmanual))
.then(() => h.waitForPixel(vmanual, h.green, 0, "should become green after requstFrame()"))
}
function checkClearColorRed() {
info("Checking that clearing to red works.");
h.clearColor(c, h.red);
return Promise.resolve()
.then(() => h.waitForPixel(vauto, h.red, 0, "should become red automatically"))
.then(() => h.waitForPixel(vrate, h.red, 0, "should become red automatically"))
.then(() => h.waitForPixel(vmanual, h.green, 0, "should still be green"))
.then(() => h.requestFrame(vmanual))
.then(() => h.waitForPixel(vmanual, h.red, 0, "should become red after requestFrame()"))
}
function checkRequestFrameOrderGuarantee() {
info("Checking that requestFrame() immediately before and after draw " +
"calls results in the expected frame seen in the stream.");
return Promise.resolve()
.then(() => h.waitForPixel(vmanual, h.red, 0, "should still be red"))
.then(() => h.drawColor(c, h.green)) // 1. Draw canvas green
.then(() => h.requestFrame(vmanual)) // 2. Immediately request a frame
.then(() => h.clearColor(c, h.red)) // 3. Immediately clear to red
.then(() => h.waitForPixel(vmanual, h.green, 0, "should become green after call order test"))
.then(() => h.waitForPixelToTimeout(vmanual, h.red, 0, 500, "should not become red after call order test"));
}
function checkCapturingForbidden() {
info("Checking that capturing a WebGL context with " +
"`preservDrawingBuffer: false` is forbidden.");
var c2 = h.createAndAppendElement("canvas", "c2");
var gl2 = WebGLUtil.getWebGL("c2", false, { preserveDrawingBuffer: false });
var checkThrows = function(f, expected, fName) {
try {
f();
ok(false, fName + " should throw when not preserving drawing buffer");
} catch(e) {
is(e.name, expected, fName + " forbidden when not preserving drawing buffer");
}
};
checkThrows(() => c2.captureStream(), "NS_ERROR_FAILURE", "captureStream()");
checkThrows(() => c2.captureStream(0), "NS_ERROR_FAILURE", "captureStream(0)");
checkThrows(() => c2.captureStream(10), "NS_ERROR_FAILURE", "captureStream(10)");
}
function finish() {
ok(true, 'Test complete.');
SimpleTest.finish();
}
function beginTest() {
h = new CaptureStreamTestHelperWebGL();
c = h.createAndAppendElement('canvas', 'c');
vauto = h.createAndAppendElement('video', 'vauto');
vmanual = h.createAndAppendElement('video', 'vmanual');
vrate = h.createAndAppendElement('video', 'vrate');
gl = WebGLUtil.getWebGL('c', false, { preserveDrawingBuffer: true });
if (!gl) {
todo(false, 'WebGL is unavailable.');
finish();
return;
}
function errorFunc(str) {
ok(false, 'Error: ' + str);
}
WebGLUtil.setErrorFunc(errorFunc);
WebGLUtil.setWarningFunc(errorFunc);
gl.disable(gl.DEPTH_TEST);
prog = WebGLUtil.createProgramByIds(gl, 'vs', 'fs');
if (!prog) {
ok(false, 'Program linking should succeed.');
return;
}
// Setup vertex coordinates for drawing a rectangle across the whole canvas.
prog.aVertCoord = gl.getAttribLocation(prog, "aVertCoord");
ok(prog.aVertCoord >= 0, '`aVertCoord` should be valid.');
var vertCoordArr = new Float32Array([
-1, -1,
1, -1,
-1, 1,
1, 1,
]);
var vertCoordBuff = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertCoordBuff);
gl.bufferData(gl.ARRAY_BUFFER, vertCoordArr, gl.STATIC_DRAW);
gl.useProgram(prog);
gl.enableVertexAttribArray(prog.aVertCoord);
gl.vertexAttribPointer(prog.aVertCoord, 2, gl.FLOAT, false, 0, 0);
// Setup the helper with a pointer to how to change fragment color.
var uColorLocation = gl.getUniformLocation(prog, "uColor");
h.setFragmentColorLocation(uColorLocation);
checkGLError('after setup');
// Run tests.
Promise.resolve()
.then(checkClearColorInitialRed)
.then(checkDrawColorGreen)
.then(checkClearColorRed)
.then(checkRequestFrameOrderGuarantee)
.then(checkCapturingForbidden)
.then(finish);
}
SimpleTest.waitForExplicitFinish();
var prefs = [
[ "canvas.capturestream.enabled", true ],
];
SpecialPowers.pushPrefEnv({ "set" : prefs }, beginTest);
</script>

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

@ -34,19 +34,19 @@ WebGLUtil = (function() {
// ---------------------------------------------------------------------------
// WebGL helpers
function getWebGL(canvasId, requireConformant) {
function getWebGL(canvasId, requireConformant, attributes) {
// `requireConformant` will default to falsey if it is not supplied.
var canvas = document.getElementById(canvasId);
var gl = null;
try {
gl = canvas.getContext('webgl');
gl = canvas.getContext('webgl', attributes);
} catch(e) {}
if (!gl && !requireConformant) {
try {
gl = canvas.getContext('experimental-webgl');
gl = canvas.getContext('experimental-webgl', attributes);
} catch(e) {}
}

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

@ -13,6 +13,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/Base64.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/dom/CanvasCaptureMediaStream.h"
#include "mozilla/dom/CanvasRenderingContext2D.h"
#include "mozilla/dom/File.h"
#include "mozilla/dom/HTMLCanvasElementBinding.h"
@ -405,6 +406,53 @@ HTMLCanvasElement::GetMozPrintCallback() const
return mPrintCallback;
}
already_AddRefed<CanvasCaptureMediaStream>
HTMLCanvasElement::CaptureStream(const Optional<double>& aFrameRate,
ErrorResult& aRv)
{
if (IsWriteOnly()) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
nsIDOMWindow* window = OwnerDoc()->GetInnerWindow();
if (!window) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
if (!mCurrentContext) {
aRv.Throw(NS_ERROR_NOT_INITIALIZED);
return nullptr;
}
if (mCurrentContextType != CanvasContextType::Canvas2D) {
WebGLContext* gl = static_cast<WebGLContext*>(mCurrentContext.get());
if (!gl->IsPreservingDrawingBuffer()) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
}
nsRefPtr<CanvasCaptureMediaStream> stream =
CanvasCaptureMediaStream::CreateSourceStream(window, this);
if (!stream) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<nsIPrincipal> principal = NodePrincipal();
stream->CombineWithPrincipal(principal);
TrackID videoTrackId = 1;
nsresult rv = stream->Init(aFrameRate, videoTrackId);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
return nullptr;
}
return stream.forget();
}
nsresult
HTMLCanvasElement::ExtractData(nsAString& aType,
const nsAString& aOptions,

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

@ -29,7 +29,7 @@ class SourceSurface;
}
namespace dom {
class CanvasCaptureMediaStream;
class File;
class FileCallback;
class HTMLCanvasPrintState;
@ -126,6 +126,9 @@ public:
PrintCallback* GetMozPrintCallback() const;
void SetMozPrintCallback(PrintCallback* aCallback);
already_AddRefed<CanvasCaptureMediaStream>
CaptureStream(const Optional<double>& aFrameRate, ErrorResult& aRv);
/**
* Get the size in pixels of this canvas element
*/

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

@ -1484,10 +1484,12 @@ HTMLMediaElement::Seek(double aTime,
// Clamp the seek target to inside the seekable ranges.
nsRefPtr<dom::TimeRanges> seekable = new dom::TimeRanges();
if (NS_FAILED(mDecoder->GetSeekable(seekable))) {
media::TimeIntervals seekableIntervals = mDecoder->GetSeekable();
if (seekableIntervals.IsInvalid()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
seekableIntervals.ToTimeRanges(seekable);
uint32_t length = 0;
seekable->GetLength(&length);
if (!length) {
@ -1601,9 +1603,8 @@ HTMLMediaElement::Seekable() const
{
nsRefPtr<TimeRanges> ranges = new TimeRanges();
if (mDecoder && mReadyState > nsIDOMHTMLMediaElement::HAVE_NOTHING) {
mDecoder->GetSeekable(ranges);
mDecoder->GetSeekable().ToTimeRanges(ranges);
}
ranges->Normalize();
return ranges.forget();
}
@ -4169,12 +4170,12 @@ HTMLMediaElement::Buffered() const
nsRefPtr<TimeRanges> ranges = new TimeRanges();
if (mReadyState > nsIDOMHTMLMediaElement::HAVE_NOTHING) {
if (mDecoder) {
// If GetBuffered fails we ignore the error result and just return the
// time ranges we found up till the error.
mDecoder->GetBuffered(ranges);
media::TimeIntervals buffered = mDecoder->GetBuffered();
if (!buffered.IsInvalid()) {
buffered.ToTimeRanges(ranges);
}
}
}
ranges->Normalize();
return ranges.forget();
}

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

@ -187,9 +187,8 @@
"Command insertHorizontalRule, value \"id\": input event, canceled":true,
"Command insertHorizontalRule, value \"id\": beforeinput event, uncanceled":true,
"Command insertHorizontalRule, value \"id\": input event, uncanceled":true,
"Command insertHTML, value \"\": execCommand() must not throw, canceled":true,
"Command insertHTML, value \"\": beforeinput event, canceled":true,
"Command insertHTML, value \"\": execCommand() must not throw, uncanceled":true,
"Command insertHTML, value \"\": input event, canceled":true,
"Command insertHTML, value \"\": beforeinput event, uncanceled":true,
"Command insertHTML, value \"\": input event, uncanceled":true,
"Command insertHTML, value \"quasit\": beforeinput event, canceled":true,

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

@ -3801,9 +3801,6 @@
"[[\"inserthtml\",\"<!--abc-->\"]] \"<p><br>{}</p>\" compare innerHTML":true,
"[[\"inserthtml\",\"<!--abc-->\"]] \"<p><!--foo--><span><br></span>{}<!--bar--></p>\" compare innerHTML":true,
"[[\"inserthtml\",\"<!--abc-->\"]] \"<p><span><!--foo--><br><!--bar--></span>{}</p>\" compare innerHTML":true,
"[[\"inserthtml\",\"\"]] \"foo[bar]baz\": execCommand(\"inserthtml\", false, \"\") return value":true,
"[[\"inserthtml\",\"\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"inserthtml\",\"\\u0000\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"true\"],[\"inserthtml\",\"<b>\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"stylewithcss\",\"false\"],[\"inserthtml\",\"<b>\"]] \"foo[bar]baz\" compare innerHTML":true,
"[[\"defaultparagraphseparator\",\"div\"],[\"inserthtml\",\"<p>abc\"]] \"<p>foo[bar]baz\": execCommand(\"defaultparagraphseparator\", false, \"div\") return value":true,

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

@ -2282,6 +2282,12 @@ ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID,
mAppInfo.ID.Assign(ID);
mAppInfo.vendor.Assign(vendor);
return true;
}
bool
ContentChild::RecvAppInit()
{
if (!Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false)) {
return true;
}

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

@ -345,6 +345,7 @@ public:
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID,
const nsCString& name, const nsCString& UAName,
const nsCString& ID, const nsCString& vendor) override;
virtual bool RecvAppInit() override;
virtual bool RecvLastPrivateDocShellDestroyed() override;

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

@ -2426,6 +2426,18 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
// must come after the Open() call above.
ProcessPriorityManager::SetProcessPriority(this, aInitialPriority);
if (gAppData) {
nsCString version(gAppData->version);
nsCString buildID(gAppData->buildID);
nsCString name(gAppData->name);
nsCString UAName(gAppData->UAName);
nsCString ID(gAppData->ID);
nsCString vendor(gAppData->vendor);
// Sending all information to content process.
unused << SendAppInfo(version, buildID, name, UAName, ID, vendor);
}
if (aSetupOffMainThreadCompositing) {
// NB: internally, this will send an IPC message to the child
// process to get it to create the CompositorChild. This
@ -2457,15 +2469,8 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
}
if (gAppData) {
nsCString version(gAppData->version);
nsCString buildID(gAppData->buildID);
nsCString name(gAppData->name);
nsCString UAName(gAppData->UAName);
nsCString ID(gAppData->ID);
nsCString vendor(gAppData->vendor);
// Sending all information to content process.
unused << SendAppInfo(version, buildID, name, UAName, ID, vendor);
unused << SendAppInit();
}
nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();

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

@ -60,6 +60,7 @@ using mozilla::layers::TouchBehaviorFlags from "mozilla/layers/APZUtils.h";
using nsIWidget::TouchPointerState from "nsIWidget.h";
using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h";
using struct mozilla::OwningSerializedStructuredCloneBuffer from "ipc/IPCMessageUtils.h";
using nsEventStatus from "mozilla/EventForwards.h";
namespace mozilla {
namespace dom {
@ -594,8 +595,14 @@ child:
RealMouseButtonEvent(WidgetMouseEvent event);
RealKeyEvent(WidgetKeyboardEvent event, MaybeNativeKeyBinding keyBinding);
MouseWheelEvent(WidgetWheelEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
RealTouchEvent(WidgetTouchEvent aEvent, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
RealTouchMoveEvent(WidgetTouchEvent aEvent, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
RealTouchEvent(WidgetTouchEvent aEvent,
ScrollableLayerGuid aGuid,
uint64_t aInputBlockId,
nsEventStatus aApzResponse);
RealTouchMoveEvent(WidgetTouchEvent aEvent,
ScrollableLayerGuid aGuid,
uint64_t aInputBlockId,
nsEventStatus aApzResponse);
RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction, uint32_t aDropEffect);
/**

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

@ -565,6 +565,7 @@ child:
AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
nsCString ID, nsCString vendor);
AppInit();
// Notify child that last-pb-context-exited notification was observed
LastPrivateDocShellDestroyed();

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

@ -38,8 +38,6 @@
#undef LOG
#endif
#include <utility>
// Use LOGP inside a ParticularProcessPriorityManager method; use LOG
// everywhere else. LOGP prints out information about the particular process
// priority manager.
@ -204,26 +202,6 @@ public:
*/
void Unfreeze();
/**
* Return the number of processes that have
* PROCESS_PRIORITY_FOREGROUND priority.
*/
uint32_t NumberOfForegroundProcesses();
/**
* Register a priority change to be performed at later time.
*/
void ScheduleDelayedSetPriority(
ParticularProcessPriorityManager* aParticularManager,
hal::ProcessPriority aPriority);
/**
* Perform the registered priority change unless
* aLastParticularManager is the same as the registered one.
*/
void PerformDelayedSetPriority(
ParticularProcessPriorityManager* aLastParticularManager);
private:
static bool sPrefListenersRegistered;
static bool sInitialized;
@ -243,6 +221,7 @@ private:
void ObserveContentParentCreated(nsISupports* aContentParent);
void ObserveContentParentDestroyed(nsISupports* aSubject);
void ObserveScreenStateChanged(const char16_t* aData);
nsDataHashtable<nsUint64HashKey, nsRefPtr<ParticularProcessPriorityManager> >
mParticularManagers;
@ -258,10 +237,6 @@ private:
/** Contains a pseudo-LRU list of foreground processes */
ProcessLRUPool mForegroundLRUPool;
/** Contains the delayed priority change request */
std::pair<nsRefPtr<ParticularProcessPriorityManager>, hal::ProcessPriority>
mDelayedSetPriority;
};
/**
@ -451,7 +426,6 @@ ProcessPriorityManagerImpl::ProcessPriorityManagerImpl()
{
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
RegisterWakeLockObserver(this);
mDelayedSetPriority = std::make_pair(nullptr, PROCESS_PRIORITY_UNKNOWN);
}
ProcessPriorityManagerImpl::~ProcessPriorityManagerImpl()
@ -473,6 +447,7 @@ ProcessPriorityManagerImpl::Init()
if (os) {
os->AddObserver(this, "ipc:content-created", /* ownsWeak */ false);
os->AddObserver(this, "ipc:content-shutdown", /* ownsWeak */ false);
os->AddObserver(this, "screen-state-changed", /* ownsWeak */ false);
}
}
@ -487,6 +462,8 @@ ProcessPriorityManagerImpl::Observe(
ObserveContentParentCreated(aSubject);
} else if (topic.EqualsLiteral("ipc:content-shutdown")) {
ObserveContentParentDestroyed(aSubject);
} else if (topic.EqualsLiteral("screen-state-changed")) {
ObserveScreenStateChanged(aData);
} else {
MOZ_ASSERT(false);
}
@ -568,10 +545,40 @@ ProcessPriorityManagerImpl::ObserveContentParentDestroyed(nsISupports* aSubject)
if (mHighPriorityChildIDs.Contains(childID)) {
mHighPriorityChildIDs.RemoveEntry(childID);
}
}
}
if (mDelayedSetPriority.first == pppm) {
mDelayedSetPriority = std::make_pair(nullptr, PROCESS_PRIORITY_UNKNOWN);
}
static PLDHashOperator
FreezeParticularProcessPriorityManagers(
const uint64_t& aKey,
nsRefPtr<ParticularProcessPriorityManager> aValue,
void* aUserData)
{
aValue->Freeze();
return PL_DHASH_NEXT;
}
static PLDHashOperator
UnfreezeParticularProcessPriorityManagers(
const uint64_t& aKey,
nsRefPtr<ParticularProcessPriorityManager> aValue,
void* aUserData)
{
aValue->Unfreeze();
return PL_DHASH_NEXT;
}
void
ProcessPriorityManagerImpl::ObserveScreenStateChanged(const char16_t* aData)
{
if (NS_LITERAL_STRING("on").Equals(aData)) {
sFrozen = false;
mParticularManagers.EnumerateRead(
&UnfreezeParticularProcessPriorityManagers, nullptr);
} else {
sFrozen = true;
mParticularManagers.EnumerateRead(
&FreezeParticularProcessPriorityManagers, nullptr);
}
}
@ -634,91 +641,6 @@ ProcessPriorityManagerImpl::Notify(const WakeLockInformation& aInfo)
}
}
static PLDHashOperator
FreezeParticularProcessPriorityManagers(
const uint64_t& aKey,
nsRefPtr<ParticularProcessPriorityManager> aValue,
void* aUserData)
{
aValue->Freeze();
return PL_DHASH_NEXT;
}
void
ProcessPriorityManagerImpl::Freeze()
{
sFrozen = true;
mParticularManagers.EnumerateRead(&FreezeParticularProcessPriorityManagers,
nullptr);
}
static PLDHashOperator
UnfreezeParticularProcessPriorityManagers(
const uint64_t& aKey,
nsRefPtr<ParticularProcessPriorityManager> aValue,
void* aUserData)
{
aValue->Unfreeze();
return PL_DHASH_NEXT;
}
void
ProcessPriorityManagerImpl::Unfreeze()
{
sFrozen = false;
mParticularManagers.EnumerateRead(&UnfreezeParticularProcessPriorityManagers,
nullptr);
}
static PLDHashOperator
CountNumberOfForegroundProcesses(
const uint64_t& aKey,
nsRefPtr<ParticularProcessPriorityManager> aValue,
void* aUserData)
{
uint32_t* accumulator = static_cast<uint32_t*>(aUserData);
if (aValue->CurrentPriority() == PROCESS_PRIORITY_FOREGROUND ||
aValue->CurrentPriority() == PROCESS_PRIORITY_FOREGROUND_HIGH) {
(*accumulator)++;
}
return PL_DHASH_NEXT;
}
uint32_t
ProcessPriorityManagerImpl::NumberOfForegroundProcesses()
{
uint32_t accumulator = 0;
mParticularManagers.EnumerateRead(&CountNumberOfForegroundProcesses,
&accumulator);
return accumulator;
}
void
ProcessPriorityManagerImpl::ScheduleDelayedSetPriority(
ParticularProcessPriorityManager* aParticularManager,
ProcessPriority aPriority)
{
mDelayedSetPriority = std::make_pair(aParticularManager, aPriority);
}
void
ProcessPriorityManagerImpl::PerformDelayedSetPriority(
ParticularProcessPriorityManager* aLastParticularManager)
{
nsRefPtr<ParticularProcessPriorityManager> pppm = mDelayedSetPriority.first;
ProcessPriority priority = mDelayedSetPriority.second;
mDelayedSetPriority = std::make_pair(nullptr, PROCESS_PRIORITY_UNKNOWN);
if (pppm == aLastParticularManager) {
return;
}
if (pppm && priority != PROCESS_PRIORITY_UNKNOWN) {
pppm->SetPriorityNow(priority);
}
}
NS_IMPL_ISUPPORTS(ParticularProcessPriorityManager,
nsIObserver,
nsITimerCallback,
@ -932,6 +854,10 @@ ParticularProcessPriorityManager::OnFrameloaderVisibleChanged(nsISupports* aSubj
nsCOMPtr<nsIFrameLoader> fl = do_QueryInterface(aSubject);
NS_ENSURE_TRUE_VOID(fl);
if (mFrozen) {
return; // Ignore visibility changes when the screen is off
}
TabParent* tp = TabParent::GetFrom(fl);
if (!tp) {
return;
@ -1086,9 +1012,7 @@ ParticularProcessPriorityManager::ComputePriority()
return PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE;
}
return HasAppType("homescreen") ?
PROCESS_PRIORITY_BACKGROUND_HOMESCREEN :
PROCESS_PRIORITY_BACKGROUND;
return PROCESS_PRIORITY_BACKGROUND;
}
void
@ -1125,20 +1049,6 @@ ParticularProcessPriorityManager::SetPriorityNow(ProcessPriority aPriority,
ProcessPriority oldPriority = mPriority;
if (oldPriority == PROCESS_PRIORITY_FOREGROUND &&
aPriority < PROCESS_PRIORITY_FOREGROUND &&
ProcessPriorityManagerImpl::GetSingleton()->
NumberOfForegroundProcesses() == 1) {
LOGP("Attempting to demote the last foreground process is delayed.");
ProcessPriorityManagerImpl::GetSingleton()->
ScheduleDelayedSetPriority(this, aPriority);
FireTestOnlyObserverNotification("process-priority-delayed",
ProcessPriorityToString(aPriority));
return;
}
mPriority = aPriority;
hal::SetProcessPriority(Pid(), mPriority);
@ -1155,12 +1065,6 @@ ParticularProcessPriorityManager::SetPriorityNow(ProcessPriority aPriority,
FireTestOnlyObserverNotification("process-priority-set",
ProcessPriorityToString(mPriority));
if (aPriority >= PROCESS_PRIORITY_FOREGROUND) {
LOGP("More than one foreground processes. Run delayed priority change");
ProcessPriorityManagerImpl::GetSingleton()->
PerformDelayedSetPriority(this);
}
}
void
@ -1173,7 +1077,6 @@ void
ParticularProcessPriorityManager::Unfreeze()
{
mFrozen = false;
ResetPriorityNow();
}
void
@ -1481,24 +1384,4 @@ ProcessPriorityManager::AnyProcessHasHighPriority()
}
}
/* static */ void
ProcessPriorityManager::Freeze()
{
ProcessPriorityManagerImpl* singleton =
ProcessPriorityManagerImpl::GetSingleton();
if (singleton) {
singleton->Freeze();
}
}
/* static */ void
ProcessPriorityManager::Unfreeze()
{
ProcessPriorityManagerImpl* singleton =
ProcessPriorityManagerImpl::GetSingleton();
if (singleton) {
singleton->Unfreeze();
}
}
} // namespace mozilla

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

@ -74,17 +74,6 @@ public:
*/
static bool AnyProcessHasHighPriority();
/**
* Prevents processes from changing priority until unfrozen.
*/
static void Freeze();
/**
* Allow process' priorities to change again. This will immediately adjust
* processes whose priority change did not happen because of the freeze.
*/
static void Unfreeze();
private:
ProcessPriorityManager();
DISALLOW_EVIL_CONSTRUCTORS(ProcessPriorityManager);

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