зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound
This commit is contained in:
Коммит
b1c944ace9
|
@ -12,3 +12,4 @@ support-files =
|
|||
[browser_roundedWindow_windowSetting_max.js]
|
||||
[browser_roundedWindow_windowSetting_mid.js]
|
||||
[browser_roundedWindow_windowSetting_min.js]
|
||||
[browser_timezone.js]
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* Bug 1330890 - A test case for verifying Date() object of javascript will use
|
||||
* UTC timezone after fingerprinting resistance is enabled.
|
||||
*/
|
||||
|
||||
const TEST_DOMAIN = "http://example.net/";
|
||||
const TEST_PATH = TEST_DOMAIN + "browser/browser/components/resistFingerprinting/test/browser/";
|
||||
|
||||
add_task(function* setup() {
|
||||
yield SpecialPowers.pushPrefEnv({"set":
|
||||
[["privacy.resistFingerprinting", true]]
|
||||
});
|
||||
});
|
||||
|
||||
add_task(function* test_timezone() {
|
||||
// Load a page and verify the timezone.
|
||||
let tab = yield BrowserTestUtils.openNewForegroundTab(
|
||||
gBrowser, TEST_PATH + "file_dummy.html");
|
||||
|
||||
yield ContentTask.spawn(tab.linkedBrowser, null,
|
||||
function* () {
|
||||
let dateObj = new Date();
|
||||
let dateString = dateObj.toString();
|
||||
|
||||
ok(dateString.endsWith("(UTC)"), "The date string is in UTC timezone.");
|
||||
is(dateObj.getFullYear(), dateObj.getUTCFullYear(),
|
||||
"The full year reports in UTC timezone.");
|
||||
is(dateObj.getMonth(), dateObj.getUTCMonth(), "The month reports in UTC timezone.");
|
||||
is(dateObj.getDate(), dateObj.getUTCDate(), "The month reports in UTC timezone.");
|
||||
is(dateObj.getDay(), dateObj.getUTCDay(), "The day reports in UTC timezone.");
|
||||
is(dateObj.getHours(), dateObj.getUTCHours(), "The hours reports in UTC timezone.");
|
||||
is(dateObj.getTimezoneOffset(), 0, "The difference with UTC timezone is 0.");
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
yield BrowserTestUtils.removeTab(tab);
|
||||
});
|
|
@ -46,7 +46,6 @@ const prefObserver = {
|
|||
}
|
||||
};
|
||||
|
||||
const APP_STARTUP = 1;
|
||||
function startup(data, reason) { // eslint-disable-line no-unused-vars
|
||||
appStartupDone();
|
||||
prefObserver.register();
|
||||
|
|
|
@ -142,6 +142,12 @@ this.main = (function() {
|
|||
// Not in a page/tab context, ignore
|
||||
return;
|
||||
}
|
||||
if (!urlEnabled(tab.url)) {
|
||||
senderror.showError({
|
||||
popupMessage: "UNSHOOTABLE_PAGE"
|
||||
});
|
||||
return;
|
||||
}
|
||||
catcher.watchPromise(
|
||||
toggleSelector(tab)
|
||||
.then(() => sendEvent("start-shot", "context-menu")));
|
||||
|
@ -185,29 +191,6 @@ this.main = (function() {
|
|||
return badDomains.includes(domain);
|
||||
}
|
||||
|
||||
function enableButton(tabId) {
|
||||
browser.browserAction.enable(tabId);
|
||||
// We have to manually toggle the icon state, because disabled toolbar
|
||||
// buttons aren't automatically dimmed for WebExtensions on Windows or
|
||||
// Linux (bug 1204609).
|
||||
setIconActive(false, tabId);
|
||||
}
|
||||
|
||||
function disableButton(tabId) {
|
||||
browser.browserAction.disable(tabId);
|
||||
setIconActive(true, tabId);
|
||||
}
|
||||
|
||||
browser.tabs.onUpdated.addListener(catcher.watchFunction((id, info, tab) => {
|
||||
if (info.url) {
|
||||
if (urlEnabled(info.url)) {
|
||||
enableButton(tab.id);
|
||||
} else if (hasSeenOnboarding) {
|
||||
disableButton(tab.id);
|
||||
}
|
||||
}
|
||||
}, true));
|
||||
|
||||
communication.register("sendEvent", (sender, ...args) => {
|
||||
catcher.watchPromise(sendEvent(...args));
|
||||
// We don't wait for it to complete:
|
||||
|
|
|
@ -3,14 +3,40 @@
|
|||
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-16</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<defs>
|
||||
<path d="M11,2 L15,2 L15,4 L11,4 L11,2 Z M17,2 L21,2 L21,4 L17,4 L17,2 Z M14,28 L18,28 L21,28 L21,30 L14,30 L14,28 Z M28,11 L30,11 L30,15 L28,15 L28,11 Z M28,17 L30,17 L30,21 L28,21 L28,17 Z M30,3.00292933 L30,9 L28,9 L28,4.49769878 C28,4.21484375 27.7771727,4 27.5023012,4 L23,4 L23,2 L28.9970707,2 C29.5621186,2 30,2.44902676 30,3.00292933 Z M28.9970707,30 L23,30 L23,28 L27.5023012,28 C27.7851562,28 28,27.7771727 28,27.5023012 L28,23 L30,23 L30,28.9970707 C30,29.5621186 29.5509732,30 28.9970707,30 Z M9,2 L9,4 L4.49769878,4 C4.21484375,4 4,4.22595492 4,4.50468445 L4,6 L2,6 L2,3.0093689 C2,2.44335318 2.44902676,2 3.00292933,2 L9,2 Z" id="path-1"></path>
|
||||
<filter x="-1.8%" y="-7.1%" width="103.6%" height="112.5%" filterUnits="objectBoundingBox" id="filter-2">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<filter x="-1.8%" y="-7.1%" width="103.6%" height="112.5%" filterUnits="objectBoundingBox" id="filter-3">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
|
||||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
|
||||
</filter>
|
||||
<path d="M12.5318913,18.5 L10.5328767,17.0889308 C9.66345095,17.6647004 8.62088218,18 7.5,18 C4.46243388,18 2,15.5375661 2,12.5 C2,9.46243388 4.46243388,7 7.5,7 C10.5375661,7 13,9.46243388 13,12.5 C13,12.9555527 12.9446152,13.3981697 12.8402119,13.8214846 L16,16.0519233 L23.3466336,10.8660643 C24.2490314,10.2290776 25.4969491,10.4442358 26.1339357,11.3466336 C26.7709224,12.2490314 26.5557642,13.4969491 25.6533664,14.1339357 L12.8402119,23.1785154 C12.9446152,23.6018303 13,24.0444473 13,24.5 C13,27.5375661 10.5375661,30 7.5,30 C4.46243388,30 2,27.5375661 2,24.5 C2,21.4624339 4.46243388,19 7.5,19 C8.62088218,19 9.66345095,19.3352996 10.5328767,19.9110692 L12.5318913,18.5 Z M17.5,22.0069002 L20.9681087,19.5588235 L25.6533664,22.8660643 C26.5557642,23.5030509 26.7709224,24.7509686 26.1339357,25.6533664 C25.4969491,26.5557642 24.2490314,26.7709224 23.3466336,26.1339357 L17.5,22.0069002 Z M7.5,15.25 C9.01878306,15.25 10.25,14.0187831 10.25,12.5 C10.25,10.9812169 9.01878306,9.75 7.5,9.75 C5.98121694,9.75 4.75,10.9812169 4.75,12.5 C4.75,14.0187831 5.98121694,15.25 7.5,15.25 Z M7.5,27.25 C9.01878306,27.25 10.25,26.0187831 10.25,24.5 C10.25,22.9812169 9.01878306,21.75 7.5,21.75 C5.98121694,21.75 4.75,22.9812169 4.75,24.5 C4.75,26.0187831 5.98121694,27.25 7.5,27.25 Z" id="path-4"></path>
|
||||
<filter x="-2.0%" y="-2.2%" width="116.3%" height="108.7%" filterUnits="objectBoundingBox" id="filter-5">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<filter x="-2.0%" y="-2.2%" width="116.3%" height="108.7%" filterUnits="objectBoundingBox" id="filter-6">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
|
||||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
|
||||
</filter>
|
||||
</defs>
|
||||
<g id="Onboarding" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="icon" fill="#4D4D4D">
|
||||
<path d="M11,2 L15,2 L15,4 L11,4 L11,2 Z M17,2 L21,2 L21,4 L17,4 L17,2 Z M14,28 L18,28 L21,28 L21,30 L14,30 L14,28 Z M28,11 L30,11 L30,15 L28,15 L28,11 Z M28,17 L30,17 L30,21 L28,21 L28,17 Z M30,3.00292933 L30,9 L28,9 L28,4.49769878 C28,4.21484375 27.7771727,4 27.5023012,4 L23,4 L23,2 L28.9970707,2 C29.5621186,2 30,2.44902676 30,3.00292933 Z M28.9970707,30 L23,30 L23,28 L27.5023012,28 C27.7851562,28 28,27.7771727 28,27.5023012 L28,23 L30,23 L30,28.9970707 C30,29.5621186 29.5509732,30 28.9970707,30 Z M9,2 L9,4 L4.49769878,4 C4.21484375,4 4,4.22595492 4,4.50468445 L4,6 L2,6 L2,3.0093689 C2,2.44335318 2.44902676,2 3.00292933,2 L9,2 Z" id="Combined-Shape"></path>
|
||||
<path d="M7.5,18 C4.46243388,18 2,15.5375661 2,12.5 C2,9.46243388 4.46243388,7 7.5,7 C10.5375661,7 13,9.46243388 13,12.5 C13,15.5375661 10.5375661,18 7.5,18 Z M7.5,15.25 C9.01878306,15.25 10.25,14.0187831 10.25,12.5 C10.25,10.9812169 9.01878306,9.75 7.5,9.75 C5.98121694,9.75 4.75,10.9812169 4.75,12.5 C4.75,14.0187831 5.98121694,15.25 7.5,15.25 Z" id="Combined-Shape"></path>
|
||||
<path d="M7.5,30 C4.46243388,30 2,27.5375661 2,24.5 C2,21.4624339 4.46243388,19 7.5,19 C10.5375661,19 13,21.4624339 13,24.5 C13,27.5375661 10.5375661,30 7.5,30 Z M7.5,27.25 C9.01878306,27.25 10.25,26.0187831 10.25,24.5 C10.25,22.9812169 9.01878306,21.75 7.5,21.75 C5.98121694,21.75 4.75,22.9812169 4.75,24.5 C4.75,26.0187831 5.98121694,27.25 7.5,27.25 Z" id="Combined-Shape-Copy"></path>
|
||||
<path d="M17.5,17.1107468 C15.3660747,15.6044466 13.2177087,14.087953 11.6169865,12.9580314 C10.6291131,12.260709 8.43228761,15.6061621 9.47511461,16.3422753 L14.0318913,19.5588235 L17.5,17.1107468 Z M20.9681087,19.5588235 C23.6164424,21.4282356 25.6533664,22.8660643 25.6533664,22.8660643 C26.5557642,23.5030509 26.7709224,24.7509686 26.1339357,25.6533664 C25.4969491,26.5557642 24.2490314,26.7709224 23.3466336,26.1339357 L17.5,22.0069002 C18.6001,21.2303591 19.7896836,20.390653 20.9681087,19.5588235 Z" id="Combined-Shape" fill-rule="nonzero"></path>
|
||||
<path d="M12.0225886,23.7556612 L25.6533664,14.1339357 C26.5557642,13.4969491 26.7709224,12.2490314 26.1339357,11.3466336 C25.4969491,10.4442358 24.2490314,10.2290776 23.3466336,10.8660643 L9.80606657,20.4241116 C8.65292225,21.2380958 10.8995145,24.5484194 12.0225886,23.7556612 Z" id="Line" fill-rule="nonzero"></path>
|
||||
<g id="icon">
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
||||
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-1"></use>
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-3)" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-5)" xlink:href="#path-4"></use>
|
||||
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-4"></use>
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-6)" xlink:href="#path-4"></use>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 2.8 KiB После Ширина: | Высота: | Размер: 4.8 KiB |
|
@ -3,14 +3,40 @@
|
|||
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-32</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<defs>
|
||||
<path d="M11,2 L15,2 L15,4 L11,4 L11,2 Z M17,2 L21,2 L21,4 L17,4 L17,2 Z M14,28 L18,28 L21,28 L21,30 L14,30 L14,28 Z M28,11 L30,11 L30,15 L28,15 L28,11 Z M28,17 L30,17 L30,21 L28,21 L28,17 Z M30,3.00292933 L30,9 L28,9 L28,4.49769878 C28,4.21484375 27.7771727,4 27.5023012,4 L23,4 L23,2 L28.9970707,2 C29.5621186,2 30,2.44902676 30,3.00292933 Z M28.9970707,30 L23,30 L23,28 L27.5023012,28 C27.7851562,28 28,27.7771727 28,27.5023012 L28,23 L30,23 L30,28.9970707 C30,29.5621186 29.5509732,30 28.9970707,30 Z M9,2 L9,4 L4.49769878,4 C4.21484375,4 4,4.22595492 4,4.50468445 L4,6 L2,6 L2,3.0093689 C2,2.44335318 2.44902676,2 3.00292933,2 L9,2 Z" id="path-1"></path>
|
||||
<filter x="-1.8%" y="-7.1%" width="103.6%" height="112.5%" filterUnits="objectBoundingBox" id="filter-2">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<filter x="-1.8%" y="-7.1%" width="103.6%" height="112.5%" filterUnits="objectBoundingBox" id="filter-3">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
|
||||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
|
||||
</filter>
|
||||
<path d="M12.5318913,18.5 L10.5328767,17.0889308 C9.66345095,17.6647004 8.62088218,18 7.5,18 C4.46243388,18 2,15.5375661 2,12.5 C2,9.46243388 4.46243388,7 7.5,7 C10.5375661,7 13,9.46243388 13,12.5 C13,12.9555527 12.9446152,13.3981697 12.8402119,13.8214846 L16,16.0519233 L23.3466336,10.8660643 C24.2490314,10.2290776 25.4969491,10.4442358 26.1339357,11.3466336 C26.7709224,12.2490314 26.5557642,13.4969491 25.6533664,14.1339357 L12.8402119,23.1785154 C12.9446152,23.6018303 13,24.0444473 13,24.5 C13,27.5375661 10.5375661,30 7.5,30 C4.46243388,30 2,27.5375661 2,24.5 C2,21.4624339 4.46243388,19 7.5,19 C8.62088218,19 9.66345095,19.3352996 10.5328767,19.9110692 L12.5318913,18.5 Z M17.5,22.0069002 L20.9681087,19.5588235 L25.6533664,22.8660643 C26.5557642,23.5030509 26.7709224,24.7509686 26.1339357,25.6533664 C25.4969491,26.5557642 24.2490314,26.7709224 23.3466336,26.1339357 L17.5,22.0069002 Z M7.5,15.25 C9.01878306,15.25 10.25,14.0187831 10.25,12.5 C10.25,10.9812169 9.01878306,9.75 7.5,9.75 C5.98121694,9.75 4.75,10.9812169 4.75,12.5 C4.75,14.0187831 5.98121694,15.25 7.5,15.25 Z M7.5,27.25 C9.01878306,27.25 10.25,26.0187831 10.25,24.5 C10.25,22.9812169 9.01878306,21.75 7.5,21.75 C5.98121694,21.75 4.75,22.9812169 4.75,24.5 C4.75,26.0187831 5.98121694,27.25 7.5,27.25 Z" id="path-4"></path>
|
||||
<filter x="-2.0%" y="-2.2%" width="116.3%" height="108.7%" filterUnits="objectBoundingBox" id="filter-5">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<filter x="-2.0%" y="-2.2%" width="116.3%" height="108.7%" filterUnits="objectBoundingBox" id="filter-6">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
|
||||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
|
||||
</filter>
|
||||
</defs>
|
||||
<g id="Onboarding" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="icon" fill="#4D4D4D">
|
||||
<path d="M11,2 L15,2 L15,4 L11,4 L11,2 Z M17,2 L21,2 L21,4 L17,4 L17,2 Z M14,28 L18,28 L21,28 L21,30 L14,30 L14,28 Z M28,11 L30,11 L30,15 L28,15 L28,11 Z M28,17 L30,17 L30,21 L28,21 L28,17 Z M30,3.00292933 L30,9 L28,9 L28,4.49769878 C28,4.21484375 27.7771727,4 27.5023012,4 L23,4 L23,2 L28.9970707,2 C29.5621186,2 30,2.44902676 30,3.00292933 Z M28.9970707,30 L23,30 L23,28 L27.5023012,28 C27.7851562,28 28,27.7771727 28,27.5023012 L28,23 L30,23 L30,28.9970707 C30,29.5621186 29.5509732,30 28.9970707,30 Z M9,2 L9,4 L4.49769878,4 C4.21484375,4 4,4.22595492 4,4.50468445 L4,6 L2,6 L2,3.0093689 C2,2.44335318 2.44902676,2 3.00292933,2 L9,2 Z" id="Combined-Shape"></path>
|
||||
<path d="M7.5,18 C4.46243388,18 2,15.5375661 2,12.5 C2,9.46243388 4.46243388,7 7.5,7 C10.5375661,7 13,9.46243388 13,12.5 C13,15.5375661 10.5375661,18 7.5,18 Z M7.5,15.25 C9.01878306,15.25 10.25,14.0187831 10.25,12.5 C10.25,10.9812169 9.01878306,9.75 7.5,9.75 C5.98121694,9.75 4.75,10.9812169 4.75,12.5 C4.75,14.0187831 5.98121694,15.25 7.5,15.25 Z" id="Combined-Shape"></path>
|
||||
<path d="M7.5,30 C4.46243388,30 2,27.5375661 2,24.5 C2,21.4624339 4.46243388,19 7.5,19 C10.5375661,19 13,21.4624339 13,24.5 C13,27.5375661 10.5375661,30 7.5,30 Z M7.5,27.25 C9.01878306,27.25 10.25,26.0187831 10.25,24.5 C10.25,22.9812169 9.01878306,21.75 7.5,21.75 C5.98121694,21.75 4.75,22.9812169 4.75,24.5 C4.75,26.0187831 5.98121694,27.25 7.5,27.25 Z" id="Combined-Shape-Copy"></path>
|
||||
<path d="M17.5,17.1107468 C15.3660747,15.6044466 13.2177087,14.087953 11.6169865,12.9580314 C10.6291131,12.260709 8.43228761,15.6061621 9.47511461,16.3422753 L14.0318913,19.5588235 L17.5,17.1107468 Z M20.9681087,19.5588235 C23.6164424,21.4282356 25.6533664,22.8660643 25.6533664,22.8660643 C26.5557642,23.5030509 26.7709224,24.7509686 26.1339357,25.6533664 C25.4969491,26.5557642 24.2490314,26.7709224 23.3466336,26.1339357 L17.5,22.0069002 C18.6001,21.2303591 19.7896836,20.390653 20.9681087,19.5588235 Z" id="Combined-Shape" fill-rule="nonzero"></path>
|
||||
<path d="M12.0225886,23.7556612 L25.6533664,14.1339357 C26.5557642,13.4969491 26.7709224,12.2490314 26.1339357,11.3466336 C25.4969491,10.4442358 24.2490314,10.2290776 23.3466336,10.8660643 L9.80606657,20.4241116 C8.65292225,21.2380958 10.8995145,24.5484194 12.0225886,23.7556612 Z" id="Line" fill-rule="nonzero"></path>
|
||||
<g id="icon">
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
||||
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-1"></use>
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-3)" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-5)" xlink:href="#path-4"></use>
|
||||
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-4"></use>
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-6)" xlink:href="#path-4"></use>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 2.8 KiB После Ширина: | Высота: | Размер: 4.8 KiB |
|
@ -3,13 +3,40 @@
|
|||
<!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>icon-starred-32</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<defs>
|
||||
<path d="M11,2 L15,2 L15,4 L11,4 L11,2 Z M17,2 L19,2 L19,4 L17,4 L17,2 Z M14,28 L18,28 L21,28 L21,30 L14,30 L14,28 Z M28,18 L30,18 L30,21 L28,21 L28,18 Z M28.9970707,30 L23,30 L23,28 L27.5023012,28 C27.7851562,28 28,27.7771727 28,27.5023012 L28,23 L30,23 L30,28.9970707 C30,29.5621186 29.5509732,30 28.9970707,30 Z M9,2 L9,4 L4.49769878,4 C4.21484375,4 4,4.22595492 4,4.50468445 L4,6 L2,6 L2,3.0093689 C2,2.44335318 2.44902676,2 3.00292933,2 L9,2 Z" id="path-1"></path>
|
||||
<filter x="-1.8%" y="-7.1%" width="103.6%" height="112.5%" filterUnits="objectBoundingBox" id="filter-2">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<filter x="-1.8%" y="-7.1%" width="103.6%" height="112.5%" filterUnits="objectBoundingBox" id="filter-3">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
|
||||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
|
||||
</filter>
|
||||
<path d="M16.2999464,15.8401964 C16.308319,16.6949285 16.7256347,17.5052335 17.4378266,18.0070314 C18.0631741,18.4476404 18.8359546,18.5940831 19.5621306,18.4336316 L12.8402119,23.1785154 C12.9446152,23.6018303 13,24.0444473 13,24.5 C13,27.5375661 10.5375661,30 7.5,30 C4.46243388,30 2,27.5375661 2,24.5 C2,21.4624339 4.46243388,19 7.5,19 C8.62088218,19 9.66345095,19.3352996 10.5328767,19.9110692 L12.5318913,18.5 L10.5328767,17.0889308 C9.66345095,17.6647004 8.62088218,18 7.5,18 C4.46243388,18 2,15.5375661 2,12.5 C2,9.46243388 4.46243388,7 7.5,7 C10.5375661,7 13,9.46243388 13,12.5 C13,12.9555527 12.9446152,13.3981697 12.8402119,13.8214846 L16,16.0519233 L16.2999464,15.8401964 Z M17.5,22.0069002 L20.9681087,19.5588235 L25.6533664,22.8660643 C26.5557642,23.5030509 26.7709224,24.7509686 26.1339357,25.6533664 C25.4969491,26.5557642 24.2490314,26.7709224 23.3466336,26.1339357 L17.5,22.0069002 Z M7.5,15.25 C9.01878306,15.25 10.25,14.0187831 10.25,12.5 C10.25,10.9812169 9.01878306,9.75 7.5,9.75 C5.98121694,9.75 4.75,10.9812169 4.75,12.5 C4.75,14.0187831 5.98121694,15.25 7.5,15.25 Z M7.5,27.25 C9.01878306,27.25 10.25,26.0187831 10.25,24.5 C10.25,22.9812169 9.01878306,21.75 7.5,21.75 C5.98121694,21.75 4.75,22.9812169 4.75,24.5 C4.75,26.0187831 5.98121694,27.25 7.5,27.25 Z" id="path-4"></path>
|
||||
<filter x="-2.0%" y="-39.1%" width="132.7%" height="145.7%" filterUnits="objectBoundingBox" id="filter-5">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<filter x="-2.0%" y="-39.1%" width="132.7%" height="145.7%" filterUnits="objectBoundingBox" id="filter-6">
|
||||
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner1"></feOffset>
|
||||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
|
||||
</filter>
|
||||
</defs>
|
||||
<g id="Onboarding" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="icon-starred">
|
||||
<path d="M11,2 L15,2 L15,4 L11,4 L11,2 Z M17,2 L19,2 L19,4 L17,4 L17,2 Z M14,28 L18,28 L21,28 L21,30 L14,30 L14,28 Z M28,18 L30,18 L30,21 L28,21 L28,18 Z M28.9970707,30 L23,30 L23,28 L27.5023012,28 C27.7851562,28 28,27.7771727 28,27.5023012 L28,23 L30,23 L30,28.9970707 C30,29.5621186 29.5509732,30 28.9970707,30 Z M9,2 L9,4 L4.49769878,4 C4.21484375,4 4,4.22595492 4,4.50468445 L4,6 L2,6 L2,3.0093689 C2,2.44335318 2.44902676,2 3.00292933,2 L9,2 Z" id="Combined-Shape" fill="#4D4D4D"></path>
|
||||
<path d="M7.5,18 C4.46243388,18 2,15.5375661 2,12.5 C2,9.46243388 4.46243388,7 7.5,7 C10.5375661,7 13,9.46243388 13,12.5 C13,15.5375661 10.5375661,18 7.5,18 Z M7.5,15.25 C9.01878306,15.25 10.25,14.0187831 10.25,12.5 C10.25,10.9812169 9.01878306,9.75 7.5,9.75 C5.98121694,9.75 4.75,10.9812169 4.75,12.5 C4.75,14.0187831 5.98121694,15.25 7.5,15.25 Z" id="Combined-Shape" fill="#4D4D4D"></path>
|
||||
<path d="M7.5,30 C4.46243388,30 2,27.5375661 2,24.5 C2,21.4624339 4.46243388,19 7.5,19 C10.5375661,19 13,21.4624339 13,24.5 C13,27.5375661 10.5375661,30 7.5,30 Z M7.5,27.25 C9.01878306,27.25 10.25,26.0187831 10.25,24.5 C10.25,22.9812169 9.01878306,21.75 7.5,21.75 C5.98121694,21.75 4.75,22.9812169 4.75,24.5 C4.75,26.0187831 5.98121694,27.25 7.5,27.25 Z" id="Combined-Shape-Copy" fill="#4D4D4D"></path>
|
||||
<path d="M19.5621306,18.4336316 L12.0225886,23.7556612 C10.8995145,24.5484194 8.65292225,21.2380958 9.80606657,20.4241116 L12.5318913,18.5 L9.47511461,16.3422753 C8.43228761,15.6061621 10.6291131,12.260709 11.6169865,12.9580314 L16,16.0519233 L16.2999464,15.8401964 C16.308319,16.6949285 16.7256347,17.5052335 17.4378266,18.0070314 C18.0631741,18.4476404 18.8359546,18.5940831 19.5621306,18.4336316 Z M20.9681087,19.5588235 L25.6533664,22.8660643 C26.5557642,23.5030509 26.7709224,24.7509686 26.1339357,25.6533664 C25.4969491,26.5557642 24.2490314,26.7709224 23.3466336,26.1339357 L17.5,22.0069002 C18.6001,21.2303591 19.7896836,20.390653 20.9681087,19.5588235 Z" id="Combined-Shape" fill="#4D4D4D" fill-rule="nonzero"></path>
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
||||
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-1"></use>
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-3)" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-5)" xlink:href="#path-4"></use>
|
||||
<use fill="#4D4D4D" fill-rule="evenodd" xlink:href="#path-4"></use>
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-6)" xlink:href="#path-4"></use>
|
||||
</g>
|
||||
<path d="M31.0298163,5.60065296 L26.6315676,4.81413617 L24.5599053,0.655603441 C24.3597524,0.253892444 23.949655,-8.95905326e-17 23.5009482,0 C23.0522413,5.97270217e-17 22.642144,0.253892444 22.441991,0.655603441 L20.3692531,4.81413617 L15.9796095,5.59850107 C15.5518938,5.67324058 15.1994617,5.97631422 15.0614174,6.38809939 C14.9233731,6.79988456 15.0218952,7.25422244 15.3180974,7.57178672 L18.4664647,10.9577899 L17.8114064,15.6489161 C17.7498225,16.0883409 17.9391303,16.5253075 18.3017873,16.7808292 C18.6644442,17.036351 19.1395182,17.0674963 19.5324134,16.8615077 L23.5004103,14.7913869 L27.4694829,16.8647355 C27.8623781,17.0707241 28.3374521,17.0395788 28.7001091,16.7840571 C29.062766,16.5285353 29.2520739,16.0915688 29.19049,15.652144 L28.534356,10.9577899 L31.6816477,7.57286266 C31.9779332,7.25540997 32.0766057,6.80113504 31.9387231,6.38932166 C31.8019739,5.98045861 31.4537759,5.67832329 31.0298163,5.60065296 Z" id="Shape" fill="#FF1AD9" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</g>
|
||||
|
|
До Ширина: | Высота: | Размер: 3.5 KiB После Ширина: | Высота: | Размер: 5.6 KiB |
|
@ -197,11 +197,21 @@ button {
|
|||
flex: 1;
|
||||
}
|
||||
|
||||
.addons-debugging-label {
|
||||
.addons-debugging-label,
|
||||
.addons-web-ext-tip {
|
||||
display: inline-block;
|
||||
margin-inline-end: 1ch;
|
||||
}
|
||||
|
||||
.addons-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.addons-tip-icon {
|
||||
margin-inline-end: 1ch;
|
||||
}
|
||||
|
||||
.error-page {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
@ -23,6 +23,8 @@ const Strings = Services.strings.createBundle(
|
|||
const ExtensionIcon = "chrome://mozapps/skin/extensions/extensionGeneric.svg";
|
||||
const CHROME_ENABLED_PREF = "devtools.chrome.enabled";
|
||||
const REMOTE_ENABLED_PREF = "devtools.debugger.remote-enabled";
|
||||
const WEB_EXT_URL = "https://developer.mozilla.org/Add-ons" +
|
||||
"/WebExtensions/Getting_started_with_web-ext";
|
||||
|
||||
module.exports = createClass({
|
||||
displayName: "AddonsPanel",
|
||||
|
@ -145,7 +147,22 @@ module.exports = createClass({
|
|||
debugDisabled,
|
||||
targetClass,
|
||||
sort: true
|
||||
})),
|
||||
}),
|
||||
dom.div({ className: "addons-tip"},
|
||||
dom.img({
|
||||
className: "addons-tip-icon",
|
||||
role: "presentation",
|
||||
src: "chrome://devtools/skin/images/help.svg",
|
||||
}),
|
||||
dom.span({
|
||||
className: "addons-web-ext-tip",
|
||||
}, Strings.GetStringFromName("webExtTip")),
|
||||
"(",
|
||||
dom.a({ href: WEB_EXT_URL, target: "_blank" },
|
||||
Strings.GetStringFromName("moreInfo")),
|
||||
")"
|
||||
)
|
||||
),
|
||||
dom.div({ id: "addons" },
|
||||
TargetList({
|
||||
id: "extensions",
|
||||
|
|
|
@ -65,6 +65,11 @@ extensions = Extensions
|
|||
# This string is displayed as a header above the list of temporarily loaded add-ons.
|
||||
temporaryExtensions = Temporary Extensions
|
||||
|
||||
# LOCALIZATION NOTE (webExtTip):
|
||||
# This string is displayed as a message below the list of temporarily loaded add-ons.
|
||||
webExtTip = You can use web-ext to load temporary WebExtensions from the command line.
|
||||
|
||||
|
||||
# LOCALIZATION NOTE (selectAddonFromFile2):
|
||||
# This string is displayed as the title of the file picker that appears when
|
||||
# the user clicks the 'Load Temporary Add-on' button
|
||||
|
|
|
@ -292,7 +292,6 @@ bool nsContentUtils::sIsUserTimingLoggingEnabled = false;
|
|||
bool nsContentUtils::sIsExperimentalAutocompleteEnabled = false;
|
||||
bool nsContentUtils::sIsWebComponentsEnabled = false;
|
||||
bool nsContentUtils::sIsCustomElementsEnabled = false;
|
||||
bool nsContentUtils::sPrivacyResistFingerprinting = false;
|
||||
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
|
||||
bool nsContentUtils::sUseActivityCursor = false;
|
||||
bool nsContentUtils::sAnimationsAPICoreEnabled = false;
|
||||
|
@ -631,9 +630,6 @@ nsContentUtils::Init()
|
|||
Preferences::AddBoolVarCache(&sIsCustomElementsEnabled,
|
||||
"dom.webcomponents.customelements.enabled", false);
|
||||
|
||||
Preferences::AddBoolVarCache(&sPrivacyResistFingerprinting,
|
||||
"privacy.resistFingerprinting", false);
|
||||
|
||||
Preferences::AddIntVarCache(&sPrivacyMaxInnerWidth,
|
||||
"privacy.window.maxInnerWidth",
|
||||
1000);
|
||||
|
@ -686,6 +682,8 @@ nsContentUtils::Init()
|
|||
|
||||
Element::InitCCCallbacks();
|
||||
|
||||
Unused << nsRFPService::GetOrCreate();
|
||||
|
||||
nsCOMPtr<nsIUUIDGenerator> uuidGenerator =
|
||||
do_GetService("@mozilla.org/uuid-generator;1", &rv);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
|
@ -2232,7 +2230,7 @@ nsContentUtils::IsCallerChrome()
|
|||
bool
|
||||
nsContentUtils::ShouldResistFingerprinting()
|
||||
{
|
||||
return sPrivacyResistFingerprinting;
|
||||
return nsRFPService::IsResistFingerprintingEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -2242,7 +2240,7 @@ nsContentUtils::ShouldResistFingerprinting(nsIDocShell* aDocShell)
|
|||
return false;
|
||||
}
|
||||
bool isChrome = nsContentUtils::IsChromeDoc(aDocShell->GetDocument());
|
||||
return !isChrome && sPrivacyResistFingerprinting;
|
||||
return !isChrome && nsRFPService::IsResistFingerprintingEnabled();
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -8841,6 +8839,25 @@ nsContentUtils::GetReferrerPolicyFromHeader(const nsAString& aHeader)
|
|||
return referrerPolicy;
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
nsContentUtils::PromiseRejectionEventsEnabled(JSContext* aCx, JSObject* aObj)
|
||||
{
|
||||
if (NS_IsMainThread()) {
|
||||
return Preferences::GetBool("dom.promise_rejection_events.enabled", false);
|
||||
}
|
||||
|
||||
using namespace workers;
|
||||
|
||||
// Otherwise, check the pref via the WorkerPrivate
|
||||
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx);
|
||||
if (!workerPrivate) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return workerPrivate->PromiseRejectionEventsEnabled();
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
nsContentUtils::PushEnabled(JSContext* aCx, JSObject* aObj)
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nsIContentPolicy.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsRFPService.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
// Undefine LoadImage to prevent naming conflict with Windows.
|
||||
|
@ -2178,7 +2179,7 @@ public:
|
|||
static bool ResistFingerprinting(mozilla::dom::CallerType aCallerType)
|
||||
{
|
||||
return aCallerType != mozilla::dom::CallerType::System &&
|
||||
sPrivacyResistFingerprinting;
|
||||
mozilla::nsRFPService::IsResistFingerprintingEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2746,7 +2747,7 @@ public:
|
|||
nsIHttpChannel* aChannel,
|
||||
mozilla::net::ReferrerPolicy aReferrerPolicy);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Parse a referrer policy from a Referrer-Policy header
|
||||
* https://www.w3.org/TR/referrer-policy/#parse-referrer-policy-from-header
|
||||
*
|
||||
|
@ -2755,6 +2756,8 @@ public:
|
|||
*/
|
||||
static mozilla::net::ReferrerPolicy GetReferrerPolicyFromHeader(const nsAString& aHeader);
|
||||
|
||||
static bool PromiseRejectionEventsEnabled(JSContext* aCx, JSObject* aObj);
|
||||
|
||||
static bool PushEnabled(JSContext* aCx, JSObject* aObj);
|
||||
|
||||
static bool IsNonSubresourceRequest(nsIChannel* aChannel);
|
||||
|
@ -3059,7 +3062,6 @@ private:
|
|||
static bool sIsExperimentalAutocompleteEnabled;
|
||||
static bool sIsWebComponentsEnabled;
|
||||
static bool sIsCustomElementsEnabled;
|
||||
static bool sPrivacyResistFingerprinting;
|
||||
static bool sSendPerformanceTimingNotifications;
|
||||
static bool sUseActivityCursor;
|
||||
static bool sAnimationsAPICoreEnabled;
|
||||
|
|
|
@ -80,7 +80,7 @@ def idlTypeNeedsCycleCollection(type):
|
|||
type.isObject() or
|
||||
type.isSpiderMonkeyInterface()):
|
||||
return False
|
||||
elif type.isCallback() or type.isGeckoInterface():
|
||||
elif type.isCallback() or type.isPromise() or type.isGeckoInterface():
|
||||
return True
|
||||
elif type.isUnion():
|
||||
return any(idlTypeNeedsCycleCollection(t) for t in type.flatMemberTypes)
|
||||
|
|
|
@ -267,55 +267,6 @@ GamepadManager::RemoveGamepad(uint32_t aIndex, GamepadServiceType aServiceType)
|
|||
mGamepads.Remove(newIndex);
|
||||
}
|
||||
|
||||
void
|
||||
GamepadManager::NewButtonEvent(uint32_t aIndex, GamepadServiceType aServiceType,
|
||||
uint32_t aButton, bool aPressed, bool aTouched,
|
||||
double aValue)
|
||||
{
|
||||
if (mShuttingDown) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t newIndex = GetGamepadIndexWithServiceType(aIndex, aServiceType);
|
||||
|
||||
RefPtr<Gamepad> gamepad = GetGamepad(newIndex);
|
||||
if (!gamepad) {
|
||||
return;
|
||||
}
|
||||
|
||||
gamepad->SetButton(aButton, aPressed, aTouched, aValue);
|
||||
|
||||
// Hold on to listeners in a separate array because firing events
|
||||
// can mutate the mListeners array.
|
||||
nsTArray<RefPtr<nsGlobalWindow>> listeners(mListeners);
|
||||
MOZ_ASSERT(!listeners.IsEmpty());
|
||||
|
||||
for (uint32_t i = 0; i < listeners.Length(); i++) {
|
||||
|
||||
MOZ_ASSERT(listeners[i]->IsInnerWindow());
|
||||
|
||||
// Only send events to non-background windows
|
||||
if (!listeners[i]->AsInner()->IsCurrentInnerWindow() ||
|
||||
listeners[i]->GetOuterWindow()->IsBackground()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool firstTime = MaybeWindowHasSeenGamepad(listeners[i], newIndex);
|
||||
|
||||
RefPtr<Gamepad> listenerGamepad = listeners[i]->GetGamepad(newIndex);
|
||||
if (listenerGamepad) {
|
||||
listenerGamepad->SetButton(aButton, aPressed, aTouched, aValue);
|
||||
if (firstTime) {
|
||||
FireConnectionEvent(listeners[i], listenerGamepad, true);
|
||||
}
|
||||
if (mNonstandardEventsEnabled) {
|
||||
// Fire event
|
||||
FireButtonEvent(listeners[i], listenerGamepad, aButton, aValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GamepadManager::FireButtonEvent(EventTarget* aTarget,
|
||||
Gamepad* aGamepad,
|
||||
|
@ -338,53 +289,6 @@ GamepadManager::FireButtonEvent(EventTarget* aTarget,
|
|||
aTarget->DispatchEvent(event, &defaultActionEnabled);
|
||||
}
|
||||
|
||||
void
|
||||
GamepadManager::NewAxisMoveEvent(uint32_t aIndex, GamepadServiceType aServiceType,
|
||||
uint32_t aAxis, double aValue)
|
||||
{
|
||||
if (mShuttingDown) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t newIndex = GetGamepadIndexWithServiceType(aIndex, aServiceType);
|
||||
|
||||
RefPtr<Gamepad> gamepad = GetGamepad(newIndex);
|
||||
if (!gamepad) {
|
||||
return;
|
||||
}
|
||||
gamepad->SetAxis(aAxis, aValue);
|
||||
|
||||
// Hold on to listeners in a separate array because firing events
|
||||
// can mutate the mListeners array.
|
||||
nsTArray<RefPtr<nsGlobalWindow>> listeners(mListeners);
|
||||
MOZ_ASSERT(!listeners.IsEmpty());
|
||||
|
||||
for (uint32_t i = 0; i < listeners.Length(); i++) {
|
||||
|
||||
MOZ_ASSERT(listeners[i]->IsInnerWindow());
|
||||
|
||||
// Only send events to non-background windows
|
||||
if (!listeners[i]->AsInner()->IsCurrentInnerWindow() ||
|
||||
listeners[i]->GetOuterWindow()->IsBackground()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool firstTime = MaybeWindowHasSeenGamepad(listeners[i], newIndex);
|
||||
|
||||
RefPtr<Gamepad> listenerGamepad = listeners[i]->GetGamepad(newIndex);
|
||||
if (listenerGamepad) {
|
||||
listenerGamepad->SetAxis(aAxis, aValue);
|
||||
if (firstTime) {
|
||||
FireConnectionEvent(listeners[i], listenerGamepad, true);
|
||||
}
|
||||
if (mNonstandardEventsEnabled) {
|
||||
// Fire event
|
||||
FireAxisMoveEvent(listeners[i], listenerGamepad, aAxis, aValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GamepadManager::FireAxisMoveEvent(EventTarget* aTarget,
|
||||
Gamepad* aGamepad,
|
||||
|
@ -408,92 +312,6 @@ GamepadManager::FireAxisMoveEvent(EventTarget* aTarget,
|
|||
aTarget->DispatchEvent(event, &defaultActionEnabled);
|
||||
}
|
||||
|
||||
void
|
||||
GamepadManager::NewPoseEvent(uint32_t aIndex, GamepadServiceType aServiceType,
|
||||
const GamepadPoseState& aPose)
|
||||
{
|
||||
if (mShuttingDown) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t newIndex = GetGamepadIndexWithServiceType(aIndex, aServiceType);
|
||||
|
||||
RefPtr<Gamepad> gamepad = GetGamepad(newIndex);
|
||||
if (!gamepad) {
|
||||
return;
|
||||
}
|
||||
gamepad->SetPose(aPose);
|
||||
|
||||
// Hold on to listeners in a separate array because firing events
|
||||
// can mutate the mListeners array.
|
||||
nsTArray<RefPtr<nsGlobalWindow>> listeners(mListeners);
|
||||
MOZ_ASSERT(!listeners.IsEmpty());
|
||||
|
||||
for (uint32_t i = 0; i < listeners.Length(); i++) {
|
||||
|
||||
MOZ_ASSERT(listeners[i]->IsInnerWindow());
|
||||
|
||||
// Only send events to non-background windows
|
||||
if (!listeners[i]->AsInner()->IsCurrentInnerWindow() ||
|
||||
listeners[i]->GetOuterWindow()->IsBackground()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool firstTime = MaybeWindowHasSeenGamepad(listeners[i], newIndex);
|
||||
|
||||
RefPtr<Gamepad> listenerGamepad = listeners[i]->GetGamepad(newIndex);
|
||||
if (listenerGamepad) {
|
||||
listenerGamepad->SetPose(aPose);
|
||||
if (firstTime) {
|
||||
FireConnectionEvent(listeners[i], listenerGamepad, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GamepadManager::NewHandChangeEvent(uint32_t aIndex, GamepadServiceType aServiceType,
|
||||
GamepadHand aHand)
|
||||
{
|
||||
if (mShuttingDown) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t newIndex = GetGamepadIndexWithServiceType(aIndex, aServiceType);
|
||||
|
||||
RefPtr<Gamepad> gamepad = GetGamepad(newIndex);
|
||||
if (!gamepad) {
|
||||
return;
|
||||
}
|
||||
gamepad->SetHand(aHand);
|
||||
|
||||
// Hold on to listeners in a separate array because firing events
|
||||
// can mutate the mListeners array.
|
||||
nsTArray<RefPtr<nsGlobalWindow>> listeners(mListeners);
|
||||
MOZ_ASSERT(!listeners.IsEmpty());
|
||||
|
||||
for (uint32_t i = 0; i < listeners.Length(); i++) {
|
||||
|
||||
MOZ_ASSERT(listeners[i]->IsInnerWindow());
|
||||
|
||||
// Only send events to non-background windows
|
||||
if (!listeners[i]->AsInner()->IsCurrentInnerWindow() ||
|
||||
listeners[i]->GetOuterWindow()->IsBackground()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool firstTime = MaybeWindowHasSeenGamepad(listeners[i], newIndex);
|
||||
|
||||
RefPtr<Gamepad> listenerGamepad = listeners[i]->GetGamepad(newIndex);
|
||||
if (listenerGamepad) {
|
||||
listenerGamepad->SetHand(aHand);
|
||||
if (firstTime) {
|
||||
FireConnectionEvent(listeners[i], listenerGamepad, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GamepadManager::NewConnectionEvent(uint32_t aIndex, bool aConnected)
|
||||
{
|
||||
|
@ -676,6 +494,10 @@ GamepadManager::SetWindowHasSeenGamepad(nsGlobalWindow* aWindow,
|
|||
void
|
||||
GamepadManager::Update(const GamepadChangeEvent& aEvent)
|
||||
{
|
||||
if (mShuttingDown) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (aEvent.type() == GamepadChangeEvent::TGamepadAdded) {
|
||||
const GamepadAdded& a = aEvent.get_GamepadAdded();
|
||||
AddGamepad(a.index(), a.id(),
|
||||
|
@ -691,30 +513,137 @@ GamepadManager::Update(const GamepadChangeEvent& aEvent)
|
|||
RemoveGamepad(a.index(), a.service_type());
|
||||
return;
|
||||
}
|
||||
if (aEvent.type() == GamepadChangeEvent::TGamepadButtonInformation) {
|
||||
const GamepadButtonInformation& a = aEvent.get_GamepadButtonInformation();
|
||||
NewButtonEvent(a.index(), a.service_type(), a.button(),
|
||||
a.pressed(), a.touched(), a.value());
|
||||
return;
|
||||
}
|
||||
if (aEvent.type() == GamepadChangeEvent::TGamepadAxisInformation) {
|
||||
const GamepadAxisInformation& a = aEvent.get_GamepadAxisInformation();
|
||||
NewAxisMoveEvent(a.index(), a.service_type(), a.axis(), a.value());
|
||||
return;
|
||||
}
|
||||
if (aEvent.type() == GamepadChangeEvent::TGamepadPoseInformation) {
|
||||
const GamepadPoseInformation& a = aEvent.get_GamepadPoseInformation();
|
||||
NewPoseEvent(a.index(), a.service_type(), a.pose_state());
|
||||
return;
|
||||
}
|
||||
if (aEvent.type() == GamepadChangeEvent::TGamepadHandInformation) {
|
||||
const GamepadHandInformation& a = aEvent.get_GamepadHandInformation();
|
||||
NewHandChangeEvent(a.index(), a.service_type(), a.hand());
|
||||
|
||||
if (!SetGamepadByEvent(aEvent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_CRASH("We shouldn't be here!");
|
||||
// Hold on to listeners in a separate array because firing events
|
||||
// can mutate the mListeners array.
|
||||
nsTArray<RefPtr<nsGlobalWindow>> listeners(mListeners);
|
||||
MOZ_ASSERT(!listeners.IsEmpty());
|
||||
|
||||
for (uint32_t i = 0; i < listeners.Length(); i++) {
|
||||
MOZ_ASSERT(listeners[i]->IsInnerWindow());
|
||||
|
||||
// Only send events to non-background windows
|
||||
if (!listeners[i]->AsInner()->IsCurrentInnerWindow() ||
|
||||
listeners[i]->GetOuterWindow()->IsBackground()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SetGamepadByEvent(aEvent, listeners[i]);
|
||||
MaybeConvertToNonstandardGamepadEvent(aEvent, listeners[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GamepadManager::MaybeConvertToNonstandardGamepadEvent(const GamepadChangeEvent& aEvent,
|
||||
nsGlobalWindow* aWindow)
|
||||
{
|
||||
MOZ_ASSERT(aWindow);
|
||||
|
||||
if (!mNonstandardEventsEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<Gamepad> gamepad;
|
||||
|
||||
switch (aEvent.type()) {
|
||||
case GamepadChangeEvent::TGamepadButtonInformation:
|
||||
{
|
||||
const GamepadButtonInformation& a = aEvent.get_GamepadButtonInformation();
|
||||
gamepad = aWindow->GetGamepad(a.index());
|
||||
if (gamepad) {
|
||||
FireButtonEvent(aWindow, gamepad, a.button(), a.value());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GamepadChangeEvent::TGamepadAxisInformation:
|
||||
{
|
||||
const GamepadAxisInformation& a = aEvent.get_GamepadAxisInformation();
|
||||
gamepad = aWindow->GetGamepad(a.index());
|
||||
if (gamepad) {
|
||||
FireAxisMoveEvent(aWindow, gamepad, a.axis(), a.value());
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
GamepadManager::SetGamepadByEvent(const GamepadChangeEvent& aEvent, nsGlobalWindow *aWindow)
|
||||
{
|
||||
uint32_t index;
|
||||
RefPtr<Gamepad> gamepad;
|
||||
bool ret = false;
|
||||
bool firstTime = false;
|
||||
|
||||
switch (aEvent.type()) {
|
||||
case GamepadChangeEvent::TGamepadButtonInformation:
|
||||
{
|
||||
const GamepadButtonInformation& a = aEvent.get_GamepadButtonInformation();
|
||||
index = GetGamepadIndexWithServiceType(a.index(), a.service_type());
|
||||
if (aWindow) {
|
||||
firstTime = MaybeWindowHasSeenGamepad(aWindow, index);
|
||||
}
|
||||
gamepad = aWindow ? aWindow->GetGamepad(index) : GetGamepad(index);
|
||||
if (gamepad) {
|
||||
gamepad->SetButton(a.button(), a.pressed(), a.touched(), a.value());
|
||||
ret = true;
|
||||
}
|
||||
} break;
|
||||
case GamepadChangeEvent::TGamepadAxisInformation:
|
||||
{
|
||||
const GamepadAxisInformation& a = aEvent.get_GamepadAxisInformation();
|
||||
index = GetGamepadIndexWithServiceType(a.index(), a.service_type());
|
||||
if (aWindow) {
|
||||
firstTime = MaybeWindowHasSeenGamepad(aWindow, index);
|
||||
}
|
||||
gamepad = aWindow ? aWindow->GetGamepad(index) : GetGamepad(index);
|
||||
if (gamepad) {
|
||||
gamepad->SetAxis(a.axis(), a.value());
|
||||
ret = true;
|
||||
}
|
||||
} break;
|
||||
case GamepadChangeEvent::TGamepadPoseInformation:
|
||||
{
|
||||
const GamepadPoseInformation& a = aEvent.get_GamepadPoseInformation();
|
||||
index = GetGamepadIndexWithServiceType(a.index(), a.service_type());
|
||||
if (aWindow) {
|
||||
firstTime = MaybeWindowHasSeenGamepad(aWindow, index);
|
||||
}
|
||||
gamepad = aWindow ? aWindow->GetGamepad(index) : GetGamepad(index);
|
||||
if (gamepad) {
|
||||
gamepad->SetPose(a.pose_state());
|
||||
ret = true;
|
||||
}
|
||||
} break;
|
||||
case GamepadChangeEvent::TGamepadHandInformation:
|
||||
{
|
||||
const GamepadHandInformation& a = aEvent.get_GamepadHandInformation();
|
||||
index = GetGamepadIndexWithServiceType(a.index(), a.service_type());
|
||||
if (aWindow) {
|
||||
firstTime = MaybeWindowHasSeenGamepad(aWindow, index);
|
||||
}
|
||||
gamepad = aWindow ? aWindow->GetGamepad(index) : GetGamepad(index);
|
||||
if (gamepad) {
|
||||
gamepad->SetHand(a.hand());
|
||||
ret = true;
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
MOZ_ASSERT(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (aWindow && firstTime) {
|
||||
FireConnectionEvent(aWindow, gamepad, true);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
already_AddRefed<Promise>
|
||||
|
|
|
@ -57,29 +57,6 @@ class GamepadManager final : public nsIObserver,
|
|||
// Remove the gamepad at |aIndex| from the list of known gamepads.
|
||||
void RemoveGamepad(uint32_t aIndex, GamepadServiceType aServiceType);
|
||||
|
||||
// Update the state of |aButton| for the gamepad at |aIndex| for all
|
||||
// windows that are listening and visible, and fire one of
|
||||
// a gamepadbutton{up,down} event at them as well.
|
||||
// aPressed is used for digital buttons, aValue is for analog buttons.
|
||||
void NewButtonEvent(uint32_t aIndex, GamepadServiceType aServiceType, uint32_t aButton,
|
||||
bool aPressed, bool aTouched, double aValue);
|
||||
|
||||
// Update the state of |aAxis| for the gamepad at |aIndex| for all
|
||||
// windows that are listening and visible, and fire a gamepadaxismove
|
||||
// event at them as well.
|
||||
void NewAxisMoveEvent(uint32_t aIndex, GamepadServiceType aServiceType,
|
||||
uint32_t aAxis, double aValue);
|
||||
|
||||
// Update the state of |aState| for the gamepad at |aIndex| for all
|
||||
// windows that are listening and visible.
|
||||
void NewPoseEvent(uint32_t aIndex, GamepadServiceType aServiceType,
|
||||
const GamepadPoseState& aState);
|
||||
|
||||
// Update the hand of |aHand| for the gamepad at |aIndex| for all
|
||||
// windows that are listening and visible.
|
||||
void NewHandChangeEvent(uint32_t aIndex, GamepadServiceType aServiceType,
|
||||
GamepadHand aHand);
|
||||
|
||||
// Synchronize the state of |aGamepad| to match the gamepad stored at |aIndex|
|
||||
void SyncGamepadState(uint32_t aIndex, Gamepad* aGamepad);
|
||||
|
||||
|
@ -141,6 +118,11 @@ class GamepadManager final : public nsIObserver,
|
|||
|
||||
nsresult Init();
|
||||
|
||||
void MaybeConvertToNonstandardGamepadEvent(const GamepadChangeEvent& aEvent,
|
||||
nsGlobalWindow* aWindow);
|
||||
|
||||
bool SetGamepadByEvent(const GamepadChangeEvent& aEvent, nsGlobalWindow* aWindow = nullptr);
|
||||
|
||||
bool MaybeWindowHasSeenGamepad(nsGlobalWindow* aWindow, uint32_t aIndex);
|
||||
// Returns true if we have already sent data from this gamepad
|
||||
// to this window. This should only return true if the user
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString type, PromiseRejectionEventInit eventInitDict),
|
||||
Exposed=(Window,Worker),
|
||||
Func="nsContentUtils::PromiseRejectionEventsEnabled"]
|
||||
interface PromiseRejectionEvent : Event
|
||||
{
|
||||
[BinaryName="rejectedPromise"]
|
||||
readonly attribute Promise<any> promise;
|
||||
readonly attribute any reason;
|
||||
};
|
||||
|
||||
dictionary PromiseRejectionEventInit : EventInit {
|
||||
required Promise<any> promise;
|
||||
any reason;
|
||||
};
|
|
@ -1082,6 +1082,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [
|
|||
'PresentationConnectionAvailableEvent.webidl',
|
||||
'PresentationConnectionCloseEvent.webidl',
|
||||
'ProgressEvent.webidl',
|
||||
'PromiseRejectionEvent.webidl',
|
||||
'RecordErrorEvent.webidl',
|
||||
'ScrollViewChangeEvent.webidl',
|
||||
'StyleRuleChangeEvent.webidl',
|
||||
|
|
|
@ -35,6 +35,7 @@ WORKER_SIMPLE_PREF("dom.serviceWorkers.enabled", ServiceWorkersEnabled, SERVICEW
|
|||
WORKER_SIMPLE_PREF("dom.serviceWorkers.testing.enabled", ServiceWorkersTestingEnabled, SERVICEWORKERS_TESTING_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.openWindow.enabled", OpenWindowEnabled, OPEN_WINDOW_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.storageManager.enabled", StorageManagerEnabled, STORAGEMANAGER_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.promise_rejection_events.enabled", PromiseRejectionEventsEnabled, PROMISE_REJECTION_EVENTS_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.push.enabled", PushEnabled, PUSH_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.requestcontext.enabled", RequestContextEnabled, REQUESTCONTEXT_ENABLED)
|
||||
WORKER_SIMPLE_PREF("gfx.offscreencanvas.enabled", OffscreenCanvasEnabled, OFFSCREENCANVAS_ENABLED)
|
||||
|
|
|
@ -992,10 +992,25 @@ nsTableFrame::AddDeletedRowIndex(int32_t aDeletedRowStoredIndex)
|
|||
// smallerIter->second < aDeletedRowStoredIndex < greaterIter->first
|
||||
auto greaterIter = mDeletedRowIndexRanges.upper_bound(aDeletedRowStoredIndex);
|
||||
auto smallerIter = greaterIter;
|
||||
|
||||
if (smallerIter != mDeletedRowIndexRanges.begin()) {
|
||||
smallerIter--;
|
||||
// While greaterIter might be out-of-bounds (by being equal to end()),
|
||||
// smallerIter now cannot be, since we returned early above for a 0-size map.
|
||||
}
|
||||
|
||||
// Note: smallerIter can only be equal to greaterIter when both
|
||||
// of them point to the beginning of the map and in that case smallerIter
|
||||
// does not "exist" but we clip smallerIter to point to beginning of map
|
||||
// so that it doesn't point to something unknown or outside the map boundry.
|
||||
// Note: When greaterIter is not the end (i.e. it "exists") upper_bound()
|
||||
// ensures aDeletedRowStoredIndex < greaterIter->first so no need to
|
||||
// assert that.
|
||||
MOZ_ASSERT(smallerIter == greaterIter ||
|
||||
aDeletedRowStoredIndex > smallerIter->second,
|
||||
"aDeletedRowIndexRanges already contains aDeletedRowStoredIndex! "
|
||||
"Trying to delete an already deleted row?");
|
||||
|
||||
if (smallerIter->second == aDeletedRowStoredIndex - 1) {
|
||||
if (greaterIter != mDeletedRowIndexRanges.end() &&
|
||||
greaterIter->first == aDeletedRowStoredIndex + 1) {
|
||||
|
|
|
@ -4940,6 +4940,11 @@ pref("dom.w3c_pointer_events.dispatch_by_pointer_messages", false);
|
|||
// W3C pointer events draft
|
||||
pref("dom.w3c_pointer_events.implicit_capture", false);
|
||||
|
||||
// WHATWG promise rejection events. See
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#promiserejectionevent
|
||||
// TODO: Enable the event interface once actually firing it (bug 1362272).
|
||||
pref("dom.promise_rejection_events.enabled", false);
|
||||
|
||||
// W3C draft ImageCapture API
|
||||
pref("dom.imagecapture.enabled", false);
|
||||
|
||||
|
|
|
@ -3199,7 +3199,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "webrender"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/servo/webrender#c661afa3193b4d00c15509537a8d8fc33aa0c274"
|
||||
source = "git+https://github.com/servo/webrender#005eb39d79afca7ea0dc140d5cf7b809be06589b"
|
||||
dependencies = [
|
||||
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3228,7 +3228,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "webrender_traits"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/servo/webrender#c661afa3193b4d00c15509537a8d8fc33aa0c274"
|
||||
source = "git+https://github.com/servo/webrender#005eb39d79afca7ea0dc140d5cf7b809be06589b"
|
||||
dependencies = [
|
||||
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bincode 1.0.0-alpha6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -32,11 +32,6 @@ pub struct Opts {
|
|||
/// The initial URL to load.
|
||||
pub url: Option<ServoUrl>,
|
||||
|
||||
/// How many threads to use for CPU painting (`-t`).
|
||||
///
|
||||
/// Note that painting is sequentialized when using GPU painting.
|
||||
pub paint_threads: usize,
|
||||
|
||||
/// The maximum size of each tile in pixels (`-s`).
|
||||
pub tile_size: usize,
|
||||
|
||||
|
@ -105,7 +100,7 @@ pub struct Opts {
|
|||
/// font for layout tests.
|
||||
pub enable_text_antialiasing: bool,
|
||||
|
||||
/// If set with --enable-subpixel, use subpixel antialiasing for glyphs. In the future
|
||||
/// If set with --disable-subpixel, use subpixel antialiasing for glyphs. In the future
|
||||
/// this will likely become the default, but for now it's opt-in while we work
|
||||
/// out any bugs and improve the implementation.
|
||||
pub enable_subpixel_text_antialiasing: bool,
|
||||
|
@ -251,8 +246,8 @@ pub struct DebugOptions {
|
|||
/// Disable antialiasing of rendered text.
|
||||
pub disable_text_aa: bool,
|
||||
|
||||
/// Enable subpixel antialiasing of rendered text.
|
||||
pub enable_subpixel_aa: bool,
|
||||
/// Disable subpixel antialiasing of rendered text.
|
||||
pub disable_subpixel_aa: bool,
|
||||
|
||||
/// Disable antialiasing of rendered text on the HTML canvas element.
|
||||
pub disable_canvas_aa: bool,
|
||||
|
@ -354,7 +349,7 @@ impl DebugOptions {
|
|||
"help" => self.help = true,
|
||||
"bubble-widths" => self.bubble_widths = true,
|
||||
"disable-text-aa" => self.disable_text_aa = true,
|
||||
"enable-subpixel-aa" => self.enable_subpixel_aa = true,
|
||||
"disable-subpixel-aa" => self.disable_subpixel_aa = true,
|
||||
"disable-canvas-aa" => self.disable_text_aa = true,
|
||||
"dump-style-tree" => self.dump_style_tree = true,
|
||||
"dump-rule-tree" => self.dump_rule_tree = true,
|
||||
|
@ -504,7 +499,6 @@ pub fn default_opts() -> Opts {
|
|||
Opts {
|
||||
is_running_problem_test: false,
|
||||
url: Some(ServoUrl::parse("about:blank").unwrap()),
|
||||
paint_threads: 1,
|
||||
tile_size: 512,
|
||||
device_pixels_per_px: None,
|
||||
time_profiling: None,
|
||||
|
@ -693,12 +687,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
|
|||
.unwrap_or_else(|err| args_fail(&format!("Error parsing option: --device-pixel-ratio ({})", err)))
|
||||
);
|
||||
|
||||
let mut paint_threads: usize = match opt_match.opt_str("t") {
|
||||
Some(paint_threads_str) => paint_threads_str.parse()
|
||||
.unwrap_or_else(|err| args_fail(&format!("Error parsing option: -t ({})", err))),
|
||||
None => cmp::max(num_cpus::get() * 3 / 4, 1),
|
||||
};
|
||||
|
||||
// If only the flag is present, default to a 5 second period for both profilers
|
||||
let time_profiling = if opt_match.opt_present("p") {
|
||||
match opt_match.opt_str("p") {
|
||||
|
@ -748,7 +736,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
|
|||
|
||||
let mut bubble_inline_sizes_separately = debug_options.bubble_widths;
|
||||
if debug_options.trace_layout {
|
||||
paint_threads = 1;
|
||||
layout_threads = Some(1);
|
||||
bubble_inline_sizes_separately = true;
|
||||
}
|
||||
|
@ -809,7 +796,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
|
|||
let opts = Opts {
|
||||
is_running_problem_test: is_running_problem_test,
|
||||
url: Some(url),
|
||||
paint_threads: paint_threads,
|
||||
tile_size: tile_size,
|
||||
device_pixels_per_px: device_pixels_per_px,
|
||||
time_profiling: time_profiling,
|
||||
|
@ -842,7 +828,7 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
|
|||
show_debug_parallel_layout: debug_options.show_parallel_layout,
|
||||
paint_flashing: debug_options.paint_flashing,
|
||||
enable_text_antialiasing: !debug_options.disable_text_aa,
|
||||
enable_subpixel_text_antialiasing: debug_options.enable_subpixel_aa,
|
||||
enable_subpixel_text_antialiasing: !debug_options.disable_subpixel_aa,
|
||||
enable_canvas_antialiasing: !debug_options.disable_canvas_aa,
|
||||
dump_style_tree: debug_options.dump_style_tree,
|
||||
dump_rule_tree: debug_options.dump_rule_tree,
|
||||
|
|
|
@ -975,12 +975,23 @@ pub struct GradientBorder {
|
|||
pub outset: SideOffsets2D<f32>,
|
||||
}
|
||||
|
||||
/// A border that is made of radial gradient
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
pub struct RadialGradientBorder {
|
||||
/// The gradient info that this border uses, border-image-source.
|
||||
pub gradient: RadialGradient,
|
||||
|
||||
/// Outsets for the border, as per border-image-outset.
|
||||
pub outset: SideOffsets2D<f32>,
|
||||
}
|
||||
|
||||
/// Specifies the type of border
|
||||
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
|
||||
pub enum BorderDetails {
|
||||
Normal(NormalBorder),
|
||||
Image(ImageBorder),
|
||||
Gradient(GradientBorder),
|
||||
RadialGradient(RadialGradientBorder),
|
||||
}
|
||||
|
||||
/// Paints a border.
|
||||
|
|
|
@ -603,66 +603,90 @@ fn build_border_radius_for_inner_rect(outer_rect: &Rect<Au>,
|
|||
}
|
||||
|
||||
fn convert_gradient_stops(gradient_items: &[GradientItem],
|
||||
length: Au,
|
||||
total_length: Au,
|
||||
style: &ServoComputedValues) -> Vec<GradientStop> {
|
||||
// Determine the position of each stop per CSS-IMAGES § 3.4.
|
||||
//
|
||||
// FIXME(#3908, pcwalton): Make sure later stops can't be behind earlier stops.
|
||||
let stop_items = gradient_items.iter().filter_map(|item| {
|
||||
|
||||
// Only keep the color stops, discard the color interpolation hints.
|
||||
let mut stop_items = gradient_items.iter().filter_map(|item| {
|
||||
match *item {
|
||||
GradientItem::ColorStop(ref stop) => Some(stop),
|
||||
GradientItem::ColorStop(ref stop) => Some(*stop),
|
||||
_ => None,
|
||||
}
|
||||
}).collect::<Vec<_>>();
|
||||
let mut stops = Vec::with_capacity(stop_items.len());
|
||||
|
||||
assert!(stop_items.len() >= 2);
|
||||
|
||||
// Run the algorithm from
|
||||
// https://drafts.csswg.org/css-images-3/#color-stop-syntax
|
||||
|
||||
// Step 1:
|
||||
// If the first color stop does not have a position, set its position to 0%.
|
||||
{
|
||||
let first = stop_items.first_mut().unwrap();
|
||||
if first.position.is_none() {
|
||||
first.position = Some(LengthOrPercentage::Percentage(0.0));
|
||||
}
|
||||
}
|
||||
// If the last color stop does not have a position, set its position to 100%.
|
||||
{
|
||||
let last = stop_items.last_mut().unwrap();
|
||||
if last.position.is_none() {
|
||||
last.position = Some(LengthOrPercentage::Percentage(1.0));
|
||||
}
|
||||
}
|
||||
|
||||
// Step 2: Move any stops placed before earlier stops to the
|
||||
// same position as the preceding stop.
|
||||
let mut last_stop_position = stop_items.first().unwrap().position.unwrap();
|
||||
for stop in stop_items.iter_mut().skip(1) {
|
||||
if let Some(pos) = stop.position {
|
||||
if position_to_offset(last_stop_position, total_length)
|
||||
> position_to_offset(pos, total_length) {
|
||||
stop.position = Some(last_stop_position);
|
||||
}
|
||||
last_stop_position = stop.position.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
// Step 3: Evenly space stops without position.
|
||||
// Note: Remove the + 2 if fix_gradient_stops is changed.
|
||||
let mut stops = Vec::with_capacity(stop_items.len() + 2);
|
||||
let mut stop_run = None;
|
||||
for (i, stop) in stop_items.iter().enumerate() {
|
||||
let offset = match stop.position {
|
||||
None => {
|
||||
if stop_run.is_none() {
|
||||
// Initialize a new stop run.
|
||||
let start_offset = if i == 0 {
|
||||
0.0
|
||||
} else {
|
||||
// `unwrap()` here should never fail because this is the beginning of
|
||||
// a stop run, which is always bounded by a length or percentage.
|
||||
position_to_offset(stop_items[i - 1].position.unwrap(), length)
|
||||
};
|
||||
let (end_index, end_offset) =
|
||||
match stop_items[i..]
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find(|&(_, ref stop)| stop.position.is_some()) {
|
||||
None => (stop_items.len() - 1, 1.0),
|
||||
Some((end_index, end_stop)) => {
|
||||
// `unwrap()` here should never fail because this is the end of
|
||||
// a stop run, which is always bounded by a length or
|
||||
// percentage.
|
||||
(end_index,
|
||||
position_to_offset(end_stop.position.unwrap(), length))
|
||||
}
|
||||
};
|
||||
// `unwrap()` here should never fail because this is the beginning of
|
||||
// a stop run, which is always bounded by a length or percentage.
|
||||
let start_offset =
|
||||
position_to_offset(stop_items[i - 1].position.unwrap(), total_length);
|
||||
// `unwrap()` here should never fail because this is the end of
|
||||
// a stop run, which is always bounded by a length or percentage.
|
||||
let (end_index, end_stop) = stop_items[(i + 1)..]
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find(|&(_, ref stop)| stop.position.is_some())
|
||||
.unwrap();
|
||||
let end_offset = position_to_offset(end_stop.position.unwrap(), total_length);
|
||||
stop_run = Some(StopRun {
|
||||
start_offset: start_offset,
|
||||
end_offset: end_offset,
|
||||
start_index: i,
|
||||
stop_count: end_index - i,
|
||||
start_index: i - 1,
|
||||
stop_count: end_index,
|
||||
})
|
||||
}
|
||||
|
||||
let stop_run = stop_run.unwrap();
|
||||
let stop_run_length = stop_run.end_offset - stop_run.start_offset;
|
||||
if stop_run.stop_count == 0 {
|
||||
stop_run.end_offset
|
||||
} else {
|
||||
stop_run.start_offset +
|
||||
stop_run_length * (i - stop_run.start_index) as f32 /
|
||||
(stop_run.stop_count as f32)
|
||||
}
|
||||
stop_run.start_offset +
|
||||
stop_run_length * (i - stop_run.start_index) as f32 /
|
||||
((2 + stop_run.stop_count) as f32)
|
||||
}
|
||||
Some(position) => {
|
||||
stop_run = None;
|
||||
position_to_offset(position, length)
|
||||
position_to_offset(position, total_length)
|
||||
}
|
||||
};
|
||||
stops.push(GradientStop {
|
||||
|
@ -673,6 +697,35 @@ fn convert_gradient_stops(gradient_items: &[GradientItem],
|
|||
stops
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Duplicate the first and last stops if necessary.
|
||||
///
|
||||
/// Explanation by pyfisch:
|
||||
/// If the last stop is at the same position as the previous stop the
|
||||
/// last color is ignored by webrender. This differs from the spec
|
||||
/// (I think so). The implementations of Chrome and Firefox seem
|
||||
/// to have the same problem but work fine if the position of the last
|
||||
/// stop is smaller than 100%. (Otherwise they ignore the last stop.)
|
||||
///
|
||||
/// Similarly the first stop is duplicated if it is not placed
|
||||
/// at the start of the virtual gradient ray.
|
||||
fn fix_gradient_stops(stops: &mut Vec<GradientStop>) {
|
||||
if stops.first().unwrap().offset > 0.0 {
|
||||
let color = stops.first().unwrap().color;
|
||||
stops.insert(0, GradientStop {
|
||||
offset: 0.0,
|
||||
color: color,
|
||||
})
|
||||
}
|
||||
if stops.last().unwrap().offset < 1.0 {
|
||||
let color = stops.last().unwrap().color;
|
||||
stops.push(GradientStop {
|
||||
offset: 1.0,
|
||||
color: color,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the the distance to the nearest or farthest corner depending on the comperator.
|
||||
fn get_distance_to_corner<F>(size: &Size2D<Au>, center: &Point2D<Au>, cmp: F) -> Au
|
||||
where F: Fn(Au, Au) -> Au
|
||||
|
@ -710,7 +763,7 @@ fn convert_circle_size_keyword(keyword: SizeKeyword,
|
|||
center: &Point2D<Au>) -> Size2D<Au> {
|
||||
use style::values::computed::image::SizeKeyword::*;
|
||||
let radius = match keyword {
|
||||
ClosestSide => {
|
||||
ClosestSide | Contain => {
|
||||
let dist = get_distance_to_sides(size, center, ::std::cmp::min);
|
||||
::std::cmp::min(dist.width, dist.height)
|
||||
}
|
||||
|
@ -719,12 +772,7 @@ fn convert_circle_size_keyword(keyword: SizeKeyword,
|
|||
::std::cmp::max(dist.width, dist.height)
|
||||
}
|
||||
ClosestCorner => get_distance_to_corner(size, center, ::std::cmp::min),
|
||||
FarthestCorner => get_distance_to_corner(size, center, ::std::cmp::max),
|
||||
_ => {
|
||||
// TODO(#16542)
|
||||
println!("TODO: implement size keyword {:?} for circles", keyword);
|
||||
Au::new(0)
|
||||
}
|
||||
FarthestCorner | Cover => get_distance_to_corner(size, center, ::std::cmp::max),
|
||||
};
|
||||
Size2D::new(radius, radius)
|
||||
}
|
||||
|
@ -736,15 +784,10 @@ fn convert_ellipse_size_keyword(keyword: SizeKeyword,
|
|||
center: &Point2D<Au>) -> Size2D<Au> {
|
||||
use style::values::computed::image::SizeKeyword::*;
|
||||
match keyword {
|
||||
ClosestSide => get_distance_to_sides(size, center, ::std::cmp::min),
|
||||
ClosestSide | Contain => get_distance_to_sides(size, center, ::std::cmp::min),
|
||||
FarthestSide => get_distance_to_sides(size, center, ::std::cmp::max),
|
||||
ClosestCorner => get_ellipse_radius(size, center, ::std::cmp::min),
|
||||
FarthestCorner => get_ellipse_radius(size, center, ::std::cmp::max),
|
||||
_ => {
|
||||
// TODO(#16542)
|
||||
println!("TODO: implement size keyword {:?} for ellipses", keyword);
|
||||
Size2D::new(Au::new(0), Au::new(0))
|
||||
}
|
||||
FarthestCorner | Cover => get_ellipse_radius(size, center, ::std::cmp::max),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1097,7 +1140,14 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
let length = Au::from_f32_px(
|
||||
(delta.x.to_f32_px() * 2.0).hypot(delta.y.to_f32_px() * 2.0));
|
||||
|
||||
let stops = convert_gradient_stops(stops, length, style);
|
||||
let mut stops = convert_gradient_stops(stops, length, style);
|
||||
|
||||
// Only clamped gradients need to be fixed because in repeating gradients
|
||||
// there is no "first" or "last" stop because they repeat infinitly in
|
||||
// both directions, so the rendering is always correct.
|
||||
if !repeating {
|
||||
fix_gradient_stops(&mut stops);
|
||||
}
|
||||
|
||||
let center = Point2D::new(bounds.size.width / 2, bounds.size.height / 2);
|
||||
|
||||
|
@ -1131,8 +1181,14 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
EndingShape::Ellipse(LengthOrPercentageOrKeyword::Keyword(word))
|
||||
=> convert_ellipse_size_keyword(word, &bounds.size, ¢er),
|
||||
};
|
||||
let length = Au::from_f32_px(radius.width.to_f32_px().hypot(radius.height.to_f32_px()));
|
||||
let stops = convert_gradient_stops(stops, length, style);
|
||||
|
||||
let mut stops = convert_gradient_stops(stops, radius.width, style);
|
||||
// Repeating gradients have no last stops that can be ignored. So
|
||||
// fixup is not necessary but may actually break the gradient.
|
||||
if !repeating {
|
||||
fix_gradient_stops(&mut stops);
|
||||
}
|
||||
|
||||
display_list::RadialGradient {
|
||||
center: center,
|
||||
radius: radius,
|
||||
|
@ -1321,8 +1377,24 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
}),
|
||||
}));
|
||||
}
|
||||
GradientKind::Radial(_, _) => {
|
||||
// TODO(#16638): Handle border-image with radial gradient.
|
||||
GradientKind::Radial(ref shape, ref center) => {
|
||||
let grad = self.convert_radial_gradient(&bounds,
|
||||
&gradient.items[..],
|
||||
shape,
|
||||
center,
|
||||
gradient.repeating,
|
||||
style);
|
||||
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||
base: base,
|
||||
border_widths: border.to_physical(style.writing_mode),
|
||||
details: BorderDetails::RadialGradient(
|
||||
display_list::RadialGradientBorder {
|
||||
gradient: grad,
|
||||
|
||||
// TODO(gw): Support border-image-outset
|
||||
outset: SideOffsets2D::zero(),
|
||||
}),
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2702,12 +2774,10 @@ struct StopRun {
|
|||
|
||||
fn position_to_offset(position: LengthOrPercentage, Au(total_length): Au) -> f32 {
|
||||
match position {
|
||||
LengthOrPercentage::Length(Au(length)) => {
|
||||
(1.0f32).min(length as f32 / total_length as f32)
|
||||
}
|
||||
LengthOrPercentage::Length(Au(length)) => length as f32 / total_length as f32,
|
||||
LengthOrPercentage::Percentage(percentage) => percentage as f32,
|
||||
LengthOrPercentage::Calc(calc) =>
|
||||
(1.0f32).min(calc.percentage() + (calc.length().0 as f32) / (total_length as f32)),
|
||||
calc.percentage() + (calc.length().0 as f32) / (total_length as f32),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -353,15 +353,35 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
}
|
||||
}
|
||||
BorderDetails::Gradient(ref gradient) => {
|
||||
let extend_mode = if gradient.gradient.repeating {
|
||||
ExtendMode::Repeat
|
||||
} else {
|
||||
ExtendMode::Clamp
|
||||
};
|
||||
webrender_traits::BorderDetails::Gradient(webrender_traits::GradientBorder {
|
||||
gradient: builder.create_gradient(
|
||||
gradient.gradient.start_point.to_pointf(),
|
||||
gradient.gradient.end_point.to_pointf(),
|
||||
gradient.gradient.stops.clone(),
|
||||
ExtendMode::Clamp),
|
||||
extend_mode),
|
||||
outset: gradient.outset,
|
||||
})
|
||||
}
|
||||
BorderDetails::RadialGradient(ref gradient) => {
|
||||
let extend_mode = if gradient.gradient.repeating {
|
||||
ExtendMode::Repeat
|
||||
} else {
|
||||
ExtendMode::Clamp
|
||||
};
|
||||
webrender_traits::BorderDetails::RadialGradient(webrender_traits::RadialGradientBorder {
|
||||
gradient: builder.create_radial_gradient(
|
||||
gradient.gradient.center.to_pointf(),
|
||||
gradient.gradient.radius.to_sizef(),
|
||||
gradient.gradient.stops.clone(),
|
||||
extend_mode),
|
||||
outset: gradient.outset,
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
builder.push_border(rect, clip, widths, details);
|
||||
|
|
|
@ -68,7 +68,6 @@ pub extern "C" fn cef_initialize(args: *const cef_main_args_t,
|
|||
};
|
||||
|
||||
let mut temp_opts = opts::default_opts();
|
||||
temp_opts.paint_threads = rendering_threads;
|
||||
temp_opts.headless = false;
|
||||
temp_opts.hard_fail = false;
|
||||
temp_opts.enable_text_antialiasing = true;
|
||||
|
|
|
@ -53,6 +53,7 @@ DIRS += [
|
|||
'reader',
|
||||
'remotebrowserutils',
|
||||
'reflect',
|
||||
'resistfingerprinting',
|
||||
'securityreporter',
|
||||
'startup',
|
||||
'statusfilter',
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
# -*- Mode: python; 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/.
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'nsRFPService.cpp',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
EXPORTS += [
|
||||
'nsRFPService.h',
|
||||
]
|
|
@ -0,0 +1,151 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsRFPService.h"
|
||||
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsJSUtils.h"
|
||||
|
||||
#include "prenv.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
#define RESIST_FINGERPRINTING_PREF "privacy.resistFingerprinting"
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsRFPService, nsIObserver)
|
||||
|
||||
static StaticRefPtr<nsRFPService> sRFPService;
|
||||
static bool sInitialized = false;
|
||||
bool nsRFPService::sPrivacyResistFingerprinting = false;
|
||||
|
||||
/* static */
|
||||
nsRFPService*
|
||||
nsRFPService::GetOrCreate()
|
||||
{
|
||||
if (!sInitialized) {
|
||||
sRFPService = new nsRFPService();
|
||||
nsresult rv = sRFPService->Init();
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
sRFPService = nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ClearOnShutdown(&sRFPService);
|
||||
sInitialized = true;
|
||||
}
|
||||
|
||||
return sRFPService;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsRFPService::Init()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
NS_ENSURE_TRUE(obs, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
rv = obs->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
NS_ENSURE_TRUE(prefs, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
rv = prefs->AddObserver(RESIST_FINGERPRINTING_PREF, this, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// We backup the original TZ value here.
|
||||
const char* tzValue = PR_GetEnv("TZ");
|
||||
if (tzValue) {
|
||||
mInitialTZValue = nsCString(tzValue);
|
||||
}
|
||||
|
||||
// Call UpdatePref() here to cache the value of 'privacy.resistFingerprinting'
|
||||
// and set the timezone.
|
||||
UpdatePref();
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsRFPService::UpdatePref()
|
||||
{
|
||||
sPrivacyResistFingerprinting = Preferences::GetBool(RESIST_FINGERPRINTING_PREF);
|
||||
|
||||
if (sPrivacyResistFingerprinting) {
|
||||
PR_SetEnv("TZ=UTC");
|
||||
} else if (sInitialized) {
|
||||
// We will not touch the TZ value if 'privacy.resistFingerprinting' is false during
|
||||
// the time of initialization.
|
||||
if (!mInitialTZValue.IsEmpty()) {
|
||||
nsAutoCString tzValue = NS_LITERAL_CSTRING("TZ=") + mInitialTZValue;
|
||||
PR_SetEnv(tzValue.get());
|
||||
} else {
|
||||
#if defined(XP_LINUX) || defined (XP_MACOSX)
|
||||
// For POSIX like system, we reset the TZ to the /etc/localtime, which is the
|
||||
// system timezone.
|
||||
PR_SetEnv("TZ=:/etc/localtime");
|
||||
#else
|
||||
// For Windows, we reset the TZ to an empty string. This will make Windows to use
|
||||
// its system timezone.
|
||||
PR_SetEnv("TZ=");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// We don't have to call _tzset() here for Windows since the following
|
||||
// function nsJSUtils::ResetTimeZone() will call it for us.
|
||||
nsJSUtils::ResetTimeZone();
|
||||
}
|
||||
|
||||
void
|
||||
nsRFPService::StartShutdown()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
|
||||
if (obs) {
|
||||
obs->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
|
||||
|
||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
|
||||
if (prefs) {
|
||||
prefs->RemoveObserver(RESIST_FINGERPRINTING_PREF, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRFPService::Observe(nsISupports* aObject, const char* aTopic,
|
||||
const char16_t* aMessage)
|
||||
{
|
||||
if (!strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, aTopic)) {
|
||||
NS_ConvertUTF16toUTF8 pref(aMessage);
|
||||
|
||||
if (pref.EqualsLiteral(RESIST_FINGERPRINTING_PREF)) {
|
||||
UpdatePref();
|
||||
}
|
||||
}
|
||||
|
||||
if (!strcmp(NS_XPCOM_SHUTDOWN_OBSERVER_ID, aTopic)) {
|
||||
StartShutdown();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef __nsRFPService_h__
|
||||
#define __nsRFPService_h__
|
||||
|
||||
#include "nsIObserver.h"
|
||||
|
||||
#include "nsString.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class nsRFPService final : public nsIObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
static nsRFPService* GetOrCreate();
|
||||
static bool IsResistFingerprintingEnabled()
|
||||
{
|
||||
return sPrivacyResistFingerprinting;
|
||||
}
|
||||
|
||||
private:
|
||||
nsresult Init();
|
||||
|
||||
nsRFPService() {}
|
||||
|
||||
~nsRFPService() {}
|
||||
|
||||
void UpdatePref();
|
||||
void StartShutdown();
|
||||
|
||||
static bool sPrivacyResistFingerprinting;
|
||||
|
||||
nsCString mInitialTZValue;
|
||||
};
|
||||
|
||||
} // mozilla namespace
|
||||
|
||||
#endif /* __nsRFPService_h__ */
|
|
@ -580,7 +580,7 @@ PROT_ListManager.prototype.updateError_ = function(table, updateUrl, result) {
|
|||
this.updateInterval, false);
|
||||
|
||||
Services.obs.notifyObservers(null, "safebrowsing-update-finished",
|
||||
"update error(" + result + ")");
|
||||
"update error: " + result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -608,7 +608,7 @@ PROT_ListManager.prototype.downloadError_ = function(table, updateUrl, status) {
|
|||
delay, false);
|
||||
|
||||
Services.obs.notifyObservers(null, "safebrowsing-update-finished",
|
||||
"download error(" + status + ")");
|
||||
"download error: " + status);
|
||||
}
|
||||
|
||||
PROT_ListManager.prototype.QueryInterface = function(iid) {
|
||||
|
|
|
@ -85,7 +85,17 @@ var Provider = {
|
|||
document.getElementById("update-" + p).disabled = false;
|
||||
|
||||
let elem = document.getElementById(p + "-col-lastupdateresult");
|
||||
elem.childNodes[0].nodeValue = aData;
|
||||
if (aData.startsWith("success")) {
|
||||
elem.childNodes[0].nodeValue = bundle.GetStringFromName("success");
|
||||
} else if (aData.startsWith("update error")) {
|
||||
elem.childNodes[0].nodeValue =
|
||||
bundle.formatStringFromName("updateError", [aData.split(": ")[1]], 1);
|
||||
} else if (aData.startsWith("download error")) {
|
||||
elem.childNodes[0].nodeValue =
|
||||
bundle.formatStringFromName("downloadError", [aData.split(": ")[1]], 1);
|
||||
} else {
|
||||
elem.childNodes[0].nodeValue = aData;
|
||||
}
|
||||
},
|
||||
|
||||
register() {
|
||||
|
|
|
@ -17,3 +17,9 @@ Disabled = Disabled
|
|||
Updating = updating
|
||||
|
||||
CannotUpdate = cannot update
|
||||
|
||||
success = success
|
||||
|
||||
updateError = update error (%S)
|
||||
|
||||
downloadError = download error (%S)
|
|
@ -714,6 +714,21 @@ CreateCSSNode(const char* aName, GtkStyleContext* aParentStyle, GType aType)
|
|||
gtk_style_context_set_parent(context, aParentStyle);
|
||||
gtk_widget_path_unref(path);
|
||||
|
||||
// In GTK 3.4, gtk_render_* functions use |theming_engine| on the style
|
||||
// context without ensuring any style resolution sets it appropriately
|
||||
// in style_data_lookup(). e.g.
|
||||
// https://git.gnome.org/browse/gtk+/tree/gtk/gtkstylecontext.c?h=3.4.4#n3847
|
||||
//
|
||||
// That can result in incorrect drawing on first draw. To work around this,
|
||||
// force a style look-up to set |theming_engine|. It is sufficient to do
|
||||
// this only on context creation, instead of after every modification to the
|
||||
// context, because themes typically (Ambiance and oxygen-gtk, at least) set
|
||||
// the "engine" property with the '*' selector.
|
||||
if (GTK_MAJOR_VERSION == 3 && gtk_get_minor_version() < 6) {
|
||||
GdkRGBA unused;
|
||||
gtk_style_context_get_color(context, GTK_STATE_FLAG_NORMAL, &unused);
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче